Or just do this:

formatter = FuncFormatter(lambda x, pos: "%d" % x/10)
fig, ax = 
plt.subplots()ax.yaxis.set_major_formatter(formatter)plt.plot(D.dtrajs[0])
plt.ylabel('O2-Fe distance')
plt.xlabel('Frame')
plt.show()



On Mon, Mar 9, 2015 at 2:11 PM, Sterling Smith <smit...@fusion.gat.com>
wrote:

> Christian,
>
> To define your x coordinate, try
> x = range(len(array))
> x = x/10.
> plot(x,array)
>
> -Sterling
>
> On Mar 9, 2015, at 10:57AM, Christian Jorgensen <chrisj...@gmail.com>
> wrote:
>
> >
> > My array does not have an explicit x-coordinate
> > representation. The x-coordinate is simply the index.
> >
> > print(array)
> > [ 0  0 20 ...,  8  8  8]
> >
> >
> > Thus what I would like is to adjoin the element
> > index as another row, how is this possible?
> >
> >
> > I cannot format x because it is not explicitly defined.
> >
> >
> >
> > On Mon, Mar 9, 2015 at 5:52 PM, Benjamin Root<ben.r...@ou.edu> wrote:
> > 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<chrisj...@gmail.com>
> 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
> >
> >
> >
> >
> >
> > --
> > _______
> >
> > Christian Jørgensen
> >
> >
> >
> > --
> > _______
> >
> > Christian Jørgensen
> >
> ------------------------------------------------------------------------------
> > 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
>
>
>
> ------------------------------------------------------------------------------
> 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
>
------------------------------------------------------------------------------
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

Reply via email to