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,
-
Sure you can. Whats stopping you from doing that? Are you getting an error?Paul Seeb– Paul Seeb2014-03-14 11:54:08 +00:00Commented 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.user3400793– user34007932014-03-14 11:56:22 +00:00Commented 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?Paul Seeb– Paul Seeb2014-03-14 12:02:29 +00:00Commented 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.user3400793– user34007932014-03-14 12:12:35 +00:00Commented Mar 14, 2014 at 12:12
-
Sorry link doesnt work for mePaul Seeb– Paul Seeb2014-03-14 12:20:40 +00:00Commented Mar 14, 2014 at 12:20
|
Show 1 more comment
1 Answer
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-')
