From 3630cc05280c1b57dd40b9415240b4d33e3a9c14 Mon Sep 17 00:00:00 2001 From: Melanie Simet Date: Mon, 14 Mar 2016 16:01:54 -0400 Subject: [PATCH] Force scientific notation in CF plotting (#77) --- stile/sys_tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stile/sys_tests.py b/stile/sys_tests.py index 5c1f3b4..36cc855 100644 --- a/stile/sys_tests.py +++ b/stile/sys_tests.py @@ -547,6 +547,8 @@ def plot(self, data, colors=['r', 'b'], log_yscale=False, ax.set_xscale('log') ax.set_yscale(yscale) ax.set_xlim(xlim) + # To prevent too-long decimal y-axis ticklabels that push the label out of frame + ax.ticklabel_format(axis='y', style='sci', scilimits=(-3,5)) ax.set_ylabel(pd.y_title) ax.legend() if pd.x_field and plot_bmode and pd.t_im_field: @@ -559,6 +561,7 @@ def plot(self, data, colors=['r', 'b'], log_yscale=False, label=pd.x_im_title) ax.set_xscale('log') ax.set_yscale(yscale) + ax.ticklabel_format(axis='y', style='sci', scilimits=(-3,5)) ax.set_xlim(xlim) ax.set_ylabel(pd.y_title) ax.legend() @@ -573,6 +576,7 @@ def plot(self, data, colors=['r', 'b'], log_yscale=False, color=colors[1], label=pd.datarandom_x_title+'d}$') ax.set_xscale('log') ax.set_yscale(yscale) + ax.ticklabel_format(axis='y', style='sci', scilimits=(-3,5)) ax.set_xlim(xlim) ax.set_ylabel(pd.y_title) ax.legend() @@ -587,6 +591,7 @@ def plot(self, data, colors=['r', 'b'], log_yscale=False, color=colors[1], label=pd.datarandom_x_title+'r}$') ax.set_xscale('log') ax.set_yscale(yscale) + ax.ticklabel_format(axis='y', style='sci', scilimits=(-3,5)) ax.set_xlim(xlim) ax.set_ylabel(pd.y_title) ax.legend()