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
(19) |
2
(3) |
3
(12) |
4
(2) |
5
|
6
(9) |
7
(27) |
8
(39) |
9
(17) |
10
(22) |
11
(5) |
12
(1) |
13
(11) |
14
(12) |
15
(14) |
16
(29) |
17
(32) |
18
(8) |
19
(3) |
20
(10) |
21
(27) |
22
(11) |
23
(8) |
24
(4) |
25
(4) |
26
(3) |
27
(18) |
28
(7) |
29
(29) |
30
(13) |
31
(4) |
|
Dear John, dear Eric, thanks for the prompt response! ..any chance you could attach the final patch file for collections.py? Cheers Juergen On Monday 27 March 2006 23:38, Eric Firing wrote: > John, > > Done as recommended, thanks. > > Eric > > John Hunter wrote: > >>>>>>"Eric" == Eric Firing <ef...@ha...> writes: > > > > Eric> if isinstance(x, str) and x == 'None': > > > > This is not considered best practice for testing for strings, because > > the pythonic philosophy is "if it walks like a duck and talks like a > > duck, we'll treat it like a duck", aka "duck-typing" > > > > So matplotlib.cbook provides is_string_like > > > > from matplotlib.cbook import is_string_like > > if is_string_like(x) and x == 'None': > > something > > > > > > The implementation is: > > > > def is_string_like(obj): > > if hasattr(obj, 'shape'): return 0 # this is a workaround > > # for a bug in numeric<23.1 > > try: obj + '' > > except (TypeError, ValueError): return 0 > > return 1 > > > > > > This basically tests for the ability to add oneself to a string, which > > is a solution suggested by the Python Cookbook. > > > > JDH
John, Done as recommended, thanks. Eric John Hunter wrote: >>>>>>"Eric" == Eric Firing <ef...@ha...> writes: > > > Eric> if isinstance(x, str) and x == 'None': > > This is not considered best practice for testing for strings, because > the pythonic philosophy is "if it walks like a duck and talks like a > duck, we'll treat it like a duck", aka "duck-typing" > > So matplotlib.cbook provides is_string_like > > from matplotlib.cbook import is_string_like > if is_string_like(x) and x == 'None': > something > > > The implementation is: > > def is_string_like(obj): > if hasattr(obj, 'shape'): return 0 # this is a workaround > # for a bug in numeric<23.1 > try: obj + '' > except (TypeError, ValueError): return 0 > return 1 > > > This basically tests for the ability to add oneself to a string, which > is a solution suggested by the Python Cookbook. > > JDH
>>>>> "Eric" == Eric Firing <ef...@ha...> writes: Eric> if isinstance(x, str) and x == 'None': This is not considered best practice for testing for strings, because the pythonic philosophy is "if it walks like a duck and talks like a duck, we'll treat it like a duck", aka "duck-typing" So matplotlib.cbook provides is_string_like from matplotlib.cbook import is_string_like if is_string_like(x) and x == 'None': something The implementation is: def is_string_like(obj): if hasattr(obj, 'shape'): return 0 # this is a workaround # for a bug in numeric<23.1 try: obj + '' except (TypeError, ValueError): return 0 return 1 This basically tests for the ability to add oneself to a string, which is a solution suggested by the Python Cookbook. JDH
John Hunter wrote: >>>>>>"Eric" == Eric Firing <ef...@ha...> writes: > > - if self._edgecolors == 'None': > + if self._edgecolors is 'None': self._edgecolors = self._facecolors > > > You need to be careful when using 'is' for comparisons. This tests to > see if two objects actually share the same pointer in memory. This is > appropriate for the object None, but not the string 'None' > John, I thought that python was keeping track of string objects so as not to duplicate them, as the simple test I did seemed to confirm. Your counterexample is more subtle. Lesson learned! It looks like I will have to use if isinstance(x, str) and x == 'None': to get around the problem that the comparison will fail if x is a numarray array (but not Numeric or numpy). Eric > >>>>x = 'None' >>>>y = x.capitalize() >>>>x > > 'None' > >>>>y > > 'None' > >>>>x==y > > True > >>>>x is y > > False > > > matplotlib uses the string 'None' in some cases because the object > None is already used to mean "do the default thing using rc" > > JDH
I have a figure made with plot_date. The tickmarklabels on the x axis are weekday names. Currently the weekday label is aligned underneath the tickmark, but I would like to align the label to rhe right of the tickmark (halfway to next tick) I can find examples of how to rotate and resize these strings, but I cannot move them. Is there a simple way to do that? Sincerely Halldor Bjornsson Bustadavegur 9 IS150 Reykjavik Iceland. e: halldor()vedur.is tel:+354-522600
>>>>> "Eric" == Eric Firing <ef...@ha...> writes: - if self._edgecolors == 'None': + if self._edgecolors is 'None': self._edgecolors = self._facecolors You need to be careful when using 'is' for comparisons. This tests to see if two objects actually share the same pointer in memory. This is appropriate for the object None, but not the string 'None' >>> x = 'None' >>> y = x.capitalize() >>> x 'None' >>> y 'None' >>> x==y True >>> x is y False matplotlib uses the string 'None' in some cases because the object None is already used to mean "do the default thing using rc" JDH
Juergen, I think the patch below will fix the bug; I will apply it to svn unless a problem crops up. Eric Index: collections.py =================================================================== --- collections.py (revision 2231) +++ collections.py (working copy) @@ -170,7 +170,7 @@ else: Artist.set_alpha(self, alpha) self._facecolors = [(r,g,b,alpha) for r,g,b,a in self._facecolors] - if self._edgecolors != 'None': + if self._edgecolors is not 'None': self._edgecolors = [(r,g,b,alpha) for r,g,b,a in self._edgecolors] def update_scalarmappable(self): @@ -253,7 +253,7 @@ self._transform.freeze() self._transOffset.freeze() self.update_scalarmappable() - if self._edgecolors == 'None': + if self._edgecolors is 'None': self._edgecolors = self._facecolors renderer.draw_poly_collection( self._verts, self._transform, self.clipbox, @@ -322,7 +322,7 @@ self.update_scalarmappable() scales = sqrt(self._sizes*self._dpi.get()/72.0) - if self._edgecolors == 'None': + if self._edgecolors is 'None': self._edgecolors = self._facecolors renderer.draw_regpoly_collection( Juergen Haas wrote: > Dear All, > > I would like to draw (3,3) subplots and afterwards resize the whole widget. > Plotting works like a charm, but when resizing the widget these errors are > reported: > (Version 0.87.2, Tkagg,suse 10.0) > > When resizing, or even just clicking on the button for the widget to rearrange > the plot on the fly, I get the messages below... > > cheers Juergen > PS I am currently using the figsize option to figure as workaround.. > > Exception in Tkinter callback > Traceback (most recent call last): > File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__ > return self.func(*args) > File > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", > line 148, in resize > self.show() > File > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", > line 151, in draw > FigureCanvasAgg.draw(self) > File > "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", > line 398, in draw > self.figure.draw(renderer) > File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line > 529, in draw > for a in self.axes: a.draw(renderer) > File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line 1455, > in draw > a.draw(renderer) > File "/usr/local/lib/python2.4/site-packages/matplotlib/collections.py", > line 325, in draw > if self._edgecolors == 'None': > File "/usr/local/lib/python2.4/site-packages/numarray/generic.py", line 537, > in __nonzero__ > raise RuntimeError("An array doesn't make sense as a truth value. Use > any(a) or all(a).") > RuntimeError: An array doesn't make sense as a truth value. Use any(a) or > all(a). > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Ken McIvor wrote: > On Mar 25, 2006, at 10:15 AM, Steve Bergman wrote: > >> I need to be able to render a plot (actually a pie) in png, jpg, or >> gif format directly into a variable that I can return to the >> application server. I'm currently using the rather ugly method of >> writing to a temp file and then reading it back in and returning the >> data. Is there a way to do this completely in memory? > > Thanks for the response. :-) Yes, shortly after I sumitted my question to the list I found that on the wiki. After thinking about it a bit, I decided that the creation of a temporary file, which only exists for a fraction of a second before being deleted (and therefore never makes it to disk), does not cost me that much, and is really the simpler solution. It would be nice if I could do: image = render(figure, format='png') return image But hey, I'm not complaining. Matplotlib was there when I needed it and does what I need it to do. I've been using OSS for about ten years now. And for the most part I take it for granted that I'll be able to do what I need to do with OSS. But when you think about it, it's really pretty amazing that there is always a safety net there that works, and works well. Sometimes the safety net is aestheticly pleasing. Sometimes not. And sometimes it doesn't seem so at first, but seems more pleasing the closer you get to it. One thing that people forget to do is thank the developers. Oh, we l^Husers do it. But we tend to note the times that we do and forget the times we don't. Thank You All. Oh, and thread_object.acquire(True) and thread_object.release() are still my friends. :-) -Steve
John Hunter wrote: > Interesting also that both of you appear to have german as your > default language. I wonder if one of the default fonts you are using > is different and is providing bad font metrics. Hi Finally I found some time to check this one. I changed my system language from german into english and the problem went away. Although I wonder which files mpl loads are different since a run with --verbose=debug says font search path ['/usr/lib/python2.3/site-packages/matplotlib/mpl-data'] trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/VeraSe.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/VeraMono.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/cmr10.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/cmtt10.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/cmmi10.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/VeraMoBd.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/VeraBI.ttf trying fontname /usr/lib/python2.3/site-packages/matplotlib/mpl-data/Vera.ttf loaded ttfcache file /home/elcorto/.matplotlib/ttffont.cache backend GTKAgg version 2.6.1 findfont failed Lucida Grande findfont failed Verdana findfont failed Geneva findfont failed Lucida findfont found Bitstream Vera Sans, normal, normal 500, normal, 12.0 findfont returning /usr/lib/python2.3/site-packages/matplotlib/mpl-data/Vera.ttf So does mpl use system fonts as well as it's own? cheers, steve ps: Some time ago I posted a _mathtext_data.py which turns slanted uppercase greek letters into non-slanted ones. It works nicely here on my system. Has anyone of the developers had a look at it? -- Random number generation is the art of producing pure gibberish as quickly as possible.
Adam Mercer wrote: > but surely the problem I'm experiencing is not related to the python version? Maybe, maybe not. However, you'll get more support for the Framework version, and be more likely to just find a pre-built one. Charlie Mode has been building them, and I've built some older versions. >> The MacPython Community is trying desperately to focus on one build of >> Python to support: you'll get more help with these. > > Surely the best one to focus on is that as supplied by Apple? No, it's not. If you really want to know the arguments, there's a lot of discussion on the python-mac list, but the short version is this: We have no control over what Apples does. They have in the past: delivered broken versions, not upgraded except on major OS upgrades, and when they do upgrade , they don't preserve backward compatibility with installed modules. There is very little cost to installing the 2.4.1 Framework build, at least if you have a decent Internet connection. > Originally I installed matplotlib from darwinports which also > installed python-2.4.x which worked great. However I also need to run > ROOT which only builds on Mac OS X against a framework installation of > python Is ROOT using python now? cool. Does ROOT require pyGTK? IF not, you can use MPL with wxPython or TK instead. It may be easier -- I know my builds supported Tk and Wx, but not GTK. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
T24gMjcvMDMvMDYsIENocmlzdG9waGVyIEJhcmtlciA8Q2hyaXMuQmFya2VyQG5vYWEuZ292PiB3 cm90ZToKCj4gPiBJJ20gdHJ5aW5nIHRvIGJ1aWxkIG1hdHBsb3RsaWItMC44Ny4yIG9uIE1hYyBP UyBYIDEwLjQuNSBQb3dlclBDCj4KPiA+IFtyYW1AemlwcHkgcmFtXSQgcHl0aG9uCj4gPiBQeXRo b24gMi4zLjUgKCMxLCBNYXIgMjAgMjAwNSwgMjA6Mzg6MjApCj4gPiBbR0NDIDMuMyAyMDAzMDMw NCAoQXBwbGUgQ29tcHV0ZXIsIEluYy4gYnVpbGQgMTgwOSldIG9uIGRhcndpbgo+Cj4gVGhpcyBs b29rcyBsaWtlIHRoZSBBcHBsZS1wcm92aWRlZCB2ZXJzaW9uIG9mIFB5dGhvbi4gSSBoaWdobHkg cmVjb21tZW5kCj4gdGhhdCB5b3UgaW5zdGFsbCB0aGUgbmV3ZXIsIHRoaXJkLXBhcnR5ICJGcmFt ZXdvcmsgQnVpbGQiIFB5dGhvbjoKCjxzbmlwPgoKYnV0IHN1cmVseSB0aGUgcHJvYmxlbSBJJ20g ZXhwZXJpZW5jaW5nIGlzIG5vdCByZWxhdGVkIHRvIHRoZSBweXRob24gdmVyc2lvbj8KCj4gVGhl IE1hY1B5dGhvbiBDb21tdW5pdHkgaXMgdHJ5aW5nIGRlc3BlcmF0ZWx5IHRvIGZvY3VzIG9uIG9u ZSBidWlsZCBvZgo+IFB5dGhvbiB0byBzdXBwb3J0OiB5b3UnbGwgZ2V0IG1vcmUgaGVscCB3aXRo IHRoZXNlLgoKU3VyZWx5IHRoZSBiZXN0IG9uZSB0byBmb2N1cyBvbiBpcyB0aGF0IGFzIHN1cHBs aWVkIGJ5IEFwcGxlPwoKPiBXaGljaCBicmluZ3MgdXAgdGhlIHF1ZXN0aW9uczogV2h5IFB5R3Rr PyBJbiBnZW5lcmFsLCBQeUd0ayBkb2Vzbid0IHBsYXkKPiB2ZXJ5IHdlbGwgd2l0aCBPUy1YLCBB RkFJSywgbW9zdCBwZW9wbGUgb25seSB1c2UgUHlHdGsgaWYgdGhleSBhcmUgdXNpbmcKPiBpdCBp biB0aGUgY29udGV4dCBvZiAidW5peHkiIHN0dWZmLCB3aGljaCBtZWFucyBydW5uaW5nIGRhcndp bnBvcnRzIG9yCj4gZmluay4gSW4gdGhhdCBjYXNlLCB5b3Ugc2hvdWxkIGluc3RhbGwgZXZlcnl0 aGluZyB0aHJvdWdoIGZpbmsgb3IKPiBkYXJ3aW5wb3J0cy4KCk9yaWdpbmFsbHkgSSBpbnN0YWxs ZWQgbWF0cGxvdGxpYiBmcm9tIGRhcndpbnBvcnRzIHdoaWNoIGFsc28KaW5zdGFsbGVkIHB5dGhv bi0yLjQueCB3aGljaCB3b3JrZWQgZ3JlYXQuIEhvd2V2ZXIgSSBhbHNvIG5lZWQgdG8gcnVuClJP T1Qgd2hpY2ggb25seSBidWlsZHMgb24gTWFjIE9TIFggYWdhaW5zdCBhIGZyYW1ld29yayBpbnN0 YWxsYXRpb24gb2YKcHl0aG9uLCBoZW5jZSBteSB0cnlpbmcgdG8gYnVpbGQgbWF0cGxvdGxpYiBh Z2FpbnN0IHRoZSBBcHBsZSBwcm92aWRlZApweXRob24sIGFzIHRoZSBkYXJ3aW5wb3J0cyBweXRo b24gaXMgbm90IGEgZnJhbWV3b3JrIGluc3RhbGwuCgpUaGVyZWZvcmUgSSBjb3VsZG4ndCB1c2Ug YSBkYXJ3aW5wb3J0cyBpbnN0YWxsZWQgbWF0cGxvdGxpYiBhbmQgUk9PVApmcm9tIHRoZSBzYW1l IHB5dGhvbi4KCkNoZWVycwoKQWRhbQo=
>>>>> "Ken" == Ken McIvor <mc...@ii...> writes: Ken> imbuf = StringIO() im = Image.fromstring('RGB', (width, Ken> height), buf, 'raw', 'RGB', 0, 1) im.save(imbuf, 'PNG') Ken> return imbuf.getvalue() Note to enterprising mpl users/developers, we should take a look at the PIL code to see how the effbot does this. I have spent some time looking into libpng to see how to get it to write to a StringIO instance. Last time I looked, I couldn't find a way to get a FILE* out of the stringio instance.... The ability to write to a StringIO instance is a frequent reqest, and emulating PILs approach would be a good way to go (and faster than Ken's approach). JDH
On Mar 25, 2006, at 10:15 AM, Steve Bergman wrote: > I need to be able to render a plot (actually a pie) in png, jpg, or > gif format directly into a variable that I can return to the > application server. I'm currently using the rather ugly method of > writing to a temp file and then reading it back in and returning > the data. Is there a way to do this completely in memory? Attached is a script which uses the Agg backend and the Python Imaging Library to generate the PNG as a string. The same caveats about pylab and multithreading still apply. I hope this helps you get started. Ken
Adam Mercer wrote: > I'm trying to build matplotlib-0.87.2 on Mac OS X 10.4.5 PowerPC > [ram@zippy ram]$ python > Python 2.3.5 (#1, Mar 20 2005, 20:38:20) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin This looks like the Apple-provided version of Python. I highly recommend that you install the newer, third-party "Framework Build" Python: Either 2.4.1 from: http://www.undefined.org/python/ There are a bunch of packages pre-built for it at: http://pythonmac.org/packages/ or, if you want to be on the bleeding edge, the new Universal (PPC and Intel) build: http://homepage.mac.com/ronaldoussoren We're just started to try to get packages built for that one. I don't know if anyone's got MPL working for it yet. The MacPython Community is trying desperately to focus on one build of Python to support: you'll get more help with these. Which brings up the questions: Why PyGtk? In general, PyGtk doesn't play very well with OS-X, AFAIK, most people only use PyGtk if they are using it in the context of "unixy" stuff, which means running darwinports or fink. In that case, you should install everything through fink or darwinports. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no...
SGkKCkknbSB0cnlpbmcgdG8gYnVpbGQgbWF0cGxvdGxpYi0wLjg3LjIgb24gTWFjIE9TIFggMTAu NC41IFBvd2VyUEMsIGJ1dAphbSBoYXZpbmcgcHJvYmxlbXMgd2l0aCBidWlsZGluZyB0aGUgZ3Rr IGd1aS4gSSBoYXZlIHB5Z3RrLTIuOC40Cmluc3RhbGxlZCBhbmQgcHlndGstZGVtbyBydW5zIHdp dGhvdXQgaXNzdWUuIEhvd2V2ZXIgd2hlbiBJIHRyeSB0bwpidWlsZCBtYXRwbG90bGliIHVzaW5n ICJweXRob24gc2V0dXAucHkgYnVpbGQiIGl0IHRlbGxzIG1lIHRoYXQgaXQKbmVlZHMgcHlndGsg aW5vcmRlciB0byBidWlsZCB0aGUgZ3RrIGd1aS4gVGhpcyBpcyBob3dldmVyIGluc3RhbGxlZCwK YW5kIGNhbiBiZSBpbXBvcnRlZCBpbnRvIHB5dGhvbiB3aXRob3V0IGVycm9yCgpbcmFtQHppcHB5 IHJhbV0kIHB5dGhvbgpQeXRob24gMi4zLjUgKCMxLCBNYXIgMjAgMjAwNSwgMjA6Mzg6MjApCltH Q0MgMy4zIDIwMDMwMzA0IChBcHBsZSBDb21wdXRlciwgSW5jLiBidWlsZCAxODA5KV0gb24gZGFy d2luClR5cGUgImhlbHAiLCAiY29weXJpZ2h0IiwgImNyZWRpdHMiIG9yICJsaWNlbnNlIiBmb3Ig bW9yZSBpbmZvcm1hdGlvbi4KPj4+IGltcG9ydCBweWd0awo+Pj4KCmxvb2tpbmcgYXQgc2V0dXAu cHksIGl0IGlzIGNoZWNraW5nIGZvciB0aGUgZXhpc3RhbmNlIG9mIHRoZSBndGsKbW9kdWxlLCBu b3QgdGhlIHB5Z3RrIG1vZHVsZSAtIGhlbmNlIHRoZSByZWFzb24gZm9yIHRoZSBmYWlsdXJlLiBX aGF0CmVsc2UgZG8gSSBuZWVkIHRvIGluc3RhbGwgdG8gYnVpbGQgbWF0cGxvdGxpYiBmcm9tIHNv dXJjZSBvbiBNYWMgT1MgWD8KCkNoZWVycwoKQWRhbQo=
Massimo, Sorry for the slow reply. I seem to be perpetually behind in my mailing list reading. For better or for worse, WxMpl currently eschews the Matplotlib event API and expects developers to use the wxPython event API [1]. However, there is a PointEvent which is emitted when the user left- clicks on an axes. I have attached a demonstration script which uses this event to draw a scatter plot of user selected points. Please let me know if you have any other questions. Ken
Hi everyone, Guess no-one has a trick yet to put in an axis break. My question is now, should this not be on the goals list at least? If the developers think it is a good idea to implement this, I would like to have a go at it. As I'm not all that familiar with the matplotlib internals it would be great if someone has any ideas on how to go about it. Cheers, Ralf On Wednesday 22 March 2006 12:13, you wrote: > Hi everyone, > > I am looking for a way to use an axis break in one of the axes of a normal > scatter plot. I searched the mailing lists and users guide but couldn't > find anything. > > I can transform my data and manually set the tick labels so the graph looks > the way I want, but that does not give me the actual axis break symbol > (double straight or squiggly lines perpendicular to the axis). > > If anyone knows how to do this I'd appreciate the help. > > Cheers, > Ralf
>>>>> "John" == John Byrnes <by...@bu...> writes: John> Check your matplotlibrc to make sure you have a windowing John> toolkit backend selected (TkAgg, GTKAgg, WXAgg, etc.) It John> sounds like you might have the postscript backend or similar John> selected. If you build from source, and no GUI toolkits are detected at build time, then eiterh Agg or PS will be selected as your default backend. However, you should still see output when running in verbose-helpful. I have never seen the kind of behavior you describe. Could you give us a little more information (are you building from source, what version, what backend do you have set, what is your python version)? JDH
Dear All, I would like to draw (3,3) subplots and afterwards resize the whole widget. Plotting works like a charm, but when resizing the widget these errors are reported: (Version 0.87.2, Tkagg,suse 10.0) When resizing, or even just clicking on the button for the widget to rearrange the plot on the fly, I get the messages below... cheers Juergen PS I am currently using the figsize option to figure as workaround.. Exception in Tkinter callback Traceback (most recent call last): File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 1345, in __call__ return self.func(*args) File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", line 148, in resize self.show() File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_tkagg.py", line 151, in draw FigureCanvasAgg.draw(self) File "/usr/local/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 398, in draw self.figure.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/figure.py", line 529, in draw for a in self.axes: a.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/axes.py", line 1455, in draw a.draw(renderer) File "/usr/local/lib/python2.4/site-packages/matplotlib/collections.py", line 325, in draw if self._edgecolors == 'None': File "/usr/local/lib/python2.4/site-packages/numarray/generic.py", line 537, in __nonzero__ raise RuntimeError("An array doesn't make sense as a truth value. Use any(a) or all(a).") RuntimeError: An array doesn't make sense as a truth value. Use any(a) or all(a).
Check your matplotlibrc to make sure you have a windowing toolkit=20 backend selected (TkAgg, GTKAgg, WXAgg, etc.) It sounds like you might have the postscript backend or similar selected. John On Sun, Mar 26, 2006 at 08:25:37PM +0200, stdout stdout wrote: > Hello list! >=20 > I spent the entire weekend trying to make the first example in the > screenshot section > (http://matplotlib.sourceforge.net/screenshots.html) work : >=20 > from pylab import * >=20 > t =3D arange(0.0, 2.0, 0.01) > s =3D sin(2*pi*t) > plot(t, s, linewidth=3D1.0) >=20 > xlabel('time (s)') > ylabel('voltage (mV)') > title('About as simple as it gets, folks') > grid(True) > show() >=20 > The given example works on my friend's system, but here what it does , > it's just a quiet exit : > $python example.py > $ >=20 > I then try ed to run python with --verbose-helpful but it was still > all quiet. Also trying to install scipy & friends manually haven't > produced any success ;-( . >=20 > I'm desperate as I really don't know where to look for the issue. I'm > that helps, i'm using gentoo. >=20 > Enjoy! >=20 >=20 >=20 > -- >=20 > Utmpd author : > http://utmpdix.sourceforge.net/ >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting langua= ge > that extends applications into web and mobile media. Attend the live webc= ast > and join the prime developer group breaking into this new coding territor= y! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=110944&bid1720ドル&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users --=20 "I'll carry your books, I'll carry a tune, I'll carry on, carry over, carry forward, Cary Grant, cash & carry, Carry Me Back To Old Virginia, I'll even Hara Kari if you show me how, but I will *not* carry a gun." -- Hawkeye, M*A*S*H
stdout stdout wrote: >Hello list! > >I spent the entire weekend trying to make the first example in the >screenshot section >(http://matplotlib.sourceforge.net/screenshots.html) work : > >from pylab import * > >t = arange(0.0, 2.0, 0.01) >s = sin(2*pi*t) >plot(t, s, linewidth=1.0) > >xlabel('time (s)') >ylabel('voltage (mV)') >title('About as simple as it gets, folks') >grid(True) >show() > >The given example works on my friend's system, but here what it does , >it's just a quiet exit : >$python example.py >$ > >I then try ed to run python with --verbose-helpful but it was still >all quiet. Also trying to install scipy & friends manually haven't >produced any success ;-( . > >I'm desperate as I really don't know where to look for the issue. I'm >that helps, i'm using gentoo. > > Well, I'm a new user. My gui doesn't work either. But that's fine with me since I'm only wanting to use pylab in a TurboGears/CherryPy web app. Until someone else can help you more, try putting a "savefig('filename.png') in place of the show(). You'll get a png written to filename which you can then view to your heart's content, in all its breathtaking glory, in the viewer of your choice. Hope this helps at least a little. -Steve
Hello list! I spent the entire weekend trying to make the first example in the screenshot section (http://matplotlib.sourceforge.net/screenshots.html) work : from pylab import * t =3D arange(0.0, 2.0, 0.01) s =3D sin(2*pi*t) plot(t, s, linewidth=3D1.0) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) show() The given example works on my friend's system, but here what it does , it's just a quiet exit : $python example.py $ I then try ed to run python with --verbose-helpful but it was still all quiet. Also trying to install scipy & friends manually haven't produced any success ;-( . I'm desperate as I really don't know where to look for the issue. I'm that helps, i'm using gentoo. Enjoy! -- Utmpd author : http://utmpdix.sourceforge.net/
Eric Firing wrote: > > An alternative would be to use a locking mechanism to ensure that your > plotting function runs from start to end without interruption by > another thread. > Thanks. I'm now controlling access with a lock object and it's working fine. -Steve
Steve, I think the short answer is that the pylab interface is inherently single-threaded; it is intended to facilitate interactive plotting. It has a single list of figures, a concept of a single current figure, and within that a single current axes. If you use more than one thread, then thread B is liable to change the current figure or axes while thread A is in the middle of doing something with it. It is a recipe for chaos. Careful adherence to the Object-oriented interface that underlies the pylab interface should mostly solve the problem, because then each thread should be operating on its own figure and axes. I said "mostly" because there is still the global rcParams dictionary; you will need to be sure that your plotting threads treat it as read-only. There may be other such things that have not occurred to me. An alternative would be to use a locking mechanism to ensure that your plotting function runs from start to end without interruption by another thread. Eric Steve Bergman wrote: > I am using the method below to dynamically generate pie charts in my > TurboGears/CherryPy web app. Everything works fine until I increase the > number of application threads allowed to > 1. > > Then all manner of wierdness occurs. Pies charts which are not scaled > properly, which have the various wedges scaled differently from each > other, and incomplete pie charts. > > Am I doing something wrong? > > def pie_chart(self, **kw): > figure(1, figsize=(0.75,0.75), frameon=False) ax = axes([0.1, > 0.1, 0.8, 0.8]) > labels = 'Contract', 'Billable', 'Unbillable', 'Nonbill' > billable=float(kw['billable']) > contract=float(kw['contract']) > unbillable=float(kw['unbillable']) > nonbill=float(kw['nonbill']) > fracs = [contract,billable, unbillable,nonbill] > fig = pie(fracs, shadow=False, colors=('#70A0A0', > '#C0F090','#C03030', '#FFFFFF')) > fname = os.tmpnam() + ".png" > savefig(fname) > f=open(fname,'r') > x=f.read() > f.close() > os.remove(fname) > pylab.close() > return (x) > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I am using the method below to dynamically generate pie charts in my TurboGears/CherryPy web app. Everything works fine until I increase the number of application threads allowed to > 1. Then all manner of wierdness occurs. Pies charts which are not scaled properly, which have the various wedges scaled differently from each other, and incomplete pie charts. Am I doing something wrong? def pie_chart(self, **kw): figure(1, figsize=(0.75,0.75), frameon=False) ax = axes([0.1, 0.1, 0.8, 0.8]) labels = 'Contract', 'Billable', 'Unbillable', 'Nonbill' billable=float(kw['billable']) contract=float(kw['contract']) unbillable=float(kw['unbillable']) nonbill=float(kw['nonbill']) fracs = [contract,billable, unbillable,nonbill] fig = pie(fracs, shadow=False, colors=('#70A0A0', '#C0F090','#C03030', '#FFFFFF')) fname = os.tmpnam() + ".png" savefig(fname) f=open(fname,'r') x=f.read() f.close() os.remove(fname) pylab.close() return (x)