Skip to content

Commit

Permalink
Force scientific notation in CF plotting (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
msimet committed Mar 14, 2016
1 parent 46b3c4b commit 3630cc0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions stile/sys_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down

0 comments on commit 3630cc0

Please sign in to comment.