You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
1
(2) |
2
(5) |
3
(8) |
4
(6) |
5
(9) |
6
(7) |
7
(6) |
8
(10) |
9
(27) |
10
(7) |
11
(22) |
12
(13) |
13
(7) |
14
(4) |
15
(12) |
16
(32) |
17
(26) |
18
(14) |
19
(1) |
20
(11) |
21
(6) |
22
(11) |
23
(17) |
24
(18) |
25
(28) |
26
(11) |
27
(6) |
28
(1) |
29
(10) |
30
(12) |
|
|
|
|
From: Darren D. <dsd...@gm...> - 2008-09-27 14:01:39
|
On Friday 26 September 2008 18:49:25 Gideon Simpson wrote: > Is there anything akin to this MATLAB script: > > http://www.mathworks.com/company/newsletters/digest/june00/export/ > > available for mpl? or some simple set of commands that will > accomplish the same task? matplotlib produces publication quality output, and I think you can reproduce all the features of this script by simply modifying your rc parameters. Your on-screen results should look like your eps output, most importantly you need to set your figure.dpi according to your display size. Aside from that, have a look at the default matplotlibrc file for the many options you can customize. Darren |
From: John [H2O] <was...@gm...> - 2008-09-27 11:20:49
|
Thanks. I haven't done this yet, but I think the problem may have been related to my locales setting. Presently all is working after editing /etc/sysconfig/i18n to update LC_CTYPE and other variables. Robert Kern-2 wrote: > > John [H2O] wrote: >> I wonder if I've misunderstood or made a mistake? I renamed a file: >> /usr/lib/python2.5/new.py to /usr/lib/python2.5/new.bak >> >> and everything worked... but now, after logging out and logging back in >> again, I'm getting the problem again? >> >> Perhaps that was the standard libraries module? But I cannot find any >> other >> new.py files? > > /usr/lib/python2.5/new.py is the standard library's module. Leave it > alone. If > you are still having problems and cannot find another new.py module > anywhere, > edit pkg_resources.py to print out new.__file__ just before where the > exception > occurs. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though > it had > an underlying truth." > -- Umberto Eco > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the > world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/scipy%2C-matplotlib-import-errors-tp16343711p19701831.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Marius 't H. <M.t...@ai...> - 2008-09-27 09:43:36
|
Yes: savefig On Fri, 2008-09-26 at 18:49 -0400, Gideon Simpson wrote: > Is there anything akin to this MATLAB script: > > http://www.mathworks.com/company/newsletters/digest/june00/export/ > > available for mpl? or some simple set of commands that will > accomplish the same task? > -gideon > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: David J S. <str...@ll...> - 2008-09-27 02:08:13
|
Folks, I am trying to install, in a private 'space', 0.98.3 on a linux x86-64 scientific cluster on which I am not the admin. tcl/tk is indeed installed, and I know where they are. matplotlib cannot find them. When running 'python setup.py build', tclConfig.sh and tkConfig.sh are on the path. It seems tcl/tk detection is a persistent issue, from searching the web. My head hurts right now on this, so I hope there's some kind of an answer. Some output: > python setup.py build ============================================================================ BUILDING MATPLOTLIB matplotlib: 0.98.3 python: 2.5.2 (r252:60911, Sep 25 2008, 16:58:03) [GCC 4.1.2 20071124 (Red Hat 4.1.2-38)] platform: linux2 REQUIRED DEPENDENCIES numpy: 1.1.1 freetype2: 9.10.3 OPTIONAL BACKEND DEPENDENCIES libpng: 1.2.10 Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4 * Guessing the library and include directories for * Tcl and Tk because the tclConfig.sh and * tkConfig.sh could not be found and/or parsed. Gtk+: no * Building for Gtk+ requires pygtk; you must be able * to "import gtk" in your build/install environment Qt: no Qt4: no Cairo: no |
From: Gideon S. <si...@ma...> - 2008-09-26 23:11:50
|
Is there anything akin to this MATLAB script: http://www.mathworks.com/company/newsletters/digest/june00/export/ available for mpl? or some simple set of commands that will accomplish the same task? -gideon |
From: Eric F. <ef...@ha...> - 2008-09-26 21:53:37
|
ziw...@ni... wrote: > Dear All, > > For the class "PrintoutWx" in backend_wx.py, because it doesn't update the API > change from matplotlib 0.98.3. All of "print" and "print preview" doesn't > work correctly on new version(matplotlib 0.98.3.) > > if we change the line in 2109 "self.canvas.figure.dpi.set(fig_dpi)" > into > "self.canvas.figure.set_dpi(fig_dpi)". > Then it works. > > Would you please change that. Fixed in svn 6123. Thank you. Eric > > Your sincerity, > Ziwen Fu > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Goyo <goy...@gm...> - 2008-09-26 20:37:20
|
El jue, 25-09-2008 a las 22:19 +0200, Oz Nahum escribió: > >¿What's the meaning of that data arrange? I can't make any sense of > >plotting a 2D scatter from a 3D array. > > when I wrote: > head = [[0, 0, 10], > [1, 0, 13], > [2, 0, 11], > [3, 0, 12], > [1, 2, 11]] > > my meaning was to represent point of intereset with x, y coordinates > and the 3rd number was height for example. > I felt like I couldn't access the individual points easily, because > their are located in on big list... > So I wanted to have the list broken into rows, and the each row > represents a value on the y axis... like this: > head = [ > [[0, 0, 10], [0, 0, 13]], > [[2, 0, 11], [3, 0, 12]], > ] Mm... maybe this is better for your eyes but not for processing, I think. > > But that's redundant I think now, after looking into the function > zip. > Maybe I could write head in the following way: > > # j = 0 1 > head = [ > [[ 0, 10], [ 1, 13]], # i =0 > [[ 0, 11], [ 1, 12]], # i =1 > ] The same. Parsing a data file usually yields a sequence of rows (records), data processing functions usually expects columns of homogeneous data and convert from records to columns and back is pretty straightforward using zip. If you want to use a different representation for your data you'll need to handle more complex structures and conversions. Do it if you think it pays (sometimes it does). > But actually after understanding what zip does, I think I don't need > it anyway... > Talking about this: can you give me an example of another use of zip ? > not just zip(*head) > > I did help(zip) but I could partially understand what it does. I > learned more by doing: > x,y,z = zip(*head) > and then printing x,y,z individually. There is no other use I can think of. If you think of the arguments passed to zip as rows, it returns the columns. If the arguments are columns, zip returns rows. How you name things depends on how you think of your data. There is no other use I can think of. zip expects each row (if they are rows) to be passed as an argument so you usually need that * thing to unpack them. When you call zip(*x), x being a sequence or array-like, you are actually passing each element of x as an argument to zip. Try this: numbers = [1, 2, 3, 4, 5] english = ['one', 'two', 'three', 'four', 'five'] spanish = ['uno', 'dos', 'tres', 'cuatro', 'cinco'] x = [numbers, english, spanish] zip(numbers, english, spanish) zip(x) zip(*x) You can learn about unpacking and zipping sequences reading the Python Tutorial or another similar resource (maybe Dive into Python dives into it, not sure but a useful reading anyway). Goyo |
From: Momme B. <mo...@ya...> - 2008-09-26 14:16:13
|
When plotting a global image using the robinson projection and the bluemarble image, I have the problem that the image remains rectangular and goes beyond the curved projection map boundaries (see attachment). Is there anyway around this? Cheers, Momme import mpl_toolkits.basemap as b import numpy as np def draw(center=11.,latres=10.,lonres=10.): m = b.Basemap(projection='robin',lon_0=center) m.drawcoastlines() m.drawmapboundary() m.drawmeridians(np.arange(0,360,lonres),color='0.5',labels=[0,0,0,1]) m.drawparallels(np.arange(-90,90,latres),color='0.5',labels=[1,0,0,0]) im=m.bluemarble() return m |
From: Friedrich H. <fri...@gm...> - 2008-09-26 13:21:07
|
On Fri, Sep 26, 2008 at 12:52:01PM +0100, Peter Saffrey wrote: > Is there a way to automatically resize plots (and subplots) and > move/resize plot legends so that they don't obscure the plotted data? I > have this problem especially on plots with 4 or 5 tracks. > > I can post an example, but I wasn't sure of the etiquette of posting > images to this list. Yes as *.png. I think it's convinient to understand your problem in a few seconds. By, Friedrich |
From: Jeff W. <js...@fa...> - 2008-09-26 11:57:05
|
Antoine De Pauw wrote: > Jeff, > > I totally agree this is due to missing values > > Again I've got difficulties to find good words so forgive me, what I tried > to say is that the ability to have that border transparent would be a good > feature in next releases, for people who need to interpolate and plot such > data and have an aesthetic result > Antoine: First of all, let's not call it a 'border' - it happens to show up around the border of the image in your case, but fundamentally it's just missing pixels in the image. The missing pixels are already transparent - what you're seeing is the axes background showing through the missing values. > Imshow is the ideal candidate for satellite data as it has some nice > interpolation features and it is fast, so it can be batch-run on the server > every time we receive data, without too much computation time > > The alternative I'm using now is a double or quadruple size grid to reduce > the width of that border, with background color set to the lower colormap > color > > That way, the border is really hard to see and it makes (almost) quality > plots for publications > I think you're already doing everything that can be done - aside from making the plot region smaller so it's inside the convex hull of the data and there are no missing values. I don't see how changing the behavior of imshow would help you any further. -Jeff > -----Original Message----- > From: Jeff Whitaker [mailto:js...@fa...] > Sent: Thursday, 25 September, 2008 15:34 > To: De Pauw Antoine > Cc: 'Matplotlib Users' > Subject: Re: [Matplotlib-users] Information request > > De Pauw Antoine wrote: > >> Jeff, >> >> Thanks for the tip, it's now working perfectly >> >> However, there's still that border with the imshow plot, and I think it >> would be good to have it transparent >> >> There's a zoomed picture I made: >> http://img218.imageshack.us/img218/5833/imshowborderxz9.png >> >> You see the shadow around the data... >> >> It would be nice for next releases of Matplotlib to get rid of that, but >> > I'm > >> not able to patch it myself or so... I know there's still a lot of work >> > with > >> the lib but keep the good work, it is really fantastic >> >> Thanks for your help! >> >> 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: I thought we agreed that it's not an imshow bug - but rather > due to the griddata gridding procedure returning missing values outside > the convex hull of the input data. Do you disagree? I see no such border > around an imshow plot that contains no missing values. If you shrink the > size of the map plotting region so it's fully within the convex hull of > the data, the border disappears. > > -Jeff > >> -----Original Message----- >> From: Jeff Whitaker [mailto:js...@fa...] >> Sent: jeudi 25 septembre 2008 14:15 >> To: De Pauw Antoine >> Cc: 'Matplotlib Users' >> Subject: Re: [Matplotlib-users] Information request >> >> De Pauw Antoine wrote: >> >> >>> Hi Jeff, >>> >>> I finally found out how to fill my figure with a background color using >>> axes.set_axis_bgcolor(color), but I'm facing the following problem now: >>> >>> How could I get the lower color of a colormap? This is quite undocumented >>> and I don’t know the colormap properties I could use for that >>> >>> I know there must be an accessible value somewhere, like for the >>> ax.get_yticklabels() you gave me >>> >>> If someone had the clue, my problems would then be completely solved >>> >>> 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: To get the RGBA value associated with a particular data value, >> just call the colormap as a function as pass it that value. For example >> >> >>> import matplotlib.pyplot as plt >> >>> plt.cm.jet(1) >> (0.0, 0.0, 0.517825311942959, 1.0) >> >> BTW: the 'fill_color' kwarg of drawmapboundary basemap method allows you >> to set the background color of the map. >> >> http://matplotlib.sourceforge.net/basemap/doc/html/api/basemap_api.html >> >> It fills only the map region (which for some projections, like the >> orthographic, is not the same as the axes region). >> >> >> -Jeff >> >> >>> -----Original Message----- >>> From: Jeff Whitaker [mailto:js...@fa...] >>> Sent: mardi 23 septembre 2008 20:38 >>> To: De Pauw Antoine >>> Cc: 'John Hunter'; 'Matplotlib Users' >>> Subject: Re: [Matplotlib-users] Information request >>> >>> De Pauw Antoine wrote: >>> >>> >>> >>>> Jeff, >>>> >>>> I still don't know how to either remove this artifact or fill my arrays >>>> >>>> >>>> >>> with >>> >>> >>> >>>> values to remove empty regions, and I'll make a last attempt to resolve >>>> >>>> >> it >> >> >>>> I uploaded a data file here: http://scqp.ulb.ac.be/20080821.b56 >>>> >>>> The actual code snippet is here: >>>> http://snipplr.com/view/8307/map-plotting-python-code-temporary/ >>>> >>>> I hope you'll be able to reproduce it, I set the cmap to winter for you >>>> >>>> >> to >> >> >>>> see the gap... setting it to hot will make the grayish border visible in >>>> high resolution by zooming it... I think the border (not the empty zone) >>>> could be an artifact with the hot colormap >>>> >>>> >>>> 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: Here is a version that just plots the pixels directly, without >>> interpolating to a grid. I personally like this better, since you can >>> easily see where you actually have data. >>> >>> HTH, >>> >>> -Jeff >>> >>> from mpl_toolkits.basemap import Basemap >>> import matplotlib.pyplot as plt >>> import matplotlib.mlab as mlab >>> import numpy as np >>> import os >>> fileName = '20080821.b56' >>> titre='SO2' >>> legende='Delta Brightness Temperature (K)' >>> nbreligne=long(os.stat(fileName)[6])/(8*int(fileName[-2:])) >>> rawfile=np.fromfile(open(fileName,'rb'),'<d',-1) >>> Lat=rawfile[0:nbreligne] >>> Lon=rawfile[nbreligne:nbreligne*2] >>> Val=rawfile[nbreligne*21:nbreligne*22] >>> map=Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,\ >>> urcrnrlon=180,llcrnrlon=-180,resolution='l') >>> x, y = map(Lon, Lat) >>> >>> >>> > plt.scatter(x,y,s=25,c=Val,marker='s',edgecolor="None",cmap=plt.cm.winter,vm > >> >> >>> in=-5,vmax=-1.2, >>> alpha=0.5) >>> cb=plt.colorbar(shrink=0.6) >>> cb.ax.set_ylabel(legende,fontsize=11) >>> for t in cb.ax.get_yticklabels(): >>> t.set_fontsize(7) >>> meridians = np.arange(-180,180,60) >>> parallels = np.arange(-90,90,30) >>> map.drawparallels(parallels,labels=[1,0,0,0],fontsize=7,linewidth=0.25) >>> map.drawmeridians(meridians,labels=[0,0,0,1],fontsize=7,linewidth=0.25) >>> map.drawcoastlines(0.25,antialiased=1) >>> plt.title(titre) >>> plt.show() >>> >>> >>> >>>> -----Original Message----- >>>> From: Jeff Whitaker [mailto:js...@fa...] >>>> Sent: lundi 22 septembre 2008 13:59 >>>> To: De Pauw Antoine >>>> Cc: 'John Hunter'; 'Matplotlib Users' >>>> Subject: Re: [Matplotlib-users] Information request >>>> >>>> De Pauw Antoine wrote: >>>> >>>> >>>> >>>> >>>>> Jeff, >>>>> >>>>> I included here a figure where you'll see the border problem for imshow >>>>> >>>>> >>>>> >>> in >>> >>> >>> >>>>> my case >>>>> >>>>> http://img217.imageshack.us/img217/5240/testfigzp3.png >>>>> >>>>> The border wraps at -180 and 180 to form the white line >>>>> >>>>> PS: it is atmospheric ice and not SO2, I just omitted to change the >>>>> >>>>> >> title >> >> >>>>> >>>>> >>>>> >>>>> >>>> ^^ >>>> >>>> >>>> >>>> >>>>> 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: I hate to keep repeating myself - but we can't do much if you >>>> don't provide a self-contained script, that I can run, which reproduces >>>> the problem. My guess is that the line along the dateline, and the >>>> point at the South Pole are missing values (which griddata set to >>>> missing because they are outside the extent of the data) - but that's >>>> just a guess until I can reproduce it. >>>> >>>> -Jeff >>>> >>>> >>>> >>>> >>>>> -----Original Message----- >>>>> From: Antoine De Pauw [mailto:and...@ul...] >>>>> Sent: jeudi 18 septembre 2008 17:23 >>>>> To: Jeff Whitaker; and...@ul... >>>>> Cc: 'John Hunter'; 'Matplotlib Users' >>>>> Subject: re:Re: [Matplotlib-users] Information request >>>>> >>>>> Jeff, >>>>> >>>>> No the example doesn't show that line >>>>> >>>>> If I reduce the amount of data, the border will be on every side of the >>>>> >>>>> >>>>> >>>>> >>>> plot >>>> >>>> >>>> >>>> >>>>> I'll show you an orthographic plot with no maskinf tomorrow and you >>>>> > will > >>>>> >>>>> >>>>> >>>>> >>>> see >>>> >>>> >>>> >>>> >>>>> the problem easily, it wraps in a white line along the 0° meridian and >>>>> > a > >>>>> white circle in the pole >>>>> >>>>> I think it's the imshow layer that is not totally transparent on the >>>>> > map > >>>>> background.. I tried every trick I could for example to put some >>>>> >>>>> >>>>> >>>>> >>>> zero-valued >>>> >>>> >>>> >>>> >>>>> points on each corner to make imshow interpolate correctly the sides, >>>>> >>>>> >> but >> >> >>>>> that doesn't make any difference >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>> De Pauw Antoine wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> Jeff, >>>>>>> >>>>>>> Yes they disappear, and they fluctuate with the interpolation method >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>> used >>>> >>>> >>>> >>>> >>>>>>> For example, nearest interpolation don't show the line >>>>>>> >>>>>>> Also, if I reduce the grid resolution, the line is thicker, and if I >>>>>>> >>>>>>> >>>>>>> >>> use >>> >>> >>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>> a >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>> masked array to get rid of undesired values, the border shows really >>>>>>> strongly >>>>>>> >>>>>>> Here's an example everyone will see: >>>>>>> >>>>>>> http://img225.imageshack.us/img225/2671/testfigep2.png >>>>>>> >>>>>>> (everything except the clouds is noise) >>>>>>> >>>>>>> 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: Sorry to seem dense, but I don't see anything wrong with >>>>>> > that > >>>>>> >>>>>> >> >> >>>>>> plot. I see a white border along the north and south pole, but I >>>>>> intrepret that to be missing values. However, my eyes are notoriously >>>>>> > > >>>>>> bad. I'd like to be to run a script that generates the artifacts >>>>>> myself, so I can zoom in and see the problem myself. Does the >>>>>> griddata_demo.py script show the same problem for you? >>>>>> >>>>>> -Jeff >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> -----Original Message----- >>>>>>> From: Jeff Whitaker [mailto:js...@fa...] >>>>>>> Sent: mercredi 17 septembre 2008 19:05 >>>>>>> To: John Hunter >>>>>>> Cc: De Pauw Antoine; Matplotlib Users >>>>>>> Subject: Re: [Matplotlib-users] Information request >>>>>>> >>>>>>> John Hunter wrote: >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> On Wed, Sep 17, 2008 at 11:54 AM, John Hunter <jd...@gm...> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>> wrote: >>>> >>>> >>>> >>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> Attached is a screenshot (zoom.png) from the gimp, zoomed in near >>>>>>>>> >>>>>>>>> >> the >> >> >>>>>>>>> axes border. The black horizontal line is the top axes border, the >>>>>>>>> horizontal grey line is the artifact, the vertical dashed line is a >>>>>>>>> grid line. I don't know if this offers a clue, but if you look at >>>>>>>>> > a > >>>>>>>>> zoom in the upper right corner, the grey line seems to break up >>>>>>>>> > and > >>>>>>>>> curve down and to the right (corner.png) >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> Sorry, screwed up corner.png (I attached the original and not the >>>>>>>> screenshot). The correct screenshot is attached >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> John: OK, now I finally see it. Antoine: Do these artifacts >>>>>>> disappear if you comment out the imshow call? >>>>>>> >>>>>>> -Jeff >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> -- >>>>>> Jeffrey S. Whitaker Phone : (303)497-6313 >>>>>> Meteorologist FAX : (303)497-6449 >>>>>> NOAA/OAR/PSD R/PSD1 Email : Jef...@no... >>>>>> 325 Broadway Office : Skaggs Research Cntr 1D-113 >>>>>> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> >> > > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
From: Peter S. <pz...@dc...> - 2008-09-26 11:52:17
|
Is there a way to automatically resize plots (and subplots) and move/resize plot legends so that they don't obscure the plotted data? I have this problem especially on plots with 4 or 5 tracks. I can post an example, but I wasn't sure of the etiquette of posting images to this list. Cheers, Peter |
From: Antoine De P. <and...@ul...> - 2008-09-26 05:59:54
|
Jeff, I totally agree this is due to missing values Again I've got difficulties to find good words so forgive me, what I tried to say is that the ability to have that border transparent would be a good feature in next releases, for people who need to interpolate and plot such data and have an aesthetic result Imshow is the ideal candidate for satellite data as it has some nice interpolation features and it is fast, so it can be batch-run on the server every time we receive data, without too much computation time The alternative I'm using now is a double or quadruple size grid to reduce the width of that border, with background color set to the lower colormap color That way, the border is really hard to see and it makes (almost) quality plots for publications -----Original Message----- From: Jeff Whitaker [mailto:js...@fa...] Sent: Thursday, 25 September, 2008 15:34 To: De Pauw Antoine Cc: 'Matplotlib Users' Subject: Re: [Matplotlib-users] Information request De Pauw Antoine wrote: > Jeff, > > Thanks for the tip, it's now working perfectly > > However, there's still that border with the imshow plot, and I think it > would be good to have it transparent > > There's a zoomed picture I made: > http://img218.imageshack.us/img218/5833/imshowborderxz9.png > > You see the shadow around the data... > > It would be nice for next releases of Matplotlib to get rid of that, but I'm > not able to patch it myself or so... I know there's still a lot of work with > the lib but keep the good work, it is really fantastic > > Thanks for your help! > > 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: I thought we agreed that it's not an imshow bug - but rather due to the griddata gridding procedure returning missing values outside the convex hull of the input data. Do you disagree? I see no such border around an imshow plot that contains no missing values. If you shrink the size of the map plotting region so it's fully within the convex hull of the data, the border disappears. -Jeff > -----Original Message----- > From: Jeff Whitaker [mailto:js...@fa...] > Sent: jeudi 25 septembre 2008 14:15 > To: De Pauw Antoine > Cc: 'Matplotlib Users' > Subject: Re: [Matplotlib-users] Information request > > De Pauw Antoine wrote: > >> Hi Jeff, >> >> I finally found out how to fill my figure with a background color using >> axes.set_axis_bgcolor(color), but I'm facing the following problem now: >> >> How could I get the lower color of a colormap? This is quite undocumented >> and I dont know the colormap properties I could use for that >> >> I know there must be an accessible value somewhere, like for the >> ax.get_yticklabels() you gave me >> >> If someone had the clue, my problems would then be completely solved >> >> 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: To get the RGBA value associated with a particular data value, > just call the colormap as a function as pass it that value. For example > > >>> import matplotlib.pyplot as plt > >>> plt.cm.jet(1) > (0.0, 0.0, 0.517825311942959, 1.0) > > BTW: the 'fill_color' kwarg of drawmapboundary basemap method allows you > to set the background color of the map. > > http://matplotlib.sourceforge.net/basemap/doc/html/api/basemap_api.html > > It fills only the map region (which for some projections, like the > orthographic, is not the same as the axes region). > > > -Jeff > >> -----Original Message----- >> From: Jeff Whitaker [mailto:js...@fa...] >> Sent: mardi 23 septembre 2008 20:38 >> To: De Pauw Antoine >> Cc: 'John Hunter'; 'Matplotlib Users' >> Subject: Re: [Matplotlib-users] Information request >> >> De Pauw Antoine wrote: >> >> >>> Jeff, >>> >>> I still don't know how to either remove this artifact or fill my arrays >>> >>> >> with >> >> >>> values to remove empty regions, and I'll make a last attempt to resolve >>> > it > >>> I uploaded a data file here: http://scqp.ulb.ac.be/20080821.b56 >>> >>> The actual code snippet is here: >>> http://snipplr.com/view/8307/map-plotting-python-code-temporary/ >>> >>> I hope you'll be able to reproduce it, I set the cmap to winter for you >>> > to > >>> see the gap... setting it to hot will make the grayish border visible in >>> high resolution by zooming it... I think the border (not the empty zone) >>> could be an artifact with the hot colormap >>> >>> >>> 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: Here is a version that just plots the pixels directly, without >> interpolating to a grid. I personally like this better, since you can >> easily see where you actually have data. >> >> HTH, >> >> -Jeff >> >> from mpl_toolkits.basemap import Basemap >> import matplotlib.pyplot as plt >> import matplotlib.mlab as mlab >> import numpy as np >> import os >> fileName = '20080821.b56' >> titre='SO2' >> legende='Delta Brightness Temperature (K)' >> nbreligne=long(os.stat(fileName)[6])/(8*int(fileName[-2:])) >> rawfile=np.fromfile(open(fileName,'rb'),'<d',-1) >> Lat=rawfile[0:nbreligne] >> Lon=rawfile[nbreligne:nbreligne*2] >> Val=rawfile[nbreligne*21:nbreligne*22] >> map=Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,\ >> urcrnrlon=180,llcrnrlon=-180,resolution='l') >> x, y = map(Lon, Lat) >> >> > plt.scatter(x,y,s=25,c=Val,marker='s',edgecolor="None",cmap=plt.cm.winter,vm > >> in=-5,vmax=-1.2, >> alpha=0.5) >> cb=plt.colorbar(shrink=0.6) >> cb.ax.set_ylabel(legende,fontsize=11) >> for t in cb.ax.get_yticklabels(): >> t.set_fontsize(7) >> meridians = np.arange(-180,180,60) >> parallels = np.arange(-90,90,30) >> map.drawparallels(parallels,labels=[1,0,0,0],fontsize=7,linewidth=0.25) >> map.drawmeridians(meridians,labels=[0,0,0,1],fontsize=7,linewidth=0.25) >> map.drawcoastlines(0.25,antialiased=1) >> plt.title(titre) >> plt.show() >> >> >>> -----Original Message----- >>> From: Jeff Whitaker [mailto:js...@fa...] >>> Sent: lundi 22 septembre 2008 13:59 >>> To: De Pauw Antoine >>> Cc: 'John Hunter'; 'Matplotlib Users' >>> Subject: Re: [Matplotlib-users] Information request >>> >>> De Pauw Antoine wrote: >>> >>> >>> >>>> Jeff, >>>> >>>> I included here a figure where you'll see the border problem for imshow >>>> >>>> >> in >> >> >>>> my case >>>> >>>> http://img217.imageshack.us/img217/5240/testfigzp3.png >>>> >>>> The border wraps at -180 and 180 to form the white line >>>> >>>> PS: it is atmospheric ice and not SO2, I just omitted to change the >>>> > title > >>>> >>>> >>>> >>> ^^ >>> >>> >>> >>>> 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: I hate to keep repeating myself - but we can't do much if you >>> don't provide a self-contained script, that I can run, which reproduces >>> the problem. My guess is that the line along the dateline, and the >>> point at the South Pole are missing values (which griddata set to >>> missing because they are outside the extent of the data) - but that's >>> just a guess until I can reproduce it. >>> >>> -Jeff >>> >>> >>> >>>> -----Original Message----- >>>> From: Antoine De Pauw [mailto:and...@ul...] >>>> Sent: jeudi 18 septembre 2008 17:23 >>>> To: Jeff Whitaker; and...@ul... >>>> Cc: 'John Hunter'; 'Matplotlib Users' >>>> Subject: re:Re: [Matplotlib-users] Information request >>>> >>>> Jeff, >>>> >>>> No the example doesn't show that line >>>> >>>> If I reduce the amount of data, the border will be on every side of the >>>> >>>> >>>> >>> plot >>> >>> >>> >>>> I'll show you an orthographic plot with no maskinf tomorrow and you will >>>> >>>> >>>> >>> see >>> >>> >>> >>>> the problem easily, it wraps in a white line along the 0° meridian and a >>>> white circle in the pole >>>> >>>> I think it's the imshow layer that is not totally transparent on the map >>>> background.. I tried every trick I could for example to put some >>>> >>>> >>>> >>> zero-valued >>> >>> >>> >>>> points on each corner to make imshow interpolate correctly the sides, >>>> > but > >>>> that doesn't make any difference >>>> >>>> >>>> >>>> >>>> >>>>> De Pauw Antoine wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Jeff, >>>>>> >>>>>> Yes they disappear, and they fluctuate with the interpolation method >>>>>> >>>>>> >>>>>> >>> used >>> >>> >>> >>>>>> For example, nearest interpolation don't show the line >>>>>> >>>>>> Also, if I reduce the grid resolution, the line is thicker, and if I >>>>>> >>>>>> >> use >> >> >>>>>> >>>>>> >>>>>> >>>>>> >>>> a >>>> >>>> >>>> >>>> >>>>>> masked array to get rid of undesired values, the border shows really >>>>>> strongly >>>>>> >>>>>> Here's an example everyone will see: >>>>>> >>>>>> http://img225.imageshack.us/img225/2671/testfigep2.png >>>>>> >>>>>> (everything except the clouds is noise) >>>>>> >>>>>> 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: Sorry to seem dense, but I don't see anything wrong with that >>>>> > > >>>>> plot. I see a white border along the north and south pole, but I >>>>> intrepret that to be missing values. However, my eyes are notoriously >>>>> bad. I'd like to be to run a script that generates the artifacts >>>>> myself, so I can zoom in and see the problem myself. Does the >>>>> griddata_demo.py script show the same problem for you? >>>>> >>>>> -Jeff >>>>> >>>>> >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: Jeff Whitaker [mailto:js...@fa...] >>>>>> Sent: mercredi 17 septembre 2008 19:05 >>>>>> To: John Hunter >>>>>> Cc: De Pauw Antoine; Matplotlib Users >>>>>> Subject: Re: [Matplotlib-users] Information request >>>>>> >>>>>> John Hunter wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> On Wed, Sep 17, 2008 at 11:54 AM, John Hunter <jd...@gm...> >>>>>>> >>>>>>> >>>>>>> >>> wrote: >>> >>> >>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Attached is a screenshot (zoom.png) from the gimp, zoomed in near >>>>>>>> > the > >>>>>>>> axes border. The black horizontal line is the top axes border, the >>>>>>>> horizontal grey line is the artifact, the vertical dashed line is a >>>>>>>> grid line. I don't know if this offers a clue, but if you look at a >>>>>>>> zoom in the upper right corner, the grey line seems to break up and >>>>>>>> curve down and to the right (corner.png) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> Sorry, screwed up corner.png (I attached the original and not the >>>>>>> screenshot). The correct screenshot is attached >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> John: OK, now I finally see it. Antoine: Do these artifacts >>>>>> disappear if you comment out the imshow call? >>>>>> >>>>>> -Jeff >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> -- >>>>> Jeffrey S. Whitaker Phone : (303)497-6313 >>>>> Meteorologist FAX : (303)497-6449 >>>>> NOAA/OAR/PSD R/PSD1 Email : Jef...@no... >>>>> 325 Broadway Office : Skaggs Research Cntr 1D-113 >>>>> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> >> > > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
From: <lea...@my...> - 2008-09-26 02:31:32
|
Hello,<br /><br />I've started to use matplotlib for my website since about a month ago and so far I am very impressed with it. I have one question about bar plots using the axes.bar() function. It seems that sometimes when I specify a constant width (by supplying a scalar width argument), I get slightly uneven bar widths. Moreover, dending on the width I specify and the limits of the x-axis, some bars get dropped altogether. I am using the savefig() function to save the plots as a PNG file. An example of uneven bar widths can be seen here: http://www.myquant.net <br /><br />I would appreciate it if anyone has encountered this problem before and if there is a fix for it. Thank you.<br /><br />Roy<br /><br /> |
From: Robert K. <rob...@gm...> - 2008-09-26 01:01:07
|
John [H2O] wrote: > I wonder if I've misunderstood or made a mistake? I renamed a file: > /usr/lib/python2.5/new.py to /usr/lib/python2.5/new.bak > > and everything worked... but now, after logging out and logging back in > again, I'm getting the problem again? > > Perhaps that was the standard libraries module? But I cannot find any other > new.py files? /usr/lib/python2.5/new.py is the standard library's module. Leave it alone. If you are still having problems and cannot find another new.py module anywhere, edit pkg_resources.py to print out new.__file__ just before where the exception occurs. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco |
From: John [H2O] <was...@gm...> - 2008-09-25 22:52:01
|
I'm revisiting this with a new round of errors. I keep getting this error, maybe related as before to the 'new' module, but I cannot tell?? Does anyone know what is going on? Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:51) [GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import pylab Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.5/site-packages/pylab.py", line 1, in <module> from matplotlib.pylab import * File "/usr/lib/python2.5/site-packages/matplotlib/__init__.py", line 128, in <module> from rcsetup import defaultParams, validate_backend, validate_toolbar File "/usr/lib/python2.5/site-packages/matplotlib/rcsetup.py", line 19, in <module> from matplotlib.colors import is_color_like File "/usr/lib/python2.5/site-packages/matplotlib/colors.py", line 39, in <module> import matplotlib.cbook as cbook File "/usr/lib/python2.5/site-packages/matplotlib/cbook.py", line 16, in <module> preferredencoding = locale.getpreferredencoding() File "/usr/lib/python2.5/locale.py", line 512, in getpreferredencoding setlocale(LC_CTYPE, "") File "/usr/lib/python2.5/locale.py", line 476, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting -- View this message in context: http://www.nabble.com/scipy%2C-matplotlib-import-errors-tp16343711p19679786.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: John [H2O] <was...@gm...> - 2008-09-25 22:34:05
|
I wonder if I've misunderstood or made a mistake? I renamed a file: /usr/lib/python2.5/new.py to /usr/lib/python2.5/new.bak and everything worked... but now, after logging out and logging back in again, I'm getting the problem again? Perhaps that was the standard libraries module? But I cannot find any other new.py files? Thanks, john Robert Kern-2 wrote: > > John wrote: >> Hello, could someone please help me understand a strange problem, >> possibly associated with PYTHONPATH. When I import matplotlib, pylab, or >> scipy from any directory other than the root installation directory, it >> fails. However, if I'm in the python installation directory there are no >> errors. Thanks in advance! Please see below: >> >> *[jfb@andLinux ~]$ python* >> Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) >> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import scipy >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "/usr/lib/python2.5/site-packages/scipy/__init__.py", line 18, in >> <module> >> import pkg_resources as _pr # activate namespace packages >> (manipulates __path__) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, >> in <module> >> add_activation_listener(lambda dist: dist.activate()) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 640, in >> subscribe >> callback(dist) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, >> in <lambda> >> add_activation_listener(lambda dist: dist.activate()) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2130, >> in activate >> map(declare_namespace, self._get_metadata('namespace_packages.txt')) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749, >> in declare_namespace >> _handle_ns(packageName, path_item) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1712, >> in _handle_ns >> module = sys.modules[packageName] = new.module(packageName) >> AttributeError: 'module' object has no attribute 'module' > > You have a new.py module somewhere which is interfering with the standard > library's "new" module. Find it and rename it. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though > it had > an underlying truth." > -- Umberto Eco > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/scipy%2C-matplotlib-import-errors-tp16343711p19679575.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: John [H2O] <was...@gm...> - 2008-09-25 21:27:21
|
Thank you! I see this is a deprecated module, might I break something else? Thanks again, john Robert Kern-2 wrote: > > John wrote: >> Hello, could someone please help me understand a strange problem, >> possibly associated with PYTHONPATH. When I import matplotlib, pylab, or >> scipy from any directory other than the root installation directory, it >> fails. However, if I'm in the python installation directory there are no >> errors. Thanks in advance! Please see below: >> >> *[jfb@andLinux ~]$ python* >> Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) >> [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 >> Type "help", "copyright", "credits" or "license" for more information. >> >>> import scipy >> Traceback (most recent call last): >> File "<stdin>", line 1, in <module> >> File "/usr/lib/python2.5/site-packages/scipy/__init__.py", line 18, in >> <module> >> import pkg_resources as _pr # activate namespace packages >> (manipulates __path__) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, >> in <module> >> add_activation_listener(lambda dist: dist.activate()) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 640, in >> subscribe >> callback(dist) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2581, >> in <lambda> >> add_activation_listener(lambda dist: dist.activate()) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 2130, >> in activate >> map(declare_namespace, self._get_metadata('namespace_packages.txt')) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1749, >> in declare_namespace >> _handle_ns(packageName, path_item) >> File "/usr/lib/python2.5/site-packages/pkg_resources.py", line 1712, >> in _handle_ns >> module = sys.modules[packageName] = new.module(packageName) >> AttributeError: 'module' object has no attribute 'module' > > You have a new.py module somewhere which is interfering with the standard > library's "new" module. Find it and rename it. > > -- > Robert Kern > > "I have come to believe that the whole world is an enigma, a harmless > enigma > that is made terrible by our own mad attempt to interpret it as though > it had > an underlying truth." > -- Umberto Eco > > > ------------------------------------------------------------------------- > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services for > just about anything Open Source. > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://www.nabble.com/scipy%2C-matplotlib-import-errors-tp16343711p19678674.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Oz N. <na...@gm...> - 2008-09-25 20:20:03
|
>¿What's the meaning of that data arrange? I can't make any sense of >plotting a 2D scatter from a 3D array. when I wrote: head = [[0, 0, 10], [1, 0, 13], [2, 0, 11], [3, 0, 12], [1, 2, 11]] my meaning was to represent point of intereset with x, y coordinates and the 3rd number was height for example. I felt like I couldn't access the individual points easily, because their are located in on big list... So I wanted to have the list broken into rows, and the each row represents a value on the y axis... like this: head = [ [[0, 0, 10], [0, 0, 13]], [[2, 0, 11], [3, 0, 12]], ] But that's redundant I think now, after looking into the function zip. Maybe I could write head in the following way: # j = 0 1 head = [ [[ 0, 10], [ 1, 13]], # i =0 [[ 0, 11], [ 1, 12]], # i =1 ] But actually after understanding what zip does, I think I don't need it anyway... Talking about this: can you give me an example of another use of zip ? not just zip(*head) I did help(zip) but I could partially understand what it does. I learned more by doing: x,y,z = zip(*head) and then printing x,y,z individually. Thanks for your help so far. Oz |
From: Goyo <goy...@gm...> - 2008-09-25 19:50:56
|
Just give a look at zip(*head) and see that now it return two values so you can't assign it to three variables. ¿What's the meaning of that data arrange? I can't make any sense of plotting a 2D scatter from a 3D array. Goyo El jue, 25-09-2008 a las 15:15 +0200, Oz Nahum escribió: > Hi, > Thanks for your reply and appologies for my late response. > This indeed does the job. But after playing a little bit with the > code, I have discovered a few things: > first, I'd rather work with lists not tuples so I could actually > change my huge array of points. > second the array I described is kind of a pseudo 2D: > It has one big row. > head = [[0, 0, 10], > [1, 0, 13], > [2, 0, 11], > [3, 0, 12], > [1, 2, 11]] > > When I try to use a 3D array, with rows and columns > > import pylab as pl > > head = [[[0, 0, 10], [0, 1, 13]], > [[1, 0, 11], [1, 1, 12]], > [[2, 1, 11], [2, 2, 14]]] > > x, y, z = zip(*head) > xi, yi = pl.arange(0, 4, 0.1), pl.arange(0, 3, 0.1) > g = pl.griddata(x, y, z, xi, yi) > pl.scatter(x, y) > pl.contour(xi, yi, g) > pl.show() > > I get this error: > Traceback (most recent call last): > File "asfplot.py", line 9, in <module> > x, y, z = zip(*head) > ValueError: need more than 2 values to unpack > > > On Sat, Sep 20, 2008 at 2:19 PM, Goyo <goy...@gm...> wrote: > Try something like this: > > import pylab as pl > > head = ((0, 0, 10), > (1, 0, 13), > (2, 0, 11), > (3, 0, 12), > (1, 2, 11)) > > > x, y, z = zip(*head) > xi, yi = pl.arange(0, 4, 0.1), pl.arange(0, 3, 0.1) > g = pl.griddata(x, y, z, xi, yi) > pl.scatter(x, y) > pl.contour(xi, yi, g) > > Level values are automatically chosen in this example but you > can > provide the number of values or a sequence of them. > > Note that no extrapolation is done outside convex hull defined > by input > data. > > Goyo > > El sáb, 20-09-2008 a las 11:13 +0200, Oz Nahum escribió: > > > I'm trying again to understand how to plot scattered data > from array into > > contour graph. > > I looked at > > > http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data > > and I understand I have to grid my data. However, in most > samples the plot > > is of a function. > > Let's say I want to plot some geological data, suppose > water table head, and > > I have the following 3D aray > > x y head > > head = ((0, 0, 10), > > (1, 0, 13), > > (2, 0, 11), > > (3, 0, 12), > > (1, 2, 11)) > > matplotlib has lot's of restrictions about how I can plot > and interpolate > > the data, which causes a lot of confusion in my side... > > I'll be happy if someone could supply me a clue of how to > plot contours of > > data which comes in arrays or raster format and not an > equation. > > Thanks, > > Oz > > > > > > ------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move > Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & > win great prizes > > Grand prize is a trip for two to an Open Source event > anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > -- > .''`. > : :' : We are debian.org. Lower your prices, > `. `' surrender your code. > `- We will add your hardware and software > distinctiveness to our own. > Resistance is futile. > > ---- > Imagine there's no countries > It isn't hard to do > Nothing to kill or die for > And no religion too > Imagine all the people > Living life in peace > ---- > You all must read 'The God Delusion' > http://en.wikipedia.org/wiki/The_God_Delusion > --- > when one person suffers from a delusion it is called insanity. When > many people suffer from a delusion it is called religion." > Robert Pirsig, Zen and the Art of Motorcycle Maintenance > > |
From: Eric F. <ef...@ha...> - 2008-09-25 18:05:44
|
Christopher Brown wrote: > Hi List, > > Attached is a closeup of two legends on a 2-panel figure. The first > legend has 10 plots listed, the second has 1. I have set each legend > identically: loc='upper right', pad=.3, handlelen=.1, handletextsep=.05. > But it seems that while the horizontal padding is the same, the vertical > padding is too large in the first legend, and too small in the second. > The only difference between the two I am aware of is the number of plots > listed (not contained in the axes, but listed in the legends). I'm using > version 0.98.3 on windows. Any ideas? This looks to me like a design flaw: the pad is "fractional" (fraction of legend box size), when logically it should be in something like units of legend text height, or possibly in points. This might be easy enough to change, although for backwards compatibility we would need to use a new kwarg. Eric |
From: Jouni K. S. <jk...@ik...> - 2008-09-25 18:05:12
|
"John Hunter" <jd...@gm...> writes: > When I run your script with 91.5 (svn branch) vs 98.3 (svn head), I > see that the text labels do not align with the images (PDF only, not > Agg) in 98.3 and not 91.5. Is this the problem you are describing? It's not exactly alignment, it's that the image (consisting of all the little color bars) is upside down. The part of the pdf backend that writes out the images hasn't changed very much between 0.91 and 0.98: both essentially do img.flipud_out() # get rgba data of image and write it in the output file img.flipud_out() If I comment out the flipud_out method calls in 0.98, it works correctly with this example but gets image_origin.pdf wrong. I'm at a loss to figure out the difference between image_origin.py and Haibao Tang's script. Does anyone have a clue? -- Jouni K. Seppänen http://www.iki.fi/jks |
From: <ziw...@ni...> - 2008-09-25 15:50:30
|
Dear All, For the class "PrintoutWx" in backend_wx.py, because it doesn't update the API change from matplotlib 0.98.3. All of "print" and "print preview" doesn't work correctly on new version(matplotlib 0.98.3.) if we change the line in 2109 "self.canvas.figure.dpi.set(fig_dpi)" into "self.canvas.figure.set_dpi(fig_dpi)". Then it works. Would you please change that. Your sincerity, Ziwen Fu |
From: Haibao T. <tan...@gm...> - 2008-09-25 14:05:21
|
John, thanks for the swift reply. 1) Yes. I later found that whenever I call imshow with extent option more than once, the coordinates will be off. 2) Here is a sample script ----------------------------------------- from pylab import * img = imread("image.png") imshow(img) axis("off") savefig("image.pdf") ----------------------------------------- Just try any png off the web and generate pdf using 0.91 and 0.98. Look closely at the results. There are two major differences. One is that the pixel is larger in 0.98 than in 0.91; also the color looks lossy in 0.98. I suspect that there is more compression for pdf in 0.98, but I am not clear how to reset it. On Thu, Sep 25, 2008 at 9:37 AM, John Hunter <jd...@gm...> wrote: > On Wed, Sep 24, 2008 at 2:16 PM, Haibao Tang <tan...@gm...> wrote: > > > for k in cm_keys: > > imshow(Y, extent=(xstart, xstart+.7*col_interval, > > ystart, ystart+.5*row_interval), > > cmap=get_cmap(name=k)) > > root.text(xstart+.75*col_interval, ystart, k, size=9) > > xstart += col_interval > > if j%2==0: > > xstart = .03 > > ystart -= row_interval > > j += 1 > > > > root.set_xlim(0, 1) > > root.set_ylim(0, 1) > > root.set_axis_off() > > savefig("cm_instances.pdf") > > > Different versions gave me different results, with only the old version > > appears to be correct. > > When I run your script with 91.5 (svn branch) vs 98.3 (svn head), I > see that the text labels do not align with the images (PDF only, not > Agg) in 98.3 and not 91.5. Is this the problem you are describing? > > It appears that the image positioning argument is off in the PDF > backend because comparing the trunk vs the head, the labels are in the > same relative position and the images are off. Could one of the PDF > backend gurus look into this? > > > In addition, when I wish to imshow a JPG image through PIL, the newer > > version gave me very low resolution. Can someone duplicate my > observation? I > > appreciate any solution, thanks. > > I am not sure what you are trying here -- can you post a script that > illustrates the problem? > |
From: Jeff W. <js...@fa...> - 2008-09-25 13:50:16
|
De Pauw Antoine wrote: > Jeff, > > Thanks for the tip, it's now working perfectly > > However, there's still that border with the imshow plot, and I think it > would be good to have it transparent > > There's a zoomed picture I made: > http://img218.imageshack.us/img218/5833/imshowborderxz9.png > > You see the shadow around the data... > > It would be nice for next releases of Matplotlib to get rid of that, but I'm > not able to patch it myself or so... I know there's still a lot of work with > the lib but keep the good work, it is really fantastic > > Thanks for your help! > > 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: I thought we agreed that it's not an imshow bug - but rather due to the griddata gridding procedure returning missing values outside the convex hull of the input data. Do you disagree? I see no such border around an imshow plot that contains no missing values. If you shrink the size of the map plotting region so it's fully within the convex hull of the data, the border disappears. -Jeff > -----Original Message----- > From: Jeff Whitaker [mailto:js...@fa...] > Sent: jeudi 25 septembre 2008 14:15 > To: De Pauw Antoine > Cc: 'Matplotlib Users' > Subject: Re: [Matplotlib-users] Information request > > De Pauw Antoine wrote: > >> Hi Jeff, >> >> I finally found out how to fill my figure with a background color using >> axes.set_axis_bgcolor(color), but I'm facing the following problem now: >> >> How could I get the lower color of a colormap? This is quite undocumented >> and I don’t know the colormap properties I could use for that >> >> I know there must be an accessible value somewhere, like for the >> ax.get_yticklabels() you gave me >> >> If someone had the clue, my problems would then be completely solved >> >> 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: To get the RGBA value associated with a particular data value, > just call the colormap as a function as pass it that value. For example > > >>> import matplotlib.pyplot as plt > >>> plt.cm.jet(1) > (0.0, 0.0, 0.517825311942959, 1.0) > > BTW: the 'fill_color' kwarg of drawmapboundary basemap method allows you > to set the background color of the map. > > http://matplotlib.sourceforge.net/basemap/doc/html/api/basemap_api.html > > It fills only the map region (which for some projections, like the > orthographic, is not the same as the axes region). > > > -Jeff > >> -----Original Message----- >> From: Jeff Whitaker [mailto:js...@fa...] >> Sent: mardi 23 septembre 2008 20:38 >> To: De Pauw Antoine >> Cc: 'John Hunter'; 'Matplotlib Users' >> Subject: Re: [Matplotlib-users] Information request >> >> De Pauw Antoine wrote: >> >> >>> Jeff, >>> >>> I still don't know how to either remove this artifact or fill my arrays >>> >>> >> with >> >> >>> values to remove empty regions, and I'll make a last attempt to resolve >>> > it > >>> I uploaded a data file here: http://scqp.ulb.ac.be/20080821.b56 >>> >>> The actual code snippet is here: >>> http://snipplr.com/view/8307/map-plotting-python-code-temporary/ >>> >>> I hope you'll be able to reproduce it, I set the cmap to winter for you >>> > to > >>> see the gap... setting it to hot will make the grayish border visible in >>> high resolution by zooming it... I think the border (not the empty zone) >>> could be an artifact with the hot colormap >>> >>> >>> 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: Here is a version that just plots the pixels directly, without >> interpolating to a grid. I personally like this better, since you can >> easily see where you actually have data. >> >> HTH, >> >> -Jeff >> >> from mpl_toolkits.basemap import Basemap >> import matplotlib.pyplot as plt >> import matplotlib.mlab as mlab >> import numpy as np >> import os >> fileName = '20080821.b56' >> titre='SO2' >> legende='Delta Brightness Temperature (K)' >> nbreligne=long(os.stat(fileName)[6])/(8*int(fileName[-2:])) >> rawfile=np.fromfile(open(fileName,'rb'),'<d',-1) >> Lat=rawfile[0:nbreligne] >> Lon=rawfile[nbreligne:nbreligne*2] >> Val=rawfile[nbreligne*21:nbreligne*22] >> map=Basemap(projection='mill',llcrnrlat=-90,urcrnrlat=90,\ >> urcrnrlon=180,llcrnrlon=-180,resolution='l') >> x, y = map(Lon, Lat) >> >> > plt.scatter(x,y,s=25,c=Val,marker='s',edgecolor="None",cmap=plt.cm.winter,vm > >> in=-5,vmax=-1.2, >> alpha=0.5) >> cb=plt.colorbar(shrink=0.6) >> cb.ax.set_ylabel(legende,fontsize=11) >> for t in cb.ax.get_yticklabels(): >> t.set_fontsize(7) >> meridians = np.arange(-180,180,60) >> parallels = np.arange(-90,90,30) >> map.drawparallels(parallels,labels=[1,0,0,0],fontsize=7,linewidth=0.25) >> map.drawmeridians(meridians,labels=[0,0,0,1],fontsize=7,linewidth=0.25) >> map.drawcoastlines(0.25,antialiased=1) >> plt.title(titre) >> plt.show() >> >> >>> -----Original Message----- >>> From: Jeff Whitaker [mailto:js...@fa...] >>> Sent: lundi 22 septembre 2008 13:59 >>> To: De Pauw Antoine >>> Cc: 'John Hunter'; 'Matplotlib Users' >>> Subject: Re: [Matplotlib-users] Information request >>> >>> De Pauw Antoine wrote: >>> >>> >>> >>>> Jeff, >>>> >>>> I included here a figure where you'll see the border problem for imshow >>>> >>>> >> in >> >> >>>> my case >>>> >>>> http://img217.imageshack.us/img217/5240/testfigzp3.png >>>> >>>> The border wraps at -180 and 180 to form the white line >>>> >>>> PS: it is atmospheric ice and not SO2, I just omitted to change the >>>> > title > >>>> >>>> >>>> >>> ^^ >>> >>> >>> >>>> 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: I hate to keep repeating myself - but we can't do much if you >>> don't provide a self-contained script, that I can run, which reproduces >>> the problem. My guess is that the line along the dateline, and the >>> point at the South Pole are missing values (which griddata set to >>> missing because they are outside the extent of the data) - but that's >>> just a guess until I can reproduce it. >>> >>> -Jeff >>> >>> >>> >>>> -----Original Message----- >>>> From: Antoine De Pauw [mailto:and...@ul...] >>>> Sent: jeudi 18 septembre 2008 17:23 >>>> To: Jeff Whitaker; and...@ul... >>>> Cc: 'John Hunter'; 'Matplotlib Users' >>>> Subject: re:Re: [Matplotlib-users] Information request >>>> >>>> Jeff, >>>> >>>> No the example doesn't show that line >>>> >>>> If I reduce the amount of data, the border will be on every side of the >>>> >>>> >>>> >>> plot >>> >>> >>> >>>> I'll show you an orthographic plot with no maskinf tomorrow and you will >>>> >>>> >>>> >>> see >>> >>> >>> >>>> the problem easily, it wraps in a white line along the 0° meridian and a >>>> white circle in the pole >>>> >>>> I think it's the imshow layer that is not totally transparent on the map >>>> background.. I tried every trick I could for example to put some >>>> >>>> >>>> >>> zero-valued >>> >>> >>> >>>> points on each corner to make imshow interpolate correctly the sides, >>>> > but > >>>> that doesn't make any difference >>>> >>>> >>>> >>>> >>>> >>>>> De Pauw Antoine wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Jeff, >>>>>> >>>>>> Yes they disappear, and they fluctuate with the interpolation method >>>>>> >>>>>> >>>>>> >>> used >>> >>> >>> >>>>>> For example, nearest interpolation don't show the line >>>>>> >>>>>> Also, if I reduce the grid resolution, the line is thicker, and if I >>>>>> >>>>>> >> use >> >> >>>>>> >>>>>> >>>>>> >>>>>> >>>> a >>>> >>>> >>>> >>>> >>>>>> masked array to get rid of undesired values, the border shows really >>>>>> strongly >>>>>> >>>>>> Here's an example everyone will see: >>>>>> >>>>>> http://img225.imageshack.us/img225/2671/testfigep2.png >>>>>> >>>>>> (everything except the clouds is noise) >>>>>> >>>>>> 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: Sorry to seem dense, but I don't see anything wrong with that >>>>> > > >>>>> plot. I see a white border along the north and south pole, but I >>>>> intrepret that to be missing values. However, my eyes are notoriously >>>>> bad. I'd like to be to run a script that generates the artifacts >>>>> myself, so I can zoom in and see the problem myself. Does the >>>>> griddata_demo.py script show the same problem for you? >>>>> >>>>> -Jeff >>>>> >>>>> >>>>> >>>>> >>>>>> -----Original Message----- >>>>>> From: Jeff Whitaker [mailto:js...@fa...] >>>>>> Sent: mercredi 17 septembre 2008 19:05 >>>>>> To: John Hunter >>>>>> Cc: De Pauw Antoine; Matplotlib Users >>>>>> Subject: Re: [Matplotlib-users] Information request >>>>>> >>>>>> John Hunter wrote: >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>> On Wed, Sep 17, 2008 at 11:54 AM, John Hunter <jd...@gm...> >>>>>>> >>>>>>> >>>>>>> >>> wrote: >>> >>> >>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> Attached is a screenshot (zoom.png) from the gimp, zoomed in near >>>>>>>> > the > >>>>>>>> axes border. The black horizontal line is the top axes border, the >>>>>>>> horizontal grey line is the artifact, the vertical dashed line is a >>>>>>>> grid line. I don't know if this offers a clue, but if you look at a >>>>>>>> zoom in the upper right corner, the grey line seems to break up and >>>>>>>> curve down and to the right (corner.png) >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> Sorry, screwed up corner.png (I attached the original and not the >>>>>>> screenshot). The correct screenshot is attached >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> John: OK, now I finally see it. Antoine: Do these artifacts >>>>>> disappear if you comment out the imshow call? >>>>>> >>>>>> -Jeff >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> -- >>>>> Jeffrey S. Whitaker Phone : (303)497-6313 >>>>> Meteorologist FAX : (303)497-6449 >>>>> NOAA/OAR/PSD R/PSD1 Email : Jef...@no... >>>>> 325 Broadway Office : Skaggs Research Cntr 1D-113 >>>>> Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>> >>>> >>>> >>>> >>> >>> >>> >> >> > > > -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
From: John H. <jd...@gm...> - 2008-09-25 13:37:35
|
On Wed, Sep 24, 2008 at 2:16 PM, Haibao Tang <tan...@gm...> wrote: > for k in cm_keys: > imshow(Y, extent=(xstart, xstart+.7*col_interval, > ystart, ystart+.5*row_interval), > cmap=get_cmap(name=k)) > root.text(xstart+.75*col_interval, ystart, k, size=9) > xstart += col_interval > if j%2==0: > xstart = .03 > ystart -= row_interval > j += 1 > > root.set_xlim(0, 1) > root.set_ylim(0, 1) > root.set_axis_off() > savefig("cm_instances.pdf") > Different versions gave me different results, with only the old version > appears to be correct. When I run your script with 91.5 (svn branch) vs 98.3 (svn head), I see that the text labels do not align with the images (PDF only, not Agg) in 98.3 and not 91.5. Is this the problem you are describing? It appears that the image positioning argument is off in the PDF backend because comparing the trunk vs the head, the labels are in the same relative position and the images are off. Could one of the PDF backend gurus look into this? > In addition, when I wish to imshow a JPG image through PIL, the newer > version gave me very low resolution. Can someone duplicate my observation? I > appreciate any solution, thanks. I am not sure what you are trying here -- can you post a script that illustrates the problem? |