I just tried this method and it does work if you are using integers or whole
numbers. However, I am working with time on my x axis. So when I zoom too
close, floating point numbers are required... Is there any way to just turn
off the exponent number in the right corner and force the x tick labels to
be integers or floating point depending on how close one is zoomed?



David Simpson-3 wrote:
> 
> I also had some trouble with exponents in an axis, getting
> 0.0 to 3.0 on the axis, with +1.998e3. I wanted the years
> 1998 to 2001 instead. I solved this using the following code
> (with the solution bits commented out):
> 
> #!/usr/bin/env python
> from pylab import *
> # from matplotlib.ticker import FormatStrFormatter
> 
> x = array([ 1998, 1999, 2000, 2001 ])
> y = array([   2.3, 4.5, 2.6, 7.2 ])
> 
> # ax=subplot(111)
> plot(x,y)
> 
> ## Needed to get 2001, not 1+2e3:
> # majorFormatter=FormatStrFormatter('%d')
> # ax.xaxis.set_major_formatter(majorFormatter)
> # show()
> 
> 
> Dave
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 


-----
Krishna Adrianto Pribadi
Test Engineer
Harley-Davidson Motor Co.
Talladega Test Facility
Vehicle Test Stands
-- 
View this message in context: 
http://old.nabble.com/Re%3A-Forcing-full-value-on-axis-%28Dave-Simpson%29-tp10175415p28260517.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to