Re: [Matplotlib-users] plotting a contour from dicrete data points

2007-07-07 Thread Jeff Whitaker
Viraj Vajratkar wrote:


 On 7/3/07, *Jeff Whitaker* [EMAIL PROTECTED] 
 mailto:[EMAIL PROTECTED] wrote:

 Michael Newman wrote:
  My understanding is the contour method only handles plots of
  functions, e.g. f(x,y) = z, and not discrete points. I tried looking
  into this weeks ago, and couldn't find a way to handle discrete
 points.
 
  I'd love to be able to do Kriging or Inverse Distance Weighting
 contour
  lines on XY points I have of pollution concentrations at various
 monitors...
 
 
 Michael:  There are three different methods for doing this
 described at

 http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data

 -Jeff

 --
 Jeffrey S. Whitaker Phone : (303)497-6313
 NOAA/OAR/CDC  R/PSD1FAX   : (303)497-6449
 325 BroadwayBoulder, CO, USA 80305-3328


 -
 This SF.net email is sponsored by DB2 Express
 Download DB2 Express C - the FREE version of DB2 express and take
 control of your XML. No limits. Just data. Click to get it now.
 http://sourceforge.net/powerbar/db2/
 http://sourceforge.net/powerbar/db2/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 mailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

 hey guys... i got it... u can use contour(x,y,z)... as in 
 x=load('urfile1.dat'), y=load('urfile2.dat), z=load('urfile3.dat 
 ') and then type out the above for details about the 
 parameters x,y,z see... . 
 http://www.scilab.org/product/man-eng/graphics/contour.htm  so 
 matplotlib CAN plot a contour from discrete points!!! ive tried it 
 and it works...
Viraj:  That only works because x and y describe a rectangular grid.  If 
x and y described irregularly spaced points, you would need to grid the 
data first using one of the methods described on that Cookbook page.

-Jeff

-- 
Jeffrey S. Whitaker Phone : (303)497-6313
NOAA/OAR/CDC  R/PSD1FAX   : (303)497-6449
325 BroadwayBoulder, CO, USA 80305-3328


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Font problem saving [e]ps

2007-07-07 Thread Jouni K . Seppänen
Giorgio F. Gilestro [EMAIL PROTECTED] writes:

 Another bug, though, comes with backend_pdf.py
 The function embedPDF in the class PdfFile has a call to
 encodings.cp1252.decoding_map[charcode]

I believe this was fixed by Michael Droettboom in svn revision 3450. 
You can apply the patch to your copy if you don't want to use
in-development versions:

Index: backend_pdf.py
===
--- backend_pdf.py  (revision 3449)
+++ backend_pdf.py  (revision 3476)
@@ -500,11 +500,20 @@
 # composite font, based on multi-byte characters.
 
 from encodings import cp1252
-firstchar, lastchar = 0, 255
+# The decoding_map was changed to a decoding_table as of Python 2.5.
+if hasattr(cp1252, 'decoding_map'):
+def decode_char(charcode):
+return cp1252.decoding_map[charcode] or 0
+else:
+def decode_char(charcode):
+return ord(cp1252.decoding_table[charcode])
+
 def get_char_width(charcode):
-unicode = cp1252.decoding_map[charcode] or 0
+unicode = decode_char(charcode)
 width = font.load_char(unicode, flags=LOAD_NO_SCALE).horiAdvance
 return cvt(width)
+
+firstchar, lastchar = 0, 255
 widths = [ get_char_width(charcode) for charcode in range(firstchar, lastchar+1) ]
 
 widthsObject = self.reserveObject('font widths')

-- 
Jouni K. Seppänen
http://www.iki.fi/jks
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users