change default format of ticks on vertical axis

Hello List,

My values on the vertical axis are large, but the range is small:

plot([3004,3005,3006])

By default this plots 0,1,2 as tickmarks along the vertical axis, and then at the top of the vertical axis is prints “+3.005e3”.

I prefer to simply get 3004,3005,3006 at the tickmarks.

Any (easy) way I can change the default formatting?

Sorry for the easy question,

Mark

Here is an example of what you are looking for. There are other formatters as well, but this is pretty straight-forward to modify to your needs.

http://matplotlib.sourceforge.net/examples/pylab_examples/custom_ticker1.html?highlight=tick%20formatter

I hope this helps!
Ben Root

···

On Mon, Mar 7, 2011 at 3:51 PM, Mark Bakker <markbak@…2015…87…> wrote:

Hello List,

My values on the vertical axis are large, but the range is small:

plot([3004,3005,3006])

By default this plots 0,1,2 as tickmarks along the vertical axis, and then at the top of the vertical axis is prints “+3.005e3”.

I prefer to simply get 3004,3005,3006 at the tickmarks.

Any (easy) way I can change the default formatting?

Sorry for the easy question,

Mark

Hello List,

My values on the vertical axis are large, but the range is small:

plot([3004,3005,3006])

By default this plots 0,1,2 as tickmarks along the vertical axis, and
then at the top of the vertical axis is prints "+3.005e3".

I prefer to simply get 3004,3005,3006 at the tickmarks.

Any (easy) way I can change the default formatting?

If you are using a recent mpl, try following your plot command with

ticklabel_format(useOffset=False)

Eric

···

On 03/07/2011 11:51 AM, Mark Bakker wrote:

Sorry for the easy question,

Mark

------------------------------------------------------------------------------
What You Don't Know About Data Connectivity CAN Hurt You
This paper provides an overview of data connectivity, details
its effect on application quality, and explores various alternative
solutions. http://p.sf.net/sfu/progress-d2d

_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users