ACCLAB/dabestr

contrast_ylim does not work for matplotlib

CalvinChad opened this issue · 2 comments

Hi, Im running the code in jupyter lab (python) in order to produce gardiner-altman plots, but for some reason contrast_ylim does not set the y limits. Am I missing something, or is there an issue?

my_color_palette = {"WT" : "black",
"K$_V$2.1$^{OFF}$" : "grey"}

f, axx = plt.subplots(nrows=2, ncols=2, figsize=(7,5),gridspec_kw={'wspace': 0.6, 'hspace':0.5
})

Res = dabest.load(Gxtx_ALL_Mature, idx=("WT","K$_V$2.1$^{OFF}$"),x="rel_cond", y="Res_Mohm",id_col="Cell_ID")
Cap = dabest.load(Gxtx_ALL_Mature, idx=("WT","K$_V$2.1$^{OFF}$"),x="rel_cond", y="Cap_pF",id_col="Cell_ID")
Rheo = dabest.load(Gxtx_ALL_Mature, idx=("WT","K$_V$2.1$^{OFF}$"),x="rel_cond", y="Rheo_nA",id_col="Cell_ID")
RMP = dabest.load(Gxtx_ALL_Mature, idx=("WT","K$_V$2.1$^{OFF}$"),x="rel_cond", y="RMP",id_col="Cell_ID")

Res.hedges_g.plot(ax=axx.flat[0],swarm_label='Resistance (MOhm)', es_marker_size=4,
raw_marker_size=3.5,custom_palette=my_color_palette, contrast_label='effect size (Hedges g)', swarm_ylim=(0,60), contrast_ylim=(-1,1));
Cap.hedges_g.plot(ax=axx.flat[1],swarm_label='Capacitance (pF)', es_marker_size=4,
raw_marker_size=3.5, custom_palette=my_color_palette, contrast_label='effect size (Hedges g)', swarm_ylim=(0,1000),contrast_ylim=(-1,1));
Rheo.hedges_g.plot(ax=axx.flat[2],swarm_label='Rheobase (nA)', es_marker_size=4,
raw_marker_size=3.5, custom_palette=my_color_palette, contrast_label='effect size (Hedges g)', swarm_ylim=(0,4),contrast_ylim=(-1,1));
RMP.hedges_g.plot(ax=axx.flat[3],swarm_label='RMP (mV)', es_marker_size=4,
raw_marker_size=3.5, custom_palette=my_color_palette, contrast_label='effect size (Hedges g)',swarm_ylim=(-100,-40), contrast_ylim=(-1,1))

Con_KO_membrane_esPlot
;

Hi @CalvinChad ,

Sorry for the inconvenience, but could you open an issue at https://github.com/ACCLAB/DABEST-Python instead? This issue tracker here is meant for the R package; and this little bit goes a long way in streamlining our responses.

Closing for now.

Thanks,
Joses