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,

6
  • Sure you can. Whats stopping you from doing that? Are you getting an error? Commented Mar 14, 2014 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. Commented Mar 14, 2014 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? Commented Mar 14, 2014 at 12:02
  • Here is the link. 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. Commented Mar 14, 2014 at 12:12
  • Sorry link doesnt work for me Commented Mar 14, 2014 at 12:20

1 Answer 1

3

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.