## Re: [Matplotlib-users] Information request

 Re: [Matplotlib-users] Information request From: De Pauw Antoine - 2008-09-17 04:54:11 ```Jeff, Sorry, I have forgotten to add this piece of code since I'm continually adding/removing bits This code comes instead of the scatter method and colorbar things: xi=np.linspace(-180,180,360) yi=np.linspace(-90,90,180) zi=griddata(Lon,Lat,Val_masked,xi,yi) Is it done the good way? If it is, what's the best method to display it with interpolation? Antoine De Pauw Collaborateur de recherches, Informatique - Research collaborator, IT Laboratoire de chimie quantique et photophysique - Quantum chemistry and photophysics laboratory Université Libre de Bruxelles - ULB -----Original Message----- From: Jeff Whitaker [mailto:jswhit@...] Sent: mercredi 17 septembre 2008 13:40 To: De Pauw Antoine Cc: 'John Hunter'; 'Eric Firing'; 'Matplotlib Users' Subject: Re: [Matplotlib-users] Information request De Pauw Antoine wrote: > Hi John, > > I used your example with the missing .ax to modify these font sizes and it > works nicely > > Anyway, by investigation, I found that there is no way of interpolation > using scattered data > > I tried to figure out how to grid my values and use imshow or pcolor, but > with no success yet.. > > Could you explain me how I could do to grid, for example, that data: > > Lat[] (double array containing latitudes) > Lon[] (double array containing longitudes) > Val[] (double array containing values) > > Each of the arrays having the same size, and Val[1] has latitude Lat[1] and > longitude Lon[1], and so on, and the coordinates are completely unordered > > When I try to use griddata and use imshow or pcolor with the output array, > my figure is blank > > A simple example or guideline would do, I guess, as I've already gained a > good knowledge of the language > > Thanks in advance > > PS: Here's the code snippet: > http://snipplr.com/view/8307/map-plotting-python-code-temporary/ > > > Antoine De Pauw > Collaborateur de recherches, Informatique - Research collaborator, IT > Laboratoire de chimie quantique et photophysique - Quantum chemistry and > photophysics laboratory > Université Libre de Bruxelles - ULB > Antoine: Griddata should work fine. Your code snippet does not try to use griddata, so I can't guess what is wrong. Let me suggest again - please post complete, self-contained examples that demonstrate your problem. Did you look at the griddata_demo.py example? -Jeff > > -----Original Message----- > From: John Hunter [mailto:jdh2358@...] > Sent: mercredi 17 septembre 2008 13:00 > To: De Pauw Antoine > Cc: Eric Firing; Jeff Whitaker; Matplotlib Users > Subject: Re: [Matplotlib-users] Information request > > On Wed, Sep 17, 2008 at 3:28 AM, De Pauw Antoine wrote: > > >> The image generated is here: >> http://www.kirikoo.net/images/5shrad-20080917-102544.png >> >> Also, I couldn't find any way to reduce the colorbar font size >> > > The colorbar method returns a matplotlib.colorbar.Colorbar instance, > which has matplotlib.axes.Axes instance stored as an attribute. Thus > you can do: > > cb = colorbar(something....) > > for t in cb.get_yticklabels(): > t.set_fontsize(10) > > Eric: when you get some time, could you add docstrings to colorbar > which document the publicly accessible attributes? > > JDH > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 ```