Re: [Matplotlib-users] Plotting style

2015-03-09 Thread Marin GILLES
Le 10/03/2015 07:52, Eric Firing a écrit : On 2015/03/09 8:14 PM, Marin GILLES wrote: Hi, As suggested in PR 2702 , I have been trying to tell |scatter| to |get_current_color_cycle| for the facecolor. I guess I can use |axes.get_color()|to get

Re: [Matplotlib-users] Plotting style

2015-03-09 Thread Eric Firing
On 2015/03/09 8:14 PM, Marin GILLES wrote: > Hi, > As suggested in PR 2702 > , I have been trying > to tell |scatter| to |get_current_color_cycle| for the facecolor. I > guess I can use |axes.get_color()|to get the current color in the color > cyc

Re: [Matplotlib-users] Plotting style

2015-03-09 Thread Marin GILLES
Le 06/03/2015 22:42, Marin GILLES a écrit : This package is indeeed pretty nice, and I will surely take a look into it, but the way styles are added does not seem quite practical or shareable. In my opinion, having a style file for each paper makes things more flexible, although this package m

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Benjamin Root
You might need to put parentheses around the statement for the lambda... formatter = FuncFormatter(lambda x, pos: ("%d" % x/10)) Also, a tweak to my code. Change most of the "plt" to "ax" and use the appropriate methods. I suspect that the ipython session you are in is messing up the pyplot state

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Christian Jorgensen
I want to thank the users for their invaluable help. My final error concerns the plotting: in (x, pos)> 1 formatter = FuncFormatter(lambda x, pos: "%d" % x/10) 2 3 fig, ax = plt.subplots() 4 ax.yaxis.set_major_formatter(formatter) 5 a= plt.plot(D.dtrajs[0]) TypeErro

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Christian Jorgensen
Sterling, this doesn't work, as it's using the array as a function x = D.dtrajs[0](range(len(D.dtrajs[0]))) plt.plot(D.dtrajs[0]) plt.ylabel('O2-Fe distance') plt.xlabel('Frame') ---TypeError

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Christian Jorgensen
Thanks, I ran Benjamin's code but it doesn't display the figure anymore. It only prints a text about the figure 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.xl

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Benjamin Root
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 wrote: > Christian, > > To de

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Sterling Smith
That was untested. It should start with (still untested) x = array(range(len(array)) On Mar 9, 2015, at 11:11AM, Sterling Smith 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, Christi

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Sterling Smith
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 wrote: > > My array does not have an explicit x-coordinate > representation. The x-coordinate is simply the index. > > print(array) > [ 0 0 20

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Christian Jorgensen
My array is called D.dtrajs[0] I'm plotting it as plt.plot(D.dtrajs[0]) plt.ylabel('O2-Fe distance') plt.xlabel('Frame') There is thus no x-variable defined to scale or modify. How would you do this? > > > On Mon, Mar 9, 2015 at 6:03 PM, Benjamin Root wrote: > >> I am not sure I understand

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Benjamin Root
I am not sure I understand. I took your question as "how do I make my x tick labels show values as [0, 300] when my values really are [0, 3000]?". Are the indexes you speak of ranging from 0 to 3000? If so, I don't see how our examples aren't sufficient. As for formatting x "because it is not defin

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Christian Jorgensen
> 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 explici

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Benjamin Root
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 t

Re: [Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Sterling Smith
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 1

[Matplotlib-users] plt scale x-axis by constant factor f

2015-03-09 Thread Christian Jorgensen
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

Re: [Matplotlib-users] Newbie Q re: Lorenz attractor

2015-03-09 Thread Prahas David Nafissian
Dear Ben, Amit, and Ryan, Thanks so much for your input! Looking forward to finding the time to give it a go! Best, --Prahas On Sun, Mar 8, 2015 at 7:14 PM, Benjamin Root wrote: > Yes, absolutely it will work... so long as you do not use blitting. Blitting > for mplot3d is pretty much useles