Re: [Matplotlib-users] problems with autoscale_view

2010-08-30 Thread xyz
On 30/08/10 03:51, Benjamin Root wrote:
 maxy = max(max(y1), max(y2))
 maxx = max(x)

 ax.set_xlim((0.0, maxx))
 ax.set_ylim((0.0, maxy))
Thank you, but unfortunately I have still the same problems:
* plt.text appears outside x and y coordinates
* and the coordinates starts not from 0

with the updated code:
from pylab import *
import matplotlib.pyplot as plt

x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 
20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
y1 = [20, 24, 8, 4, 12, 22, 31, 25, 15, 28, 12, 27, 22, 22, 27, 14, 32, 
28, 8, 17, 2, 8, 29, 13, 14, 20, 11, 28, 8]
y2= [2, 32, 28, 1, 22, 11, 14, 27, 3, 31, 12, 20, 32, 24, 24, 16, 7, 10, 
12, 11, 3, 32, 10, 20, 14, 14, 3, 25, 14]
point_labels1 = ['A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 
'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 
'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 
'A=1']
point_labels2 = ['B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 
'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 
'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 
'B=1']

fig = plt.figure()
ax = fig.add_subplot(111)

ax.set_title('The red point should be on the path')

plt.plot(x, y1, 'bo', x, y2, 'go')
ax.grid(True)
maxy = max(max(y1), max(y2))
maxx = max(x)

ax.set_xlim((0.0, maxx))
ax.set_ylim((0.0, maxy))

fig.autofmt_xdate()

plt.xticks(range(0, 40, 1))

plt.yticks(range(0, 40, 1))
plt.xlabel('Longitude')
plt.ylabel('Latitude')
plt.legend(('Model length', 'Data length'),
'best', shadow=True, fancybox=True)

for i, label in enumerate(y1):
   plt.text (x[i], y1[i]+0.2, label,
 horizontalalignment='center' )

for i, label in enumerate(y2):
   plt.text (x[i], y2[i]+0.2, label,
 horizontalalignment='center' )


ax.autoscale_view()
plt.savefig('test.png')
plt.show()

What did I wrong?

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Matplotlib 1.0.0 OS X Binaries for Python 2.7?

2010-08-30 Thread Åke Kullenberg
I've seen some posts asking for the same thing, but there's been quite some
time now. Does anyone know the progress? Should I wait, or just downgrade to
2.6 for now?

Thanks
--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] problems with autoscale_view

2010-08-30 Thread Ryan May
On Mon, Aug 30, 2010 at 4:44 AM, xyz mit...@op.pl wrote:
 On 30/08/10 03:51, Benjamin Root wrote:
 maxy = max(max(y1), max(y2))
 maxx = max(x)

 ax.set_xlim((0.0, maxx))
 ax.set_ylim((0.0, maxy))
 Thank you, but unfortunately I have still the same problems:
 * plt.text appears outside x and y coordinates
 * and the coordinates starts not from 0

 with the updated code:
 from pylab import *
 import matplotlib.pyplot as plt

 x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
 20, 21, 22, 23, 24, 25, 26, 27, 28, 29]
 y1 = [20, 24, 8, 4, 12, 22, 31, 25, 15, 28, 12, 27, 22, 22, 27, 14, 32,
 28, 8, 17, 2, 8, 29, 13, 14, 20, 11, 28, 8]
 y2= [2, 32, 28, 1, 22, 11, 14, 27, 3, 31, 12, 20, 32, 24, 24, 16, 7, 10,
 12, 11, 3, 32, 10, 20, 14, 14, 3, 25, 14]
 point_labels1 = ['A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1',
 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1',
 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1', 'A=1',
 'A=1']
 point_labels2 = ['B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1',
 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1',
 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1', 'B=1',
 'B=1']

 fig = plt.figure()
 ax = fig.add_subplot(111)

 ax.set_title('The red point should be on the path')

 plt.plot(x, y1, 'bo', x, y2, 'go')
 ax.grid(True)
 maxy = max(max(y1), max(y2))
 maxx = max(x)

 ax.set_xlim((0.0, maxx))
 ax.set_ylim((0.0, maxy))

 fig.autofmt_xdate()

 plt.xticks(range(0, 40, 1))

 plt.yticks(range(0, 40, 1))
 plt.xlabel('Longitude')
 plt.ylabel('Latitude')
 plt.legend(('Model length', 'Data length'),
            'best', shadow=True, fancybox=True)

 for i, label in enumerate(y1):
   plt.text (x[i], y1[i]+0.2, label,
             horizontalalignment='center' )

 for i, label in enumerate(y2):
   plt.text (x[i], y2[i]+0.2, label,
             horizontalalignment='center' )


 ax.autoscale_view()
 plt.savefig('test.png')
 plt.show()

 What did I wrong?

Like Eric said, the call to ax.autoscale_view() overrides the limits
you set by hand. Remove this line.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

--
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib 1.0.0 OS X Binaries for Python 2.7?

2010-08-30 Thread Russell E. Owen
I don't think there is a release numpy that is compatible with Python 
2.7 (though it is due shortly in the form of numpy 1.5) and matplotlib 
requires numpy.

-- Russell

In article 
aanlktikni4k5qkrzt=0amydsxjjy7ka4u5tmsnpfe...@mail.gmail.com,
 Åke Kullenberg 
 ake.kullenb...@gmail.com wrote:

 I've seen some posts asking for the same thing, but there's been quite some
 time now. Does anyone know the progress? Should I wait, or just downgrade to
 2.6 for now?
 
 Thanks
 -
 --
 Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
 Be part of this innovative community and reach millions of netbook users 
 worldwide. Take advantage of special opportunities to increase revenue and 
 speed time-to-market. Join now, and jumpstart your future.
 http://p.sf.net/sfu/intel-atom-d2d
 -
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

I


--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Reduce image size

2010-08-30 Thread Jeremy Conlin
I have a matplotlib plot that I saved to a pdf image.  The plot
consists of 1E5 dots plotted with varying colors and opacities.
Actually 1E5 black dots with varying opacities and 64 colored markers.
 The trouble is my image is 11 MB and takes a few seconds to fully
display in a PDF reader.  I am using this figure in a presentation and
therefore need to reduce the file size so it will display more
quickly.  Is there any way I can reduce the size of my image while
still keeping all the data?

Thanks,
Jeremy

--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Reduce image size

2010-08-30 Thread Daπid
If it is only one image, an easy low-tech workaround is to save it as
PNG and then put it into a PDF. This way, you only have to load one
element.

On Mon, Aug 30, 2010 at 11:36 PM, Jeremy Conlin jlcon...@gmail.com wrote:
 I have a matplotlib plot that I saved to a pdf image.  The plot
 consists of 1E5 dots plotted with varying colors and opacities.
 Actually 1E5 black dots with varying opacities and 64 colored markers.
  The trouble is my image is 11 MB and takes a few seconds to fully
 display in a PDF reader.  I am using this figure in a presentation and
 therefore need to reduce the file size so it will display more
 quickly.  Is there any way I can reduce the size of my image while
 still keeping all the data?

 Thanks,
 Jeremy

 --
 This SF.net Dev2Dev email is sponsored by:

 Show off your parallel programming skills.
 Enter the Intel(R) Threading Challenge 2010.
 http://p.sf.net/sfu/intel-thread-sfd
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Reduce image size

2010-08-30 Thread Gökhan Sever
On Mon, Aug 30, 2010 at 4:36 PM, Jeremy Conlin jlcon...@gmail.com wrote:

 I have a matplotlib plot that I saved to a pdf image.  The plot
 consists of 1E5 dots plotted with varying colors and opacities.
 Actually 1E5 black dots with varying opacities and 64 colored markers.
  The trouble is my image is 11 MB and takes a few seconds to fully
 display in a PDF reader.  I am using this figure in a presentation and
 therefore need to reduce the file size so it will display more
 quickly.  Is there any way I can reduce the size of my image while
 still keeping all the data?

 Thanks,
 Jeremy


 --
 This SF.net Dev2Dev email is sponsored by:

 Show off your parallel programming skills.
 Enter the Intel(R) Threading Challenge 2010.
 http://p.sf.net/sfu/intel-thread-sfd
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


There a few pdf related parameters in the matplotlibrc file (e.g.
resolution, compression). You could play around with them to see if you can
get any lower-size output.

-- 
Gökhan
--
This SF.net Dev2Dev email is sponsored by:

Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users