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
(8) |
2
(11) |
3
(4) |
4
(6) |
5
(13) |
6
(30) |
7
(21) |
8
(9) |
9
(19) |
10
(4) |
11
(5) |
12
(14) |
13
(19) |
14
(22) |
15
(12) |
16
(15) |
17
(14) |
18
(1) |
19
(1) |
20
(11) |
21
(9) |
22
(18) |
23
(39) |
24
(12) |
25
(7) |
26
(13) |
27
(18) |
28
(3) |
29
(5) |
30
(12) |
31
(10) |
|
I am trying to code an application with two checkboxes, one associated with each axis on a simple plot. I can then turn on and off lines in the plot that are scaled either to the left side or right side of the plot. This is working fine and patterned after some of the examples from matplotlib. However, when I use the toolbar feature with the "magnifier" the scaling is not usually correct. More specifically, if I select an area with the magnifier, the next drawing of the information is not scaled right. (ususally it is a smaller subset of the data selected) I have confirmed when I run without twinx , the magnifier works fine. I also have noticed that when running the example from matplotlib the same thing happens. I have searched a bit looking for perhaps a bug or comment in forums on how to workaround this or perhaps I have done something wrong, but no luck. Perhaps I don't understand how the magnifier is supposed to work but when I disable the twinx capability of my code, things seem to work fine. (I'm still mostly a noob but I am persistent.) I believe I have 0.90 or perhaps one earlier. I wasn't completely sure how to check but 0.90 is shown in the __init__.py file. I have attached the matplotlib provided example that I feel doesn't work right. I also have a snippet of my code below. (which is structured a bit different than the example but when I run identical to the snippet, using the structure of my code I get an error due to twinx not being a method of subplot - as I recall) from two scales example provided with matplotlib >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> from pylab import * ax1 = subplot(111) t = arange(0.01, 10.0, 0.01) s1 = exp(t) plot(t, s1, 'b-') xlabel('time (s)') ylabel('exp') # turn off the 2nd axes rectangle with frameon kwarg ax2 = twinx() s2 = sin(2*pi*t) plot(t, s2, 'r.') ylabel('sin') ax2.yaxis.tick_right() show() snippet from my code >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> self.axL=subplot(132, position=[0.2,0.1,0.6,0.8]) self.axR=twinx(self.axL) self.rax1=subplot(131, position=[0.01, 0.10, 0.14, 0.8]) self.rax2=subplot(133, position=[0.85, 0.10, 0.14, 0.8]) for key in sorted(dict): if dict[key][1]<>'N': #~ providing key to allow for skipping data set visibility=dict[key][2] exec("self.l%s, = self.ax%s.plot(glbl.fusdata%s,visible=visibility,ls=dict[key][4],color=dict[key][3])"% (key,dict[key][1],key)) -- View this message in context: http://www.nabble.com/twin---dual---two-axis-seems-to-confuse-or-break-toolbar-magnifier-tp20256700p20256700.html Sent from the matplotlib - users mailing list archive at Nabble.com.
The limits don't get automatically adjusted when using add_patch(). You could do something like: plt.gca().set_xlim(min([x for x, y in vertices]), max([x for x, y in vertices])) plt.gca().set_ylim(min([y for x, y in vertices]), max([y for x, y in vertices])) Again, vlines will do all this for you. Mike Amitava Maity wrote: > Thanks, > > Being a novice, I am trying the first thing in the example > gallery > that caught my eye. Vlines does seem to be a better option. But > what's > puzzling me is why do I get just a plot of the axes with the > following > code? Where are the vertical lines that I am looking for? > > > > from matplotlib import path > from matplotlib import patches > from matplotlib import pyplot as plt > > codes = (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, > 2) > vertices = ((39525.540000000001, 144.91), (39525.540000000001, > 161.352), > (39874.5, 149.5), (39874.5, 166.142), (40205.0, 150.41), > (40205.0, > 167.05199999999999), (40518.449999999997, 149.36000000000001), > (40518.449999999997, 166.00200000000001), (40828.0, > 148.50999999999999), (40828.0, 165.15199999999999), > (41173.239999999998, 151.16), (41173.239999999998, 167.602), > (41510.0, > 150.09), (41510.0, 166.732), (41858.0, 146.25), (41858.0, > 162.892), > (42158.0, 152.63999999999999), (42158.0, 169.28199999999998), > (42486.889999999999, 155.22999999999999), (42486.889999999999, > 171.672)) > > patch = patches.PathPatch(path.Path(vertices, codes)) > plt.gca().add_patch(patch) > plt.show() > > > On 2008年10月30日 Michael Droettboom wrote : > >> If your first tuple is "codes", and second is "vertices", >> >> You can do: >> >> from matplotlib import path >> from matplotlib import patches >> from matplotlib import pyplot as plt >> >> patch = patches.PathPatch(path.Path(vertices, codes)) >> plt.gca().add_patch(patch) >> plt.show() >> >> >> However... rather than going through all that, have you >> considered >> > using vlines? That will save you the trouble of generating all > the > data in that format yourself. > >> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pypl >> > ot.vlines > >> Cheers, >> Mike >> >> Amitava Maity wrote: >> >>> Hello list, >>> >>> I have generated the following tuples: >>> >>> (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2) >>> ((39525.540000000001, 144.91), (39525.540000000001, 161.352), >>> (39874.5, 149.5), (39874.5, 166.142), (40205.0, 150.41), >>> (40205.0, >>> 167.05199999999999), (40518.449999999997, 149.36000000000001), >>> (40518.449999999997, 166.00200000000001), (40828.0, >>> 148.50999999999999), (40828.0, 165.15199999999999), >>> (41173.239999999998, 151.16), (41173.239999999998, 167.602), >>> > (41510.0, > >>> 150.09), (41510.0, 166.732), (41858.0, 146.25), (41858.0, >>> 162.892), >>> (42158.0, 152.63999999999999), (42158.0, 169.28199999999998), >>> (42486.889999999999, 155.22999999999999), (42486.889999999999, >>> 171.672)) >>> >>> How do I use the Matplotlib.path class to draw a set of >>> disconnected >>> vertical lines? >>> >>> Thanks in advance, >>> AMaity. >>> >>> -------------------------------------------------------------------- >>> > ----- > >>> 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 >>> >>> >> -- Michael Droettboom >> Science Software Branch >> Operations and Engineering Division >> Space Telescope Science Institute >> Operated by AURA for NASA >> >> > > > > ------------------------------------------------------------------------- > 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 > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Thanks, Being a novice, I am trying the first thing in the example gallery that caught my eye. Vlines does seem to be a better option. But what's puzzling me is why do I get just a plot of the axes with the following code? Where are the vertical lines that I am looking for? from matplotlib import path from matplotlib import patches from matplotlib import pyplot as plt codes = (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2) vertices = ((39525.540000000001, 144.91), (39525.540000000001, 161.352), (39874.5, 149.5), (39874.5, 166.142), (40205.0, 150.41), (40205.0, 167.05199999999999), (40518.449999999997, 149.36000000000001), (40518.449999999997, 166.00200000000001), (40828.0, 148.50999999999999), (40828.0, 165.15199999999999), (41173.239999999998, 151.16), (41173.239999999998, 167.602), (41510.0, 150.09), (41510.0, 166.732), (41858.0, 146.25), (41858.0, 162.892), (42158.0, 152.63999999999999), (42158.0, 169.28199999999998), (42486.889999999999, 155.22999999999999), (42486.889999999999, 171.672)) patch = patches.PathPatch(path.Path(vertices, codes)) plt.gca().add_patch(patch) plt.show() On 2008年10月30日 Michael Droettboom wrote : >If your first tuple is "codes", and second is "vertices", > >You can do: > > from matplotlib import path > from matplotlib import patches > from matplotlib import pyplot as plt > >patch = patches.PathPatch(path.Path(vertices, codes)) >plt.gca().add_patch(patch) >plt.show() > > >However... rather than going through all that, have you >considered using vlines? That will save you the trouble of generating all the data in that format yourself. > >http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pypl ot.vlines > >Cheers, >Mike > >Amitava Maity wrote: >> Hello list, >> >>I have generated the following tuples: >> >>(1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2) >>((39525.540000000001, 144.91), (39525.540000000001, 161.352), >>(39874.5, 149.5), (39874.5, 166.142), (40205.0, 150.41), >>(40205.0, >>167.05199999999999), (40518.449999999997, 149.36000000000001), >>(40518.449999999997, 166.00200000000001), (40828.0, >>148.50999999999999), (40828.0, 165.15199999999999), >>(41173.239999999998, 151.16), (41173.239999999998, 167.602), (41510.0, >>150.09), (41510.0, 166.732), (41858.0, 146.25), (41858.0, >>162.892), >>(42158.0, 152.63999999999999), (42158.0, 169.28199999999998), >>(42486.889999999999, 155.22999999999999), (42486.889999999999, >>171.672)) >> >>How do I use the Matplotlib.path class to draw a set of >>disconnected >>vertical lines? >> >>Thanks in advance, >>AMaity. >> >>-------------------------------------------------------------------- ----- >>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 >> > >-- Michael Droettboom >Science Software Branch >Operations and Engineering Division >Space Telescope Science Institute >Operated by AURA for NASA >
If your first tuple is "codes", and second is "vertices", You can do: from matplotlib import path from matplotlib import patches from matplotlib import pyplot as plt patch = patches.PathPatch(path.Path(vertices, codes)) plt.gca().add_patch(patch) plt.show() However... rather than going through all that, have you considered using vlines? That will save you the trouble of generating all the data in that format yourself. http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.vlines Cheers, Mike Amitava Maity wrote: > Hello list, > > I have generated the following tuples: > > (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2) > ((39525.540000000001, 144.91), (39525.540000000001, 161.352), > (39874.5, 149.5), (39874.5, 166.142), (40205.0, 150.41), > (40205.0, > 167.05199999999999), (40518.449999999997, 149.36000000000001), > (40518.449999999997, 166.00200000000001), (40828.0, > 148.50999999999999), (40828.0, 165.15199999999999), > (41173.239999999998, 151.16), (41173.239999999998, 167.602), > (41510.0, > 150.09), (41510.0, 166.732), (41858.0, 146.25), (41858.0, > 162.892), > (42158.0, 152.63999999999999), (42158.0, 169.28199999999998), > (42486.889999999999, 155.22999999999999), (42486.889999999999, > 171.672)) > > How do I use the Matplotlib.path class to draw a set of > disconnected > vertical lines? > > Thanks in advance, > AMaity. > > ------------------------------------------------------------------------- > 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 > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hello list, I have generated the following tuples: (1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2) ((39525.540000000001, 144.91), (39525.540000000001, 161.352), (39874.5, 149.5), (39874.5, 166.142), (40205.0, 150.41), (40205.0, 167.05199999999999), (40518.449999999997, 149.36000000000001), (40518.449999999997, 166.00200000000001), (40828.0, 148.50999999999999), (40828.0, 165.15199999999999), (41173.239999999998, 151.16), (41173.239999999998, 167.602), (41510.0, 150.09), (41510.0, 166.732), (41858.0, 146.25), (41858.0, 162.892), (42158.0, 152.63999999999999), (42158.0, 169.28199999999998), (42486.889999999999, 155.22999999999999), (42486.889999999999, 171.672)) How do I use the Matplotlib.path class to draw a set of disconnected vertical lines? Thanks in advance, AMaity.
On Wed, Oct 29, 2008 at 11:19 PM, Anthony Floyd <ant...@gm...> wrote: > Hi Adam, > > On Sun, Oct 26, 2008 at 4:34 PM, Adam <kef...@gm...> wrote: >> Hi, I'm trying to make myself a set of widgets for the first time. >> I've gotten to the point that I can draw rectangles and lines and make >> them do the right things when re-drawing figures, zooming, etc., but >> I'm still a little lost on some points, and I haven't found any really >> good documentation. >> >> >> So, first question: Where should I go for documentation first? > > As you've probably noticed, the documentation is in the middle of an > update. Part of what has suffered while the docs are updated is the > API documentation. The source code, however, is quite well > documented. A good way to get access to this documentation is to get > a hold of epydoc and run it on the matplotlib source tree. This will > generate good local docs for you. Thanks, I was unaware of epydoc. The new matplotlib page (which wasn't up when I asked this question) has a lot of examples showing exactly what I want to do, so that will probably help a lot too. Adam
Søren, Why wouldn't you allocate a 'zorder' to each mask, corresponding to a layer nb. That way, if a same pixel is shared by 2 masks or more, you take the one with the highest zorder. That could be done as easily as definind a `maskstack` list, with element `i` the mask with zorder `i`. Now, the global mask is simply np.logical_or.reduce(maskstack). That way, you could leave any masked data in the original dataset alone and not mix it with your stack of patches. Let me know how it goes. On Wednesday 29 October 2008 21:10:34 Søren Nielsen wrote: > Hi, > > I'm making a masking function that can mask out certain areas of an image > using different types of masks, and display them using patches. I want to > add a function where a user can move a mask that has already been created. > > I can use the picker = True to have it return the patch being clicked on.. > but how do I know which mask was clicked on if I have two identical masks? > or even worse, if I have two identical masks almost lying ontop of each > other.. returning both patches at the same time?? I've tried different > things using == to compare.. but that didn't work.. any suggestions?? > > Soren
I can't reproduce this here with SVN trunk. I get what you expect. Can you provide the information outlined here: http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#report-a-problem as well as the backend you are using? Cheers, Mike Thomas Pfaff wrote: > Hello, > > I'm having a problem reusing a figure with the savefig command. > I want to generate image timeseries with GoogleEarth displaying weather > radar data, so my plot geometry is the same always and only the color of the > patches which represent measurements changes over time. > Now I want those portions of the image, where no precipitation occurs to be > transparent so I was thinking about setting the visibility of those Polygons > to False and that would be it. > > Unfortunately savefig seems to reuse the image it created before when called > a second time. > > I wrote this example code. > > ########################## > #start > #set some image parameters > figsize = (1.,1.) > dpi = 300 > rect = [0.,0.,1.,1.] > #get figure and axes objects > fig = plt.figure(figsize=figsize, dpi=dpi, frameon=False) > ax = fig.add_axes(rect, frameon=False) > ax.set_aspect(1.0) > > #create two polygons, one filling the left half of the image > # one the right half > poly1 = Polygon(([0,0],[0.5,0],[0.5,1],[0,1],[0,0]), fill=True) > ax.add_patch(poly1) > poly2 = Polygon(([0.5,0],[1,0],[1,1],[0.5,1],[0.5,0]), fill=True) > ax.add_patch(poly2) > > # basic colors black, red, green, blue > colors=['#000000','#ff0000','#00ff00','#0000ff'] > # switch for the left polygon > values =[-1, 1, -1, 1] > for value, color in zip(values, colors): > if value < 0: > poly1.set_visible(False) > else: > poly1.set_visible(True) > poly1.set_facecolor(color) > poly2.set_facecolor(color) > > plt.savefig('test'+color[1:]+'.png',dpi=dpi,format='png',transparent=True) > # end > ########################## > > > Now, what I expect and what I get is: > > Test000000.png: black on the right side, transparent with tick marks on the > left - this is what I get. > > Testff0000.png: red on both sides with tick marks visible - This is what I > get. > > Test00ff00.png: green on the right side, transparent on the left. What I get > is green on the right and red on the left. So the red from the previous > patch has been retained > > Test0000ff.png: blue on both sides, which is what I get as well. > > > So apparently the plot is updated, but only in places where something is > actually drawn. The rest remains unchanged and so transparency is not > restored. > > I tried using clf, cla, deleting objects. In all cases savefig just always > produced the first image over and over, most probably because nothing new > was drawn. > > I even tried to remove fig's canvas object, hoping that the library might > create a new one, but that only gave me a traceback. > > > Any ideas what I'm doing wrong or how I could solve this problem? > > Thank you very much in advance, > > > Thomas > > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA
Hi I am using Python 2.4.4, Numpy 1.1.1 and Pylab 0.98.3 and have a problem with saving to eps. Basically I create 7 plots, each with 2 subplots of which one is an imshow colour map and the second is a simple plot(). When saving them to eps I can display 5 out of 7 with ghostview but 2 of them fail to display. Setting the file type to PNG I can get all 7 out but this is for a ps latex document so I need eps. If I turn off the plot() subplot I can get all 7 out into eps. All 7 plots are effectively the same just with different data and all 7 display fine via the backend Tkagg. Any ideas Cheers James
Hello, I'm having a problem reusing a figure with the savefig command. I want to generate image timeseries with GoogleEarth displaying weather radar data, so my plot geometry is the same always and only the color of the patches which represent measurements changes over time. Now I want those portions of the image, where no precipitation occurs to be transparent so I was thinking about setting the visibility of those Polygons to False and that would be it. Unfortunately savefig seems to reuse the image it created before when called a second time. I wrote this example code. ########################## #start #set some image parameters figsize = (1.,1.) dpi = 300 rect = [0.,0.,1.,1.] #get figure and axes objects fig = plt.figure(figsize=figsize, dpi=dpi, frameon=False) ax = fig.add_axes(rect, frameon=False) ax.set_aspect(1.0) #create two polygons, one filling the left half of the image # one the right half poly1 = Polygon(([0,0],[0.5,0],[0.5,1],[0,1],[0,0]), fill=True) ax.add_patch(poly1) poly2 = Polygon(([0.5,0],[1,0],[1,1],[0.5,1],[0.5,0]), fill=True) ax.add_patch(poly2) # basic colors black, red, green, blue colors=['#000000','#ff0000','#00ff00','#0000ff'] # switch for the left polygon values =[-1, 1, -1, 1] for value, color in zip(values, colors): if value < 0: poly1.set_visible(False) else: poly1.set_visible(True) poly1.set_facecolor(color) poly2.set_facecolor(color) plt.savefig('test'+color[1:]+'.png',dpi=dpi,format='png',transparent=True) # end ########################## Now, what I expect and what I get is: Test000000.png: black on the right side, transparent with tick marks on the left - this is what I get. Testff0000.png: red on both sides with tick marks visible - This is what I get. Test00ff00.png: green on the right side, transparent on the left. What I get is green on the right and red on the left. So the red from the previous patch has been retained Test0000ff.png: blue on both sides, which is what I get as well. So apparently the plot is updated, but only in places where something is actually drawn. The rest remains unchanged and so transparency is not restored. I tried using clf, cla, deleting objects. In all cases savefig just always produced the first image over and over, most probably because nothing new was drawn. I even tried to remove fig's canvas object, hoping that the library might create a new one, but that only gave me a traceback. Any ideas what I'm doing wrong or how I could solve this problem? Thank you very much in advance, Thomas -- Using Python2.5, matplotlib 0.98.3, numpy 1.1.1, matplotlib.basemap 0.99.1 On WindowsXP SP3, Pentium4 DualCore 3.4GHz, 3GB RAM
Hi Adam, On Sun, Oct 26, 2008 at 4:34 PM, Adam <kef...@gm...> wrote: > Hi, I'm trying to make myself a set of widgets for the first time. > I've gotten to the point that I can draw rectangles and lines and make > them do the right things when re-drawing figures, zooming, etc., but > I'm still a little lost on some points, and I haven't found any really > good documentation. > > > So, first question: Where should I go for documentation first? As you've probably noticed, the documentation is in the middle of an update. Part of what has suffered while the docs are updated is the API documentation. The source code, however, is quite well documented. A good way to get access to this documentation is to get a hold of epydoc and run it on the matplotlib source tree. This will generate good local docs for you. Cheers, A>
Hi, I'm making a masking function that can mask out certain areas of an image using different types of masks, and display them using patches. I want to add a function where a user can move a mask that has already been created. I can use the picker = True to have it return the patch being clicked on.. but how do I know which mask was clicked on if I have two identical masks? or even worse, if I have two identical masks almost lying ontop of each other.. returning both patches at the same time?? I've tried different things using == to compare.. but that didn't work.. any suggestions?? Soren