1

This is the follow up question from this post. Can I define the x-axis as x 10^4 instead of +55478? Some of my data would be more meaningful if it is not factored out. I was planning to post the image but I don't have enough point :(.Thanks,

Community
  • 1
  • 1
  • Sure you can. Whats stopping you from doing that? Are you getting an error? – Paul Seeb Mar 14 '14 at 11:54
  • Hi Paul, I would like to get a standard notion instead of factoring all values. Do I have to manually do it or if there a way to set it up for standard notion? For e.g., [200 400 600]=> always [1 2 3] 2e2 instead of [2 4 6] 1e2. I want to get the latter. – user3400793 Mar 14 '14 at 11:56
  • I am still a little confused with your question. Do you mean to say you are looking for a generic approach to window all of your data with a standard set (i.e 1e-6 through 1e-7) of tick labels? The default is just to plot the domain of the input without scientific notation. When you say factoring values what exactly do you mean? Finding the min and max in your domain? – Paul Seeb Mar 14 '14 at 12:02
  • Here is the link. https://www.dropbox.com/s/avo6reyb2j7dalk/matlab.pdf .If you look at the Yaxis, it only takes out 10^9 in matlab instead of taking 2x10^9 if I use python. – user3400793 Mar 14 '14 at 12:12
  • Sorry link doesnt work for me – Paul Seeb Mar 14 '14 at 12:20
  • Follow @joekington 's answer http://stackoverflow.com/a/3679918/380231 – tacaswell Mar 14 '14 at 14:14

1 Answers1

4

You can change the default value from this 'the axes.formatter.limits': [-7, 7] to plt.rcParams['axes.formatter.limits']=(-3,3). Or

plt.rcParams['figure.figsize'] = (9,9)
x = np.linspace(55478, 55486, 100) 
y = np.random.random(100) - 0.5
y = np.cumsum(y)
plt.ticklabel_format(style='sci', axis='both', scilimits=(0,0),useOffset=False)
plt.plot(x,y,'b-')

enter image description here

Aung
  • 443
  • 5
  • 15