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
|
From: Perry G. <pe...@st...> - 2004-04-23 16:45:30
|
> >>>>> "Kenneth" == Kenneth McDonald <kmm...@wi...> writes: > > Kenneth> 1) (Simple) Is there a defined behavior for matplotlib > Kenneth> when it attempts to graph data containing NaN values? > Kenneth> (OK, I admit-- it's really, really late, and I have tried > Kenneth> it to see what happens. But even that wouldn't tell me > Kenneth> if that was the _defined_ behavior :-)) > I guess the question I have is what would you expect to happen? My impression is that different people want to treat "missing" data different ways. I'd say it should be a mistake to try to plot NaNs. But taking the concept further, and generalizing these to missing values, I'd be open to plotting functions that accept masks if there was a common consensus as to what those functions should do with those masks. > No, it's not defined. I don't know that NaN is defined across > platforms in python. See my recent question on comp.lang.python > > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&thread m=mailman.141.1080681106.20120.python-list%40python.org&rnum=3&prev=/groups% > 3Fq%3Dtest%2Bnan%2Bgroup%253A*python*%26ie%3DUTF-8%26oe%3DUTF-8%26 > hl%3Den%26btnG%3DGoogle%2BSearch > > Perhaps Todd or Perry can comment on what the status of NaN vis-a-vis > Numeric and numarray. This has come up a number of times before, and > would be nice to be able to handle it. As always, these ease of use > features imply a performance cost that the typical user may not want > to pay.... > Todd has already explained that numarray can easily generate masks from NaNs or other ieee special values. > |
From: Engelsma, D. <D.E...@La...> - 2004-04-23 14:49:57
|
Hello - I''ve got a wxDialog where, among other controls, I have a wxList and a FigureCanvasWx. Depending on what single item is selected in the wxList, the FigureCanvasWx should show the appropriate graph. It's important that the matplotlib-generated graph stay in the dialog along with the other controls (I don't want to generate a separate frame for the graph). I don't want to have to recompute the graph using matplotlib to refresh the FigureCanvasWx if the user selects a different item in the List. Is there a way to generate the graphs, temporarily store the figures (without having to write them to the hard drive using savefig), and show the appropriate graph based upon the List selection? I thought about generating and saving the graphs to disk and then loading them in and using them as bitmaps in the wxDialog when needed - however, that doesn't seem very efficient as the program would have to access the disk and load the bitmap every time the list selection changed. If it helps, here's part of the code used in creating the FigureCanvasWx: def __init__(self, parent): self._init_ctrls(parent) # Create all other dialog controls self.fig = Figure((4.7,4), 75) self.canvas = FigureCanvasWx(self, -1, self.fig) self.canvas.SetPosition(wxPoint(480,400)) Thanks in advance, Dave Engelsma Lacks Wheel Trim Systems |
From: Todd M. <jm...@st...> - 2004-04-22 18:16:41
|
On Thu, 2004-04-22 at 06:11, Gary Ruben wrote: > I've installed 0.53 on my Win98 and Win2000 PCs and both suffer a problem which seems specific to the default Agg backend. It's an interoperability problem with trying to use TkAgg from the SciTE editor IDE or from an IDLE module window. As JDH suggested, TkAgg works (as far as I've tested anyway) with IDLE by using the -n flag when starting IDLE; I build -n into the shortcut for IDLE on my desktop. In general, TkAgg is known to work with: python idle -n IPython TkAgg is known not work with: SciTE pythonw Pythonwin idle Both of the latter shells fail with a RuntimeError "abnormal program termination". I checked on www.python.org about Tkinter and Pythonwin and they're known not to work together so that explains TkAgg on Pythonwin. http://www.python.org/topics/tkinter/trouble.html I also looked into SciTE a little and discovered that it is related to Scintilla which in turn was derived from Pythonwin. http://www.scintilla.org/ This indicates to me that the same problem with Tkinter may be affecting both (SciTE and Pythonwin)... but I am out on a limb. Regards, Todd -- Todd Miller <jm...@st...> |
From: Todd M. <jm...@st...> - 2004-04-22 16:57:32
|
On Thu, 2004-04-22 at 08:48, John Hunter wrote: > >>>>> "Kenneth" == Kenneth McDonald <kmm...@wi...> writes: > > Kenneth> 1) (Simple) Is there a defined behavior for matplotlib > Kenneth> when it attempts to graph data containing NaN values? > Kenneth> (OK, I admit-- it's really, really late, and I have tried > Kenneth> it to see what happens. But even that wouldn't tell me > Kenneth> if that was the _defined_ behavior :-)) > > No, it's not defined. I don't know that NaN is defined across > platforms in python. See my recent question on comp.lang.python > > http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=mailman.141.1080681106.20120.python-list%40python.org&rnum=3&prev=/groups%3Fq%3Dtest%2Bnan%2Bgroup%253A*python*%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch > > Perhaps Todd or Perry can comment on what the status of NaN vis-a-vis > Numeric and numarray. I'm not aware of any functionality in Numeric for dealing with IEEE special values. (Looking in the Numeric manual suggests that problems with these values lead to the development of the Masked Array capability as an alternative.) Lack of support for IEEE special values in Numeric makes it difficult to provide a unified approach in matplotlib. numarray has a module (ieeespecial) for dealing with different IEEE special values, including NaN. In numarray.ieeespecial are functions for identifying the locations of and setting IEEE special values to some other value. My thought was that you could use these functions in your own code to define whatever behavior you want. This is perhaps more work than is convenient but has the advantage that you can do it now yourself. Regards, Todd -- Todd Miller <jm...@st...> |
From: John H. <jdh...@ac...> - 2004-04-22 16:06:34
|
>>>>> "Yann" == Yann Le Du <yan...@no...> writes: Yann> So it looks as though you check for change in content, but Yann> not for change in size. Yep, you're right. mathtext does cache for efficiency and the fontsize key was not being used in the cache. This does not affect normal text, which does the caching properly. The good news it's a one-line-fix. In matplotlib.mathtext.math_parse_s, change the cacheKey to cacheKey = (s, dpi, fontsize) Thanks for the detailed report. JDH |
From: John H. <jdh...@ac...> - 2004-04-22 15:42:20
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@fi...> writes: Flavio> it worked in 0.5.2 Flavio> What is the problem? I implemented new tick locator in 0.53 which should provide nicer default tick locations as well as better user customization. I failed to test for the equal data limits case, which several people have already reported. This is fixed in CVS. Early next week, probably Monday, I will accumulate all the reported bugs and fixes into a 0.53.1 release, so please continue to let me know as you find them. Note if you actually want to see the result of your plot, you'll need to add a marker from matplotlib.matlab import * plot ([1], 'o') since otherwise you have a zero length line. JDH |
From: Yann Le Du <yan...@no...> - 2004-04-22 15:28:45
|
On Wed, 21 Apr 2004, John Hunter wrote: > >>>>> "Yann" == Yann Le Du <yan...@no...> writes: > > Yann> puts the text horizontally instead of vertically. > > See http://matplotlib.sourceforge.net/matplotlib.mathtext.html for a > list of known issues with mathtext. Short answer, it's on the list of > things to do. Ok, thanks > Yann> don't get any effect using fontsize : > > Fixed in matplotlib-0.53. What, you mean you haven't upgraded yet? > :-) I have indeed ! Always keen to upgrade fine software ! And here's what I found out (with probable solution at the end). I run python shell, then I do : from matplotlib.matlab import * plot([1,2,3,4]) xlabel(r'$\alpha > \beta$',fontsize=5) show() and then this figure pops up, and it works fine. Now I close the window and I do : xlabel(r'$\alpha > \beta$',fontsize=20) show() but nothing changes in the size of the x label. Now if I change the size AND the content, then it works fine : xlabel(r'$\alpha$',fontsize=20) show() This gives me a size 20 alpha. So it looks as though you check for change in content, but not for change in size. YLD |
From: Gerry W. <ge...@uc...> - 2004-04-22 15:07:25
|
I'm trying to run the first tutorial example in matplotlib-0.53 and am running into an ImportError. Here's the python script I'm trying to run: import matplotlib matplotlib.use('TkAgg') from matplotlib.matlab import * plot([1,2,3,4]) show() Here's the output I'm getting: light:gerry> python matplotlibtest.py Traceback (most recent call last): File "matplotlibtest.py", line 15, in ? from matplotlib.matlab import * File "/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/matlab.py", line 129, in ? from backends import new_figure_manager, error_msg, \ File "/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends/__init__.py", line 29, in ? from backend_tkagg import error_msg, draw_if_interactive, show, new_figure_manager File "/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends/backend_tkagg.py", line 8, in ? import tkagg # Paint image to Tk photo blitter extension File "/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends/tkagg.py", line 1, in ? import _tkagg ImportError: /d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends/_tkagg.so: undefined symbol: XFreePixmap Thanks for any help. --Gerry Wiener |
From: Al S. <a.d...@wo...> - 2004-04-22 14:50:07
|
I had been using multi-line ticklabels in my plots. They worked fine in in 0.52 (except for postscript output). Much to my dismay, I find that in 0.53 multi-line ticklabels do not work at all. The embedded '\n' shows up as a small box, and the lines run together. I hope that this will be fixed soon. Thanks. -Al Schapira |
From: Al S. <a.d...@wo...> - 2004-04-22 14:43:50
|
Thanks for all the great features in matplotlib 0.53. date_demo2.py with 0.53 looks normal initially. However, if you compress the scale by clicking the (-) Horizontal magnifier, the new date ticklabels that shift in from the right are horizontal, not vertical. I found that if you expand and then compress, the original ticklabels remain vertical, but the new ones (those not present in the original plot) shift in horizontal. Looks like the 'rotation' attribute of the additional ticklabels should have been copied from the original ones. -Al Schapira |
From: Gary R. <ga...@em...> - 2004-04-22 14:11:59
|
I shouldn't have jumped to conclusions. Agg seems OK. GTKAgg works from SciTE and IDLE just using show(). If I substitute this: manager = get_current_fig_manager() manager.window.show() raw_input('paused') then a window is opened but nothing is painted onto the canvas area from either IDLE or SciTE. It looks like GTKAgg might be the backend of choice for these environments. Gary ----- Original Message ----- From: John Hunter <jdh...@ac...> Date: Thu, 22 Apr 2004 08:09:52 -0500 To: "Gary Ruben" <ga...@em...> Subject: Re: [Matplotlib-users] Agg backend problem with 0.53 > >>>>> "Gary" == Gary Ruben <ga...@em...> writes: > > Gary> It's evidently something to do with threads and is probably > Gary> an inherent problem with Agg. I'm just bringing this to the > Gary> attention of others here who may be having similar > Gary> problems. Perhaps John knows what's going on and whether > Gary> anything can be done about it. The convenience of working in > Gary> SciTE For the moment, > > I would be very surprised if it's agg - I think it's a GUI conflict on > the Tk side. Todd is this related to the idle -n thingie? If so, > perhaps a FAQ and status report are warranted. > > Gary, since you say GTK is working, you may also want to check GTKAgg > which will help up narrow it down to Tk, and would rule out agg > problems. But since SciTE is GTK based, you probably need make sure > that matplotlib is not firing up it's own gtk mainloop, by not calling > 'show'. You can show your GTK figures manually if necessary by doing > > manager = get_current_fig_manager() > manager.window.show() > > This is a GTK specific call applicable only if the GTK mainloop is > already running (as I suspect it is in SciTE, which I haven't used), > It is probably a good idea to standardize the API here across GUIs to > handle exactly this case. > > The larger question is why would there be a GTK/Tk conflict? In any > case, let us know if you learn anything else. > > JDH > -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Eric J. <jo...@co...> - 2004-04-22 13:53:43
|
When compiling matplotlib on debian with : python setup.py install --home=/home/jonas/python I get an error message about not being able to find tk.h (appended below). This is with (I believe) all necessary tk libraries installed. When I set CPATH=/usr/include/tcl8.4 and then try, it compiles just fine. Is there any way we could make the tk-finding code a bit smarter so it would work out of the box on debian? Thanks for such an amazing plotting package -- at last, I might be able to ditch matlab! ...Eric [full error below] running install running build running build_py running build_ext building 'matplotlib.backends._tkagg' extension gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPI C -I/usr/lib/tcl8.4/../../include -I/usr/include -Isrc -Iagg2/include -I/usr/inc lude -I/usr/lib/tcl8.4/../../include/freetype2 -I/usr/include/freetype2 -Isrc/fr eetype2 -Iagg2/include/freetype2 -I/usr/include/freetype2 -I/usr/include/python2 .3 -c src/_tkagg.cpp -o build/temp.linux-i686-2.3/src/_tkagg.o src/_tkagg.cpp:20:19: tk.h: No such file or directory src/_tkagg.cpp:28: error: syntax error before `*' token src/_tkagg.cpp:32: error: `ClientData' was not declared in this scope src/_tkagg.cpp:32: error: parse error before `,' token src/_tkagg.cpp: In function `int PyAggImagePhoto(...)': src/_tkagg.cpp:35: error: `Tk_PhotoHandle' undeclared (first use this function) src/_tkagg.cpp:35: error: (Each undeclared identifier is reported only once for each function it appears in.) src/_tkagg.cpp:35: error: parse error before `;' token src/_tkagg.cpp:36: error: `Tk_PhotoImageBlock' undeclared (first use this function) src/_tkagg.cpp:40: error: `argc' undeclared (first use this function) src/_tkagg.cpp:41: error: `interp' undeclared (first use this function) src/_tkagg.cpp:41: error: `argv' undeclared (first use this function) src/_tkagg.cpp:42: error: `Tcl_AppendResult' undeclared (first use this function) src/_tkagg.cpp:43: error: `TCL_ERROR' undeclared (first use this function) src/_tkagg.cpp:47: error: `photo' undeclared (first use this function) src/_tkagg.cpp:47: error: `Tk_FindPhoto' undeclared (first use this function) src/_tkagg.cpp:65: error: `block' undeclared (first use this function) src/_tkagg.cpp:88: error: `Tk_PhotoBlank' undeclared (first use this function) src/_tkagg.cpp:90: error: `Tk_PhotoPutBlock' undeclared (first use this function) src/_tkagg.cpp:92: error: `TCL_OK' undeclared (first use this function) src/_tkagg.cpp: In function `PyObject* _tkinit(PyObject*, PyObject*)': src/_tkagg.cpp:108: error: `Tcl_Interp' undeclared (first use this function) src/_tkagg.cpp:117: error: parse error before `)' token src/_tkagg.cpp:122: error: 'struct TkappObject' has no member named 'interp' src/_tkagg.cpp:128: error: `Tcl_CmdProc' undeclared (first use this function) src/_tkagg.cpp:128: error: parse error before `)' token error: command 'gcc' failed with exit status 1 |
From: John H. <jdh...@ac...> - 2004-04-22 13:32:13
|
>>>>> "Gary" == Gary Ruben <ga...@em...> writes: Gary> It's evidently something to do with threads and is probably Gary> an inherent problem with Agg. I'm just bringing this to the Gary> attention of others here who may be having similar Gary> problems. Perhaps John knows what's going on and whether Gary> anything can be done about it. The convenience of working in Gary> SciTE For the moment, I would be very surprised if it's agg - I think it's a GUI conflict on the Tk side. Todd is this related to the idle -n thingie? If so, perhaps a FAQ and status report are warranted. Gary, since you say GTK is working, you may also want to check GTKAgg which will help up narrow it down to Tk, and would rule out agg problems. But since SciTE is GTK based, you probably need make sure that matplotlib is not firing up it's own gtk mainloop, by not calling 'show'. You can show your GTK figures manually if necessary by doing manager = get_current_fig_manager() manager.window.show() This is a GTK specific call applicable only if the GTK mainloop is already running (as I suspect it is in SciTE, which I haven't used), It is probably a good idea to standardize the API here across GUIs to handle exactly this case. The larger question is why would there be a GTK/Tk conflict? In any case, let us know if you learn anything else. JDH |
From: John H. <jdh...@ac...> - 2004-04-22 13:10:40
|
>>>>> "Kenneth" == Kenneth McDonald <kmm...@wi...> writes: Kenneth> 1) (Simple) Is there a defined behavior for matplotlib Kenneth> when it attempts to graph data containing NaN values? Kenneth> (OK, I admit-- it's really, really late, and I have tried Kenneth> it to see what happens. But even that wouldn't tell me Kenneth> if that was the _defined_ behavior :-)) No, it's not defined. I don't know that NaN is defined across platforms in python. See my recent question on comp.lang.python http://groups.google.com/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=mailman.141.1080681106.20120.python-list%40python.org&rnum=3&prev=/groups%3Fq%3Dtest%2Bnan%2Bgroup%253A*python*%26ie%3DUTF-8%26oe%3DUTF-8%26hl%3Den%26btnG%3DGoogle%2BSearch Perhaps Todd or Perry can comment on what the status of NaN vis-a-vis Numeric and numarray. This has come up a number of times before, and would be nice to be able to handle it. As always, these ease of use features imply a performance cost that the typical user may not want to pay.... Kenneth> 2) I expect to be using matplotlib quite a bit in the Kenneth> future, and will likely be using it in a more Kenneth> object-oriented mode (i.e. not through the matlab-style Kenneth> interface), since that's what I like better. I haven't Kenneth> seen any "howto" documents for using the OO API. Do any Kenneth> exist? I'd be happy to make notes and write a tutorial as Kenneth> I learn, but don't want to duplicate work that already Kenneth> exists. I wrote a little example which I'll include below. The pure OO API is not really designed to be too user friendly. Eg to instantiate a line, you do vline = Line2D( dpi, bbox, xdata=x, ydata=y, color=color, antialiased=False, # no need to antialias vert lines transx = ax.xaxis.transData, transy = ax.yaxis.transData) It's useful if you want to have total control of the lines transformations, bounding boxes and so on, but is overkill for making most plots. Likewise, instantiating your own Axes and Figures requires a extra overhead. This is addressed more in the example below, which recommends a hybrid approach. If you want to take some of this and extend it into a guide of sorts, that would be great. If what you are looking for is a developer's guide which describes the process of Figure, Axes, Line2D, Text, etc, creation and how to use them together, that doesn't exist yet. However, matplotlib is undergoing rapid development and changes. One nice thing about having people use the matlab interface is that it frees me to refactor the OO API. There have been several major refactorings to date. If a lot of people are using this API, and it's documented, it is more difficult to change. I am not totally happy with the current design (eg it us cumbersome to have to pass all those objects just to create a line) so for now I prefer not to have too many people creating lots of code with the OO API. I think the overall design is stable (Figures contain Axes which contain Text, Axis and Lines, etc) but some of the constructor signatures may change. The hybrid approach I recommend below keeps you safely at the interface level and insulated from any API changes, which can be painful for application developers. It does, however, enable you to write more pythonic code. Here is the new examples/pythonic_matplotlib.py: """ Some people prefer to use the python object oriented face rather than the matlab interface to matplotlib. This example show you how. Unless you are an application developer, I recommend using part of the matlab interface, particularly the figure, close, subplot, axes, and show commands. These hide a lot of complexity from you that you don't need to see in normal figure creation, like instantiating DPI instances, managing the bounding boxes of the figure elements, creating and reaslizing GUI windows and embedding figures in them. If you are an application developer and want to embed matplotlib in your application, follow the lead of examples/embedding_in_wx.py, examples/embedding_in_gtk.py or examples/embedding_in_tk.py. In this case you will want to control the creation of all your figures, embedding them in application windows, etc. If you seen an example in the examples dir written in matlab interface, and you want to emulate that using the true python method calls, there is an easy mapping. Many of those examples use 'set' to control figure properties. Here's how to map those commands onto instance methods The syntax of set is set(object or sequence, somestring, attribute) if called with an object, set calls object.set_somestring(attribute) if called with a sequence, set does for object in sequence: object.set_somestring(attribute) So for your example, if a is your axes object, you can do a.set_xticklabels([]) a.set_yticklabels([]) a.set_xticks([]) a.set_yticks([]) """ from matplotlib.matlab import figure, close, axes, subplot, show from matplotlib.numerix import arange, sin, pi t = arange(0.0, 1.0, 0.01) fig = figure(1) ax1 = subplot(211) ax1.plot(t, sin(2*pi*t)) ax1.grid(True) ax1.set_ylim( (-2,2) ) ax1.set_ylabel('1 Hz') ax1.set_title('A sine wave or two') for label in ax1.get_xticklabels(): label.set_color('r') ax2 = subplot(212) ax2.plot(t, sin(2*2*pi*t)) ax2.grid(True) ax2.set_ylim( (-2,2) ) l = ax2.set_xlabel('Hi mom') l.set_color('g') l.set_fontsize(15) show() |
From: Gary R. <ga...@em...> - 2004-04-22 10:40:29
|
Just a little follow-up point. The normal axis autoscaling, with "plot(t, s, 'b-')" commented out, doesn't take account of the errorbar extrema. That is, the errorbars extend beyond the autoscaled window, whereas the window should be scaled to fully contain the errorbars. ----- Original Message ----- From: "Gary Ruben" <ga...@em...> Date: Thu, 22 Apr 2004 20:19:10 +1000 To: mat...@li... Subject: [Matplotlib-users] axis scaling anomaly > Here's an example of my attempt to plot errorbar data with a series line of a different colour. This example reveals an anomaly with the axis scaling which may the sign of an underlying bug. If you comment out the "plot(t, s, 'b-')" line and run the example, the axes autoscale. If you run the example as is, the scaling changes for some reason. > Gary Ruben > : > > > from matplotlib.matlab import * > > t = arange(0.1, 4, 0.1) > s = exp(-t) > e = 0.1*randn(len(s)) > f = 0.1*randn(len(s)) > > grid(1) > lines = errorbar(t, s, e, f, '.', capsize=4) > set(lines, 'color', 'g') > plot(t, s, 'b-') > xlabel('Distance (m)') > ylabel('Height (m)') > title('Mean and standard error as a function of distance') > show() -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Gary R. <ga...@em...> - 2004-04-22 10:19:26
|
Here's an example of my attempt to plot errorbar data with a series line of a different colour. This example reveals an anomaly with the axis scaling which may the sign of an underlying bug. If you comment out the "plot(t, s, 'b-')" line and run the example, the axes autoscale. If you run the example as is, the scaling changes for some reason. Gary Ruben : from matplotlib.matlab import * t = arange(0.1, 4, 0.1) s = exp(-t) e = 0.1*randn(len(s)) f = 0.1*randn(len(s)) grid(1) lines = errorbar(t, s, e, f, '.', capsize=4) set(lines, 'color', 'g') plot(t, s, 'b-') xlabel('Distance (m)') ylabel('Height (m)') title('Mean and standard error as a function of distance') show() -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Gary R. <ga...@em...> - 2004-04-22 10:12:29
|
I've installed 0.53 on my Win98 and Win2000 PCs and both suffer a problem which seems specific to the default Agg backend. It's an interoperability problem with trying to use TkAgg from the SciTE editor IDE or from an IDLE module window. If I use the TkAgg backend from a DOS window, it works OK. Also, if I change the backend to GTK, all is well from all environments. Here is the output if I run an example from SciTE under Win98. Win2000 fails similarly. >pythonw -u errorbar_demo.pyw Fatal Python error: PyEval_RestoreThread: NULL tstate >Process failed to respond; forcing abrupt termination...>Exit code: 0 It's evidently something to do with threads and is probably an inherent problem with Agg. I'm just bringing this to the attention of others here who may be having similar problems. Perhaps John knows what's going on and whether anything can be done about it. The convenience of working in SciTE For the moment, Gary Ruben -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: Kenneth M. <kmm...@wi...> - 2004-04-22 08:41:30
|
1) (Simple) Is there a defined behavior for matplotlib when it attempts to graph data containing NaN values? (OK, I admit-- it's really, really late, and I have tried it to see what happens. But even that wouldn't tell me if that was the _defined_ behavior :-)) 2) I expect to be using matplotlib quite a bit in the future, and will likely be using it in a more object-oriented mode (i.e. not through the matlab-style interface), since that's what I like better. I haven't seen any "howto" documents for using the OO API. Do any exist? I'd be happy to make notes and write a tutorial as I learn, but don't want to duplicate work that already exists. Thanks, Ken |
From: John H. <jdh...@ac...> - 2004-04-21 22:56:27
|
>>>>> "Yann" == Yann Le Du <yan...@no...> writes: Yann> puts the text horizontally instead of vertically. See http://matplotlib.sourceforge.net/matplotlib.mathtext.html for a list of known issues with mathtext. Short answer, it's on the list of things to do. Yann> don't get any effect using fontsize : Fixed in matplotlib-0.53. What, you mean you haven't upgraded yet? :-) JDH |
From: John H. <jdh...@ac...> - 2004-04-21 22:51:46
|
>>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes: Peter> Hi: I attach a pcolor plot. I would like to get rid of the Peter> areas outside the larger circle and inside the smaller Peter> circle. Ideally I would like them to be white. Currently I Peter> create my plot using pcolor and then plot *lots* of white Peter> circles (for the inside) and lines (for the outside) on Peter> top, to get rid of the unwanted areas. This works but I Peter> wonder whether there is a better/faster solution. I would Peter> imagine I could set the values corresponding to the Peter> unwanted areas to some particular color before I call Peter> pcolor, but the issue is that I want those ares to be white Peter> (or other color not included in the standard palette which Peter> is used for plotting the area inside the annulus). Can this Peter> be done? Inside the circle is easy - just set the facecolor of the circle to be white 'w', or whatever rgb tuple you want. How are you creating the circles, with plot, scatter, or instantiating your own Circle instances? Outside the circle requires implementing general clipping, which will be done but I can't say how soon right now. What backend are you using? The circles don't look antialiased so I'm guessing not agg. agg and postscript are probably the best bets for getting general clipping support first. Another question: is there a reason you are using pcolor rather than imshow? imshow will give you the same result with interpolation and dramatic performance benefits. Since you aren't using faceted shading or otherwise tweaking the pcolor rectangles, you don't gain anything by using pcolor unless you need a backend that doesn't support imshow yet (gd?) Peter> Another question is in regards to showing tics in pcolor Peter> plots. In my "legend" on the right, I would like them to be Peter> visible, but they get overwritten. I suppose I could plot Peter> each manually after I do pcolor; is it how this is meant to Peter> be done? This is an easy fix. Basically you just need to move the axis drawing to the end of the axes drawing code. Currently it is done before any before any lines or patches are drawn. Try replacing matplotlib.Axes._draw with the code below. I'll make a deal: if you contribute some code to produce the nice color legend you made, I'll try and implement general clipping! JDH def _draw(self, renderer, *args, **kwargs): "Draw everything (plot lines, axes, labels)" if not ( self.xaxis.viewlim.defined() and self.yaxis.viewlim.defined() ): self.update_viewlim() if self.axison: if self._frameon: self._axesPatch.draw(renderer) if self._image is not None: self._image.draw(renderer) for p in self._patches: p.draw(renderer) for line in self._lines: line.draw(renderer) for t in self._text: t.draw(renderer) self._title.draw(renderer) if 0: bbox_artist(self._title, renderer) # optional artists for a in self._artists: a.draw(renderer) if self._legend is not None: self._legend.draw(renderer) for table in self._tables: table.draw(renderer) if self.axison: self.xaxis.draw(renderer) self.yaxis.draw(renderer) |
From: Peter G. <pgr...@ge...> - 2004-04-21 22:13:31
|
Hi: I attach a pcolor plot. I would like to get rid of the areas outside the larger circle and inside the smaller circle. Ideally I would like them to be white. Currently I create my plot using pcolor and then plot *lots* of white circles (for the inside) and lines (for the outside) on top, to get rid of the unwanted areas. This works but I wonder whether there is a better/faster solution. I would imagine I could set the values corresponding to the unwanted areas to some particular color before I call pcolor, but the issue is that I want those ares to be white (or other color not included in the standard palette which is used for plotting the area inside the annulus). Can this be done? Another question is in regards to showing tics in pcolor plots. In my "legend" on the right, I would like them to be visible, but they get overwritten. I suppose I could plot each manually after I do pcolor; is it how this is meant to be done? Thanks -- Peter Groszkowski Gemini Observatory Tel: +1 808 974-2509 670 N. A'ohoku Place Fax: +1 808 935-9235 Hilo, Hawai'i 96720, USA |
From: Yann Le Du <yan...@no...> - 2004-04-21 22:10:10
|
Hello, I'm making simple plots with matplotlib, and I've tried the mathematical text stuff, but ylabel(r'$\alpha > \beta$') puts the text horizontally instead of vertically. Also, I don't get any effect using fontsize : xlabel(r'$\alpha > \beta$',fontsize=20) or xlabel(r'$\alpha > \beta$',fontsize=10) give the same thing. Thanks, YLD |
From: John H. <jdh...@ac...> - 2004-04-21 22:01:47
|
>>>>> "Eric" == <er...@jo...> writes: Eric> I am trying to output a large number of pictures to files. I Eric> don't know the correct usage of figure() in this case, so my Eric> program end up devouring memory continuously. I tried to use Eric> the clear() method or del, but neither works. Or I didn't Eric> use right. I just ran this test script on my system: from matplotlib.matlab import * i = 0 while 1: i+=1 print 'Figure', i figure(1) plot([1,2,3]) savefig('somefig') close(1) The critical thing is to call close, otherwise you won't free the resources (figures are managed by a dictionary so there is a reference to them behind the scenes). To be safest, I would just reuse figure(1) each time and issue close(1) at the end of the loop. However, there is a smallish memory leak even when used correctly. On my system I went from about 6% memory usage to 18% in generating 3300 figures. Tracking it down will be a top priority, so I'll hopefully have a fix soon. 99% likelihood it's either in agg or ft2font. How many figures are you generating and what kind of memory loss are you seeing? If you use the idiom above, does the situation improve? JDH |
From: Gerry W. <ge...@uc...> - 2004-04-21 21:50:23
|
Hi Todd, I changed the directory from matplotlib-0.53 and the problem with ft2font went away. Thanks, --Gerry Wiener Todd Miller wrote: >Hi Gerry, > >I just noticed a similar "failure" when I try to run matplotlib from the >root of the source tree, i.e. the directory matplotlib-0.53. I think >doing that (running from the root) causes Python to interpret the >matplotlib subdirectory (matplotlib-0.53/matplotlib) as a package and to >look for ft2font.so there rather than in site-packages/matplotlib. Try >cd'ing to some other directory. > >HTH, >Todd > > >On Wed, 2004-04-21 at 15:47, Gerry Wiener wrote: > > >>I'm trying to run the first example in the tutorial but am running into >>an import problem: >> >>ActivePython 2.3.2 Build 231 (ActiveState Corp.) based on >>Python 2.3.2 (#1, Nov 6 2003, 09:47:20) >>[GCC 2.96 20000731 (Red Hat Linux 7.3 2.96-113)] on linux2 >>Type "help", "copyright", "credits" or "license" for more information. >> >>> from matplotlib.matlab import * >>Traceback (most recent call last): >> File "<stdin>", line 1, in ? >> File "matplotlib/matlab.py", line 128, in ? >> from axes import Axes >> File "matplotlib/axes.py", line 10, in ? >> from axis import XTick, YTick, XAxis, YAxis >> File "matplotlib/axis.py", line 22, in ? >> from font_manager import FontProperties >> File "matplotlib/font_manager.py", line 38, in ? >> from matplotlib import ft2font >>ImportError: cannot import name ft2font >> >>I've built and installed the freetype2 library and the matplotlib >>installation cites: >> >>running install_lib >>copying build/lib.linux-i686-2.3/matplotlib/backends/_tkagg.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends >>copying build/lib.linux-i686-2.3/matplotlib/backends/_backend_agg.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib/backends >>copying build/lib.linux-i686-2.3/matplotlib/ft2font.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib >>copying build/lib.linux-i686-2.3/matplotlib/_image.so -> >>/d2/gerry/local/ActivePython-2.3/lib/python2.3/site-packages/matplotlib >> >>Not sure what's going wrong. Please respond to my email as well since >>I'm not a subscriber to the email list. >> >>Thanks, >> >>Gerry Wiener >> >> >>------------------------------------------------------- >>This SF.Net email is sponsored by: IBM Linux Tutorials >>Free Linux tutorial presented by Daniel Robbins, President and CEO of >>GenToo technologies. Learn everything from fundamentals to system >>administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >>_______________________________________________ >>Matplotlib-users mailing list >>Mat...@li... >>https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> |
From: John H. <jdh...@ac...> - 2004-04-21 21:38:52
|
>>>>> "Todd" == Todd Miller <jm...@st...> writes: Todd> Hi Gerry, I just noticed a similar "failure" when I try to Todd> run matplotlib from the root of the source tree, i.e. the Todd> directory matplotlib-0.53. I think doing that (running from Todd> the root) causes Python to interpret the matplotlib Todd> subdirectory (matplotlib-0.53/matplotlib) as a package and Todd> to look for ft2font.so there rather than in Todd> site-packages/matplotlib. Try cd'ing to some other Todd> directory. Oh yes, that is the very likely culprit. It needs to be a FAQ. Good thinking! JDH |