Re: [Matplotlib-users] legend missed one dataset

2010-08-26 Thread xyz
On 26/08/10 01:15, Benjamin Root wrote: I believe you are asking why the x axis starts at 2? This is because matplotlib will automatically set the limits of your plot to show all of your data. If you can control the axes yourself by calling set_xlim() and/or set_ylim(). ax.set_xlim(0.0,

Re: [Matplotlib-users] legend missed one dataset

2010-08-26 Thread Ryan May
On Thu, Aug 26, 2010 at 6:18 AM, xyz mit...@op.pl wrote: On 26/08/10 01:15, Benjamin Root wrote: I believe you are asking why the x axis starts at 2?  This is because matplotlib will automatically set the limits of your plot to show all of your data.  If you can control the axes yourself by

Re: [Matplotlib-users] legend missed one dataset

2010-08-25 Thread xyz
Thank you, but why the coordinates start from 2 and not from 0 with the following code? from pylab import * import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) for i in [[2,2], [2,3], [4.2,3.5]]: print i[0],i[1] plt.plot(i[0],i[1],'o') ax.grid(True)

Re: [Matplotlib-users] legend missed one dataset

2010-08-25 Thread Benjamin Root
On Wed, Aug 25, 2010 at 4:53 AM, xyz mit...@op.pl wrote: Thank you, but why the coordinates start from 2 and not from 0 with the following code? from pylab import * import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) for i in [[2,2], [2,3], [4.2,3.5]]: print

[Matplotlib-users] legend missed one dataset

2010-08-24 Thread xyz
Hello, the following script creates a legend for only two instead of three datasets. --- from pylab import * import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111) for i in [[2,2], [2,3], [4.2,3.5]]: print i[0],i[1] plt.plot(i[0],i[1],'o') ax.grid(True)

Re: [Matplotlib-users] legend missed one dataset

2010-08-24 Thread Michael Droettboom
You have plotted three lines, but only provided legend labels for two of them. Try: plt.legend(('Model length', 'Data length', 'Something else'), 'best', shadow=True, fancybox=True) Mike On 08/24/2010 06:33 AM, xyz wrote: Hello, the following script creates a legend for only