plt scale x-axis by constant factor f

How can I scale my x-axis [0,3000] for the data to now correspond/show up
as [0, 300]?

In xmgrace, this is done with a linear transformation, but I cannot seem
to find the command to do this with matplotlib.

Best

Christian,

It sounds like you want to rescale your x axis values before plotting or use the x axis formatter. For the latter see
http://matplotlib.org/examples/pylab_examples/major_minor_demo1.html
http://matplotlib.org/examples/pylab_examples/custom_ticker1.html

-Sterling

···

On Mar 9, 2015, at 10:38AM, Christian Jorgensen <chrisjorg@...287...> wrote:

How can I scale my x-axis [0,3000] for the data to now correspond/show up
as [0, 300]?

In xmgrace, this is done with a linear transformation, but I cannot seem
to find the command to do this with matplotlib.

Best

------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Ok, this really should be simple (and I am sure it is), but I cannot, for the life of me, find the appropriate documentation for it. We need better documentation about how to utilize the offset-text feature of tickers. It can be either a multiple offset or an additive offset.

In any case, I know there is a better way to do this, but here is a quick-n-dirty example that can get you where you want. Just modify the formatter used by the tickers to report the value as divided by 10.
http://matplotlib.org/examples/pylab_examples/custom_ticker1.html

Cheers!

Ben Root

···

On Mon, Mar 9, 2015 at 1:38 PM, Christian Jorgensen <chrisjorg@…287…> wrote:

How can I scale my x-axis [0,3000] for the data to now correspond/show up
as [0, 300]?

In xmgrace, this is done with a linear transformation, but I cannot seem
to find the command to do this with matplotlib.

Best


Dive into the World of Parallel Programming The Go Parallel Website, sponsored

by Intel and developed in partnership with Slashdot Media, is your hub for all

things parallel software development, from weekly thought leadership blogs to

news, videos, case studies, tutorials and more. Take a look and join the

conversation now. http://goparallel.sourceforge.net/


Matplotlib-users mailing list

Matplotlib-users@lists.sourceforge.net

https://lists.sourceforge.net/lists/listinfo/matplotlib-users