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: Steve C. <ste...@ya...> - 2004-03-28 15:27:12
|
John, I'm having a problem running the barchart demo, it reports: $ python barchart_demo.py Traceback (most recent call last): File "barchart_demo.py", line 23, in ? legend( (p1[0], p2[0]), ('Men', 'Women') ) File "/usr/lib/python2.3/site-packages/matplotlib/matlab.py", line 765, in legend return gca().legend(*args, **kwargs) File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 972, in legend self._legend = Legend(self.dpi, self.bbox, lines, labels, loc) File "/usr/lib/python2.3/site-packages/matplotlib/legend.py", line 104, in __init__ self._texts = self._get_texts(labels, textleft, upper) File "/usr/lib/python2.3/site-packages/matplotlib/legend.py", line 206, in _get_texts transy = self.transy, TypeError: __init__() got an unexpected keyword argument 'fontsize' Regards, Steve |
From: John H. <jdh...@ac...> - 2004-03-26 13:50:24
|
>>>>> "Steve" == Steve Chaplin <ste...@ya...> writes: Steve> John, I'm having a problem with gridlines. I set axes.grid Steve> : True in my .matplotlibrc file Steve> But when I run examples/embedding_in_gtk.py and Steve> examples/simple_plot.py there are no gridlines. Oops, this was just an oversight. In matplotlib.axes.Axes.cla, change self._gridOn = False to self._gridOn = rcParams['axes.grid'] Should help; thanks for letting me know, JDH |
From: Steve C. <ste...@ya...> - 2004-03-26 12:41:47
|
John, I'm having a problem with gridlines. I set axes.grid : True in my .matplotlibrc file But when I run examples/embedding_in_gtk.py and examples/simple_plot.py there are no gridlines. Regards, Steve |
From: John H. <jdh...@ac...> - 2004-03-26 03:28:02
|
>>>>> "paulo" == paulo <phe...@eo...> writes: paulo> I am using the scatter plot of Matplotlib to plot the paulo> position of each particle. That works great, but when I try paulo> to assign different colors to each dot according to their paulo> concentration I find some problems. Although there is a big paulo> range of concentrations (colors) I can only see two in the paulo> plot. Is it possible to define more intervals to assign the paulo> colors? I think I did not understand the right way to paulo> define the c array intensities when I use the command: paulo> scatter(self, x, y, s=None, c) How should I generate that paulo> array? I looked at the example but I couldn't figure it paulo> out. Hi Paulo, It would help to see some code to let you know why your current approach isn't working. For now, all I can say is that c should be a len(x) Numeric array of concentrations. It might help for you to do hist(c, 100) to look at the distribution of concentrations. If the distribution is bimodal and strongly peaked, this may explain why you only see two colors. As for your question about defining more colors, the default is to use a colormap of 1000 colors, which should be an ample number to see a range unless something funny is going on with your c array. When you post some code, also post the first few entries of c, eg c[:10]. JDH |
From: John H. <jdh...@ac...> - 2004-03-26 03:22:07
|
>>>>> "Kirk" == Kirk Lamont <k.l...@us...> writes: Kirk> Hey. We are using Matplotlib with Python and C to create Kirk> run time graphs. However, we are having trouble figuring Kirk> out how to get the axes to show up in scientific notation. Kirk> If anyone have some info it would be very much appreciated. Kirk> Thanks If I understand you correctly, you want to use notation like 1.0e-6 on the x and/or y axis tick labels. Is this correct? Having more automated tick labelers is something that has been discussed and will be added in the not-too-distant future. In the mean time you can control them directly ax = subplot(111) plot([1,2,3]) xticks = ax.get_xticks() labels = [ '%1.0e'%val for val in xticks ] ax.set_xticklabels(labels) or you may want to define your own ticks xticks = [1e-6, 2e-6, 3e-6, 4e-6] ax.set_xticks(xticks) labels = [ '%1.0e'%val for val in xticks ] ax.set_xticklabels(labels) Hope this helps, John Hunter |
From: John H. <jdh...@ac...> - 2004-03-25 21:59:42
|
>>>>> "Engelsma," == Engelsma, Dave <D.E...@La...> writes: Engelsma,> Any ideas? The following script, all negative data, works fine for me: from matplotlib.matlab import * x = randn(1000)-10 hist(x, 10) show() Make sure this example works for you (if not upgrade matplotlib), and then go back to your example. Take out all the customization stuff after the call to n, bins, patches = matplotlib.matlab.hist(histogram_data, 10, normed=0) and see if that works. If so, slowly add things back until you find out what is wrong. If it's a matplotlib error rather than an error on your side, let me know. JDH |
From: Engelsma, D. <D.E...@La...> - 2004-03-25 21:51:07
|
Hello - I'm creating a histogram with a negative data values (30 values between -1.5 and -0.5). The histogram is created, however the data is plotted as if the values were forced positive (i.e. forced to absolute values). I've checked exactly what data is being passed to the hist function and the data goes in as a series of negative values. The Python code: # Generate chart using matplotlib library histogram_data = array.array('f') histogram_data.fromlist(DimensionData) overall_range = max(DimensionData) - min(DimensionData) x_lowest = min(DimensionData) - (2*overall_range) x_highest = max(DimensionData) + (2*overall_range) # the histogram of the data n, bins, patches = matplotlib.matlab.hist(histogram_data, 10, normed=0) histogram = matplotlib.matlab.subplot(111) # add a 'best fit' line y = matplotlib.mlab.normpdf(bins, SC.meanVal, SC.stdDev) lines = histogram.plot(bins, y, 'r-') for line in lines: line.set_linewidth(1) # plot lines on histogram indicating upper & lower control limits along with # nominal dimension. histogram.set_xlim([x_lowest, x_highest]) histogram.plot([SC.LCL,SC.LCL],[0,max(n)],'b--') histogram.plot([SC.Nom,SC.Nom],[0,max(n)],'g--') histogram.plot([SC.UCL,SC.UCL],[0,max(n)],'r--') # Set axis labels histogram.set_xlabel(DataDesc) histogram.set_ylabel('Number of Parts') # Setup strings for chart legend LegUCL = "UCL: " + str(SC.UCL) LegNom = "Nominal: " + str(SC.Nom) LegLCL = "LCL: " + str(SC.LCL) histogram.legend(["Curve", LegLCL, LegNom, LegUCL],fontsize = 10) histogram.set_xlim([x_lowest, x_highest]) #matplotlib.matlab.savefig(filePath) matplotlib.matlab.show() matplotlib.matlab.close() Any ideas? Thanks in advance, Dave Engelsma Lacks Wheel Trim Systems |
From: Kirk L. <k.l...@us...> - 2004-03-25 19:43:45
|
Hey. We are using Matplotlib with Python and C to create run time graphs. However, we are having trouble figuring out how to get the axes to show up in scientific notation. If anyone have some info it would be very much appreciated. Thanks |
From: paulo <phe...@eo...> - 2004-03-25 19:09:46
|
Hi, I am simulating the movement of some particles that carry some concentration of different species. Those concentrations change in time and space and I would like to be able to see their distribution in space. I am using the scatter plot of Matplotlib to plot the position of each particle. That works great, but when I try to assign different colors to each dot according to their concentration I find some problems. Although there is a big range of concentrations (colors) I can only see two in the plot. Is it possible to define more intervals to assign the colors? I think I did not understand the right way to define the c array intensities when I use the command: scatter(self, x, y, s=None, c) How should I generate that array? I looked at the example but I couldn't figure it out. Thanks for your help, I look forward to see the future versions of Matplotlib. So far, it looks very good. Paulo. |
From: Vincent B. <bo...@cl...> - 2004-03-23 15:37:28
|
Hi. Chaco is also included in SciPy, which is a really interesting scientific computing package. And I do agree with Mr. Coelho that Matplotlib is more flexible (yet as far as I know, Chaco offers 3D plotting as well). Have you been in contact with the Scipy team? Another idea. See you Vincent Flavio Codeco Coelho wrote: > HI everybody, > > I dont know if any of you is aware of the boa-constructor python IDE > and wx gui builder. > > I use it and subscribe to its mailing list. Recently, there was this > discussion about having some scientific plotting controls added to > Boa. I include below, a message from Boa's main developer, Ryaan > Booysen, where he gives some pointers to anyone that might be > interested in adding plotting controls to Boa. They are talking about > Chaco, but as far as I know, Chaco development is stalled and > Matplotlib is far superior (IMHO). > > I believe that if anyone is interested in doing that should contact > Ryaan. He is a very nice guy. I also believe that it would greatly > improve the visibility of matplotlib since Boa has a very large user base. > > Well, its just an idea. > > have fun > > Flavio > > > > -----Forwarded Message----- > >*From:* Riaan Booysen <riaan@e.co.za> >*To:* Ricardo Henriques <pax...@sa...> >*Cc:* boa...@li... <boa...@li...> >*Subject:* Re: [Boa Constr] Fw: Any Chaco plugins? >*Date:* Tue, 09 Mar 2004 13:33:00 +0200 > >Hi Ricardo, > >Ricardo Henriques wrote: >> Hi... >> I sucessfully used Boa to help me build scientific applications. I normally >> use wxPyPlot to plot graphics witch has a plug-in for Boa, it is quite >> alright, but sometimes I nead a plotting library with more features like >> Chaco found at _www.scipy.org_ <http://www.scipy.org> . Anyone knows any plug-in for this plotting >> library or any other than wxPyPlot? >> Where can I get some information about how to build a plug-in for Boa? >> Tks... > >You may look at the examples for adding a control in >Plug-ins/UserCompanions.py > >I suggest you first try to use the Custom Classes feature to >use a Chaco Plot window in the Designer. >See Docs/boa/apphelp/MixingSource.html >This might be a simpler option. > >Cheers, >Riaan. > > > >------------------------------------------------------- >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_ <http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click> >_______________________________________________ >Boa-constructor-users mailing list >Boa...@li... >_https://lists.sourceforge.net/lists/listinfo/boa-constructor-users_ > > |
From: Steve C. <ste...@ya...> - 2004-03-22 16:44:47
|
I had a look at backend_gtk.py and noticed that the toolbar code could be simplified. Instead of iconw = gtk.Image() iconw.set_from_stock(gtk.STOCK_GO_BACK, iconSize) you could do two steps in one with iconw = gtk.image_new_from_stock(gtk.STOCK_GO_BACK, iconSize) The pygtk Changelog says that gtk.image_new_from_stock() has been available since 1.99.5. Regards Steve |
From: Jean-Baptiste C. <Jea...@de...> - 2004-03-21 19:50:32
|
S=E6l ! Thanks for the tip, but I do not want to use the lagrangian: I want many sm= all polynoms, not 1 What I want to do is very typical in Finite Element Method eventhough this = is not the case here. I just want to define many small polynoms between consecutives points. Each one is stsifying the continuity of the value as well as the derivative if I define my function as f(x)=3Dax*x+bx+c At my points (X0,Y0) (X1,Y1) as well at teh derivative a X0 to be Z0 I get = the follwoing f(X0)=3DY0=3Da*X0*X0+b*X0+c f(X1)=3DY1=3Da*X1*X1+b*X1+c f'(X0)=3DZ0=3D 2aX0+b After small manipulkation I can directly infere a,b,c This is a very simple but useful routine that I was hoping people would hav= e already written Actually it is much smoother with a cubic polynomial, but it is a bit more = complicated to implement Thanks anyway Jean-Baptiste On Fri, 19 Mar 2004 23:49:28 +1000 "Gary Ruben" <ga...@em...> wrote: > First, let me say, I don't know if there is code to do exactly what you w= ant but here are my thoughts. > It sounds to me like you're asking for Lagrange polynomial fitting routin= es. Googling for "lagrange polynomial python" does return some code here: <= http://www.stanford.edu/~sturdza/akimamod/akimamod.py> > Another possibility is the spline fitting routines in Scipy (scipy.interp= olate). These may be appropriate if what you're really after is just a way = to fit smooth functions through points. I've used the splrep and splev func= tions there successfully to fit spline functions through points. When I was= looking for curve fitting routines recently, I also came across some more = generalized curve fitting modules for Python but I can't recall where :-( I= think they were SWIG wrappers for a C library. > Also, look at this: > <http://www.scipy.org/site_content/remap?rmurl=3Dhttp%3A//www.scipy.net/p= ipermail/scipy-user/2003-August/001864.html> > HTH, > regards, > Gary >=20 > ----- Original Message ----- > From: Jean-Baptiste Cazier <Jea...@de...> > Date: Fri, 19 Mar 2004 11:49:21 +0000 > To: "Gary Ruben" <ga...@em...>, jdh...@ni... > Subject: Re: [Matplotlib-users] Polyfit >=20 > >=20 > > Thanks to both of you. It worked just fine > >=20 > > I will push my luck and ask if any of you knows of a module to fit a pi= ecewise polynomial to a list of (X,Y) points. > > something like=20 > > p=3Dpiece-wiseFit([1,2,5,7,8],[3,4,2,5,5],2)=20 > > would return [[A0,B0,C0],[A1,B1,C1}[A2,B2,C2},[A3,B3,C3]}, coefficients= for the 4 polynoms=20 > > A0+B0.X+C0.X.X > > A1+B1.X+C1.X.X > > A2+B2.X+C2.X.X > > A3+B2.X+C3.X.X > >=20 > > This is a classic and I expect the code to be written somewhere, eventh= ough I could not find it even when I "Feel lucky" with Google. > <snip> > --=20 > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm >=20 --=20 ----------------------------- Jea...@de... Department of Statistics deCODE genetics Sturlugata,8 570 2993 101 Reykjav=EDk |
From: Dominique O. <Dom...@po...> - 2004-03-19 22:23:45
|
John Hunter wrote: >>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes: > > > Dominique> Regarding my previous message on TeX labels, it would > Dominique> seem that having parentheses in there mix up the > Dominique> alignment. Not "regular" text, as i previously > Dominique> suggested. Your trick did it just fine. TeX titles and y-labels appear correctly now. Vertical y-labels are not an issue for me right now. Perhaps other users? > Dominique> A final comment, using gca().set_yticks( ... ) prints a > Dominique> large number of messages "<matplotlib.axis.YTick > Dominique> instance at ...>". There must be a print somethere. > > You're in interactive mode right? In a python shell > > >>>>2+2 > > 4 > >>>>x = 2+2 >>>> > > > > Ie, an expression which is not assigned to a name is printed in the > shell in interactive mode. set_ticks returns a list of tick labels to > allow you to do things like > > labels = gca().set_yticks(['a', 'b', 'c']) > set(labels, 'color', 'r') > > The point is, if you assign the return value of set_ticks a name, it > should no longer print to the shell. Ditto for other plot functions > that return a value. If this doesn't cure you, let me know. A > residual print is always a possibility. Well i agree with the above, but i wasn't in interactive mode. Moreover, gca().set_xticks doesn't print anything. Here is an example: >>> import matplotlib >>> matplotlib.use( 'TkAgg' ) >>> from matplotlib.matlab import * >>> x = [1,2,3,4] >>> y = [2,1,4,3] >>> plot(x,y) [<matplotlib.lines.Line2D instance at 0x01092B20>] >>> show() >>> gca().set_xticks( [1,2,3,4] ) >>> show() >>> gca().set_yticks( [1,2,3,4] ) [<matplotlib.axis.YTick instance at 0x010738A0>, <matplotlib.axis.YTick instance at 0x010793F0>, <matplotlib.axis.YTick instance at 0x01079F08>, <matplotlib.axis.YTick instance at 0x01076A58>] >>> show() The two set_[xy]ticks commands work fine. For some reason though, set_yticks outputs tick instances in the terminal. Cheers, Dominique |
From: John H. <jdh...@ac...> - 2004-03-19 15:05:06
|
>>>>> "Sajec," == Sajec, Mike TQO <ms...@tq...> writes: Mike> Hello, Is it possible to change the angle at which tick Mike> labels are displayed? I'm trying to avoid overlapping Mike> labels when the labels are somewhat long. Hi Mike, take a look at the FAQ "How do I make vertical xticklabels?" http://matplotlib.sourceforge.net/faq.html#ROTATETICKS and the general tutorial on working with text http://matplotlib.sourceforge.net/tutorial.html#text which shows how to set text properties. One of the properties is rotation, which can be applied to any text instance (title, ticklabel, xlabel, etc.) Rotation can be 'horizontal', 'vertical' or an angle in degrees. Not all backends support the latter, but the *Agg backends should and it would not be too much work to add this to PS and GD. Let me know if you need it. Safest for you if you need this across backends would be 'vertical'. JDH |
From: Gary R. <ga...@em...> - 2004-03-19 13:49:37
|
First, let me say, I don't know if there is code to do exactly what you want but here are my thoughts. It sounds to me like you're asking for Lagrange polynomial fitting routines. Googling for "lagrange polynomial python" does return some code here: <http://www.stanford.edu/~sturdza/akimamod/akimamod.py> Another possibility is the spline fitting routines in Scipy (scipy.interpolate). These may be appropriate if what you're really after is just a way to fit smooth functions through points. I've used the splrep and splev functions there successfully to fit spline functions through points. When I was looking for curve fitting routines recently, I also came across some more generalized curve fitting modules for Python but I can't recall where :-( I think they were SWIG wrappers for a C library. Also, look at this: <http://www.scipy.org/site_content/remap?rmurl=http%3A//www.scipy.net/pipermail/scipy-user/2003-August/001864.html> HTH, regards, Gary ----- Original Message ----- From: Jean-Baptiste Cazier <Jea...@de...> Date: Fri, 19 Mar 2004 11:49:21 +0000 To: "Gary Ruben" <ga...@em...>, jdh...@ni... Subject: Re: [Matplotlib-users] Polyfit > > Thanks to both of you. It worked just fine > > I will push my luck and ask if any of you knows of a module to fit a piecewise polynomial to a list of (X,Y) points. > something like > p=piece-wiseFit([1,2,5,7,8],[3,4,2,5,5],2) > would return [[A0,B0,C0],[A1,B1,C1}[A2,B2,C2},[A3,B3,C3]}, coefficients for the 4 polynoms > A0+B0.X+C0.X.X > A1+B1.X+C1.X.X > A2+B2.X+C2.X.X > A3+B2.X+C3.X.X > > This is a classic and I expect the code to be written somewhere, eventhough I could not find it even when I "Feel lucky" with Google. <snip> -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
From: John H. <jdh...@ac...> - 2004-03-19 13:01:12
|
>>>>> "Jeremy" == Jeremy O'Donoghue <je...@o-...> writes: Hi Jeremy! Jeremy> Hi John, I'm (slowly) getting around to doing all of the Jeremy> things needed to bring backend_wx up to date (as far as Jeremy> possible). backend_wxagg will arrive, but I'm trying to Jeremy> get some other things into backend_wx first, specifically: Good idea to port the stuff to backend_wx first .... Jeremy> - Support for images (which is turning out to be trickier Jeremy> than I thought) - Support for the object picker (which Jeremy> should be easy) - Support Mathtext Jeremy> The problem of Mathtext support is a superset of the image Jeremy> support problem. Jeremy> The approach which I'm looking at is to use wxImage, which Jeremy> has a fast method for loading data (wxImage.SetData()) - Jeremy> ths expects a C string of length width*height*3 (in format Jeremy> RGBRGBRGB...). Jeremy> Not sure what format im.as_str() returns as I can't find Jeremy> any documentation (the im parameter to Jeremy> RendererWx.draw_image() is an instance of Jeremy> matplotlib.image, I assume), so I'm stuck (or was a couple Jeremy> of nights ago). Thanks for letting me know about the doc problem. I updated the doc string with "The string is a numrows by numcols x 4 (RGBA) unsigned char buffer". The best place to look in the code for guidance is backend_gtk rows, cols, s = im.as_str() X = fromstring(s, UInt8) X.shape = cols, rows, 4 You'll want to lose the alpha channel presumably, unless wx supports it, something like RGB = X[:,:,:3] s = RGB.tostring() # to pass into the wx draw_rgb_from_buffer I can also provide an as RGB method in the image module if you want - see if the above works and if you are happy with the performance. If not, let me know. mathtext, while closely related, is a little more difficult. The image returned by as_str is an MxN array of alpha values (no color information). See backend_gtk again for guidance. In the example from backend_gtk below, rgb is an rgb tuple and pbpix is an MxNx4 RGB array. pbpix[:,:,0]=int(rgb[0]*255) pbpix[:,:,1]=int(rgb[1]*255) pbpix[:,:,2]=int(rgb[2]*255) pbpix[:,:,3]=Xs So each of the color elements in the RGBA array is constant and only the alpha value is varied with the return value of font as_str. If wx has no alpha channel, you'll have to do the blending yourself. If there is get_image_rect, you can get the background image background and manually blend the pixels. This is what I was doing in backend_gtk before Trevor Blackwell showed me how to use the dark, undocumented RGBA from numeric array support in pygtk. [If you just ignore alpha, eg, and just set RGB anywhere alpha>0, it will look like crap; I tried]. But if you can efficiently get the background image into a Numeric array, you can do the blending yourself w/o too much work. Easiest would be if wx supports rgba. Jeremy> As you say, writing wxAgg is really pretty Jeremy> straightforward, and it's on my (ever lengthening) ToDo Jeremy> list... At the moment I don't have anything in a usable Jeremy> state. When you get the image_as_rgb thing working, we could do a wxagg dry run by having backend agg provide image_as_rgb_str. My experience with GTK and image support is that this is surprisingly fast, and has acceptable interactive refresh rates while resizing etc. It shouldn't be the final solution for efficiency sake, but should be trivial to implement and wouldn't require any additional extension code. Basically you just remove the renderer and the GC and forward all the calls in the figure canvas to renderer agg, and then you could use the currently nonexistent agg.image_to_rgb_str to render the image to the wx canvas. Down the road if you want to blit from extension code, you could do class FigureCanvasWxAgg(FigureCanvasWX): def draw(self): """ Draw to the Agg backend and then copy the image to the wx canvas """ agg = self.switch_backends(FigureCanvasAgg) agg.draw() try: import _wxagg except ImportError: w, h, s = agg.renderer.image_as_rgb_str() wx.draw_rgb(s) else: _wxagg.blit(something, agg.something) which would be nice because it would support users who couldn't compile the additional extension code. I should look into doing something similar in GTKAgg :-) JDH |
From: Jean-Baptiste C. <Jea...@de...> - 2004-03-19 11:49:47
|
Thanks to both of you. It worked just fine I will push my luck and ask if any of you knows of a module to fit a piecew= ise polynomial to a list of (X,Y) points. something like=20 p=3Dpiece-wiseFit([1,2,5,7,8],[3,4,2,5,5],2)=20 would return [[A0,B0,C0],[A1,B1,C1}[A2,B2,C2},[A3,B3,C3]}, coefficients for= the 4 polynoms=20 A0+B0.X+C0.X.X A1+B1.X+C1.X.X A2+B2.X+C2.X.X A3+B2.X+C3.X.X This is a classic and I expect the code to be written somewhere, eventhough= I could not find it even when I "Feel lucky" with Google. Takk Kve=F0ja Jean-Baptiste On Fri, 19 Mar 2004 09:45:10 +1000 "Gary Ruben" <ga...@em...> wrote: > Hi Jean-Baptiste, > Your problem is that polyfit (and polyval) expect Numeric array arguments= , so you need to do: >=20 > >>> x=3Darray([1,2,3]) > >>> y=3Darray([1,2,1]) > >>> p=3Dpolyfit(x,y,2) > >>> p > array([-1., 4., -2.]) > >>> polyval(p,array([1,2,3])) > array([ 1., 2., 1.]) >=20 > Note that your example only has 3 points, so can fit a 2nd order polynomi= al exactly as I've done. > If you try to fit a 3rd order, the method polyfit is using seems to fail.= ie. > >>> p=3Dpolyfit(x,y,3) > >>> p > array([ 1.09375, -5.0625 , 7.125 , -2.875 ]) > >>> polyval(p,array([1,2,3])) > array([ 0.28125, -0.125 , 2.46875]) >=20 > ideally p would have been array([0., -1., 4., -2.]) so you'll have to be= careful. >=20 > Gary >=20 > ----- Original Message ----- > From: Jean-Baptiste Cazier <Jea...@de...> > Date: Thu, 18 Mar 2004 14:36:45 +0000 > To: mat...@li... > Subject: [Matplotlib-users] Polyfit >=20 > > S=E6ll=20 > >=20 > > One mroe question from me today :) > >=20 > > I have some trouble running polyfit with matplotlib-0.52 > > Can you please help me finding out what I do wrong=20 > > I give a list of x values and y values as well as the degree of the des= ired polynome. But all I get is the following error > >=20 > > >>> x=3D[1,2,3] > > >>> y=3D[1,2,1] > > >>> polyfit(x,y,3) > > Traceback (most recent call last): > > File "<<console>>", line 1, in ? > > File "/usr/lib/python2.2/site-packages/matplotlib/mlab.py", line 341,= in polyfit > > X =3D Matrix(vander(x, N+1)) > > File "/usr/lib/python2.2/site-packages/matplotlib/mlab.py", line 383,= in vander > > X =3D ones( (len(x),N), x.typecode()) > > AttributeError: 'list' object has no attribute 'typecode' > >=20 > >=20 > > Any idea ? > >=20 > > Thanks > >=20 > > Jean-Baptiste > >=20 > > --=20 > > ----------------------------- > > Jea...@de... > >=20 > > Department of Statistics > > deCODE genetics Sturlugata,8 > > 570 2993 101 Reykjav=EDk > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > 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_id638&op=3Dclick > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >=20 >=20 > --=20 > ___________________________________________________________ > Sign-up for Ads Free at Mail.com > http://promo.mail.com/adsfreejump.htm >=20 --=20 ----------------------------- Jea...@de... Department of Statistics deCODE genetics Sturlugata,8 570 2993 101 Reykjav=EDk |
From: Jeremy O'D. <je...@o-...> - 2004-03-19 11:41:52
|
Hi John, I'm (slowly) getting around to doing all of the things needed to bring backend_wx up to date (as far as possible). backend_wxagg will arrive, bu= t I'm trying to get some other things into backend_wx first, specifically: - Support for images (which is turning out to be trickier than I thought) - Support for the object picker (which should be easy) - Support Mathtext The problem of Mathtext support is a superset of the image support proble= m. The approach which I'm looking at is to use wxImage, which has a fast method for loading data (wxImage.SetData()) - ths expects a C string of length width*height*3 (in format RGBRGBRGB...). Not sure what format im.as_str() returns as I can't find any documentatio= n (the im parameter to RendererWx.draw_image() is an instance of matplotlib.image, I assume), so I'm stuck (or was a couple of nights ago)= . As you say, writing wxAgg is really pretty straightforward, and it's on m= y (ever lengthening) ToDo list... At the moment I don't have anything in a usable state. Regards Jeremy John Hunter said: >>>>>> "Flavio" =3D=3D Flavio Codeco Coelho <fcc...@ci...> >>>>>> writes: > > Flavio> Hi, I use matplotlib for a math modelling software. > > Flavio> I would like to create a figure, using the mathtext > Flavio> module, that would consist entirely of a list of > Flavio> equations. > > Flavio> This figure would be embedded in WX. > > Flavio> can anyone give me some pointer on how to get started? > > First port mathtext to wx <wink>. There are two ways to do this: > > * Write WXAgg: This is easier than you think. > > * Use the image_as_str method that ft2font provides to get a pixel > array from the math fonts and transfer them to the wx canvas using > the wx API. Something like draw_from_rgba. I don't know WX very > well. Is there a WX method that allows you to draw from a > character buffer or array? > > Jeremy earlier expressed some interest in WXAgg but I don't know what > the current status of that is. > > After that is done, we can move on to your question. Hint: see > examples/alignment_test.py for examples of laying out just text using > 0,1 coords. > > JDH > |
From: Sajec, M. T. <ms...@tq...> - 2004-03-19 02:01:15
|
Hello, Is it possible to change the angle at which tick labels are displayed? I'm trying to avoid overlapping labels when the labels are somewhat long. Thanks in advance, Mike |
From: John H. <jdh...@ac...> - 2004-03-18 23:38:40
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@ci...> writes: Flavio> Hi, I use matplotlib for a math modelling software. Flavio> I would like to create a figure, using the mathtext Flavio> module, that would consist entirely of a list of Flavio> equations. Flavio> This figure would be embedded in WX. Flavio> can anyone give me some pointer on how to get started? First port mathtext to wx <wink>. There are two ways to do this: * Write WXAgg: This is easier than you think. * Use the image_as_str method that ft2font provides to get a pixel array from the math fonts and transfer them to the wx canvas using the wx API. Something like draw_from_rgba. I don't know WX very well. Is there a WX method that allows you to draw from a character buffer or array? Jeremy earlier expressed some interest in WXAgg but I don't know what the current status of that is. After that is done, we can move on to your question. Hint: see examples/alignment_test.py for examples of laying out just text using 0,1 coords. JDH |
From: John H. <jdh...@ac...> - 2004-03-18 23:31:36
|
>>>>> "Jean-Baptiste" == Jean-Baptiste Cazier <Jea...@de...> writes: AttributeError: 'list' object has no attribute 'typecode' Hint: if you paste the error message into google and click "I'm Feeling Lucky", you'll get an answer to your question. But thanks for letting me know; I patched polyfit to convert lists to arrays with x = asarray(x) y = asarray(y) JDH |
From: John H. <jdh...@ac...> - 2004-03-18 23:28:20
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes: Dominique> Regarding my previous message on TeX labels, it would Dominique> seem that having parentheses in there mix up the Dominique> alignment. Not "regular" text, as i previously Dominique> suggested. This makes more sense. All the symbols that come from cmex10 (a TeX computer modern font) have some funny alignment that I have not been able to figure out properly and so I deal with them in some hackish ways that you have just experienced. Thanks for the report, because it lets me know where the hacks are failing. But your post gave me a better idea. Since parentheses are so common, and are defined in a number of the font files, I can use the parentheses from a font file that doesn't have this strange offset problem. Edit matplotlib.mathtext.py and comment out the following code and replace it with the code below it #'(' : ('cmex10.ttf', 'A1'), #r'\leftparen' : ('cmex10.ttf', 'A1'), #')' : ('cmex10.ttf', 'A2'), #r'\rightparen' : ('cmex10.ttf', 'A2'), #'[' : ('cmex10.ttf', 'A3'), #r'\leftbracket' : ('cmex10.ttf', 'A3'), #']' : ('cmex10.ttf', 'A4'), #r'\rightbracket' : ('cmex10.ttf', 'A4'), '(' : ('cmr10.ttf', '28'), r'\leftparen' : ('cmr10.ttf', '28'), ')' : ('cmr10.ttf', '29'), r'\rightparen' : ('cmr10.ttf', '29'), '[' : ('cmr10.ttf', '5B'), r'\leftbracket' : ('cmr10.ttf', '5B'), ']' : ('cmr10.ttf', '5D'), r'\rightbracket' : ('cmr10.ttf', '5D'), This takes the symbols (, ), [ and ] from computer modern roman rather than computer modern extensions and the alignment works perfectly. Note also that vertical alignment of mathtext (ylabels) is not yet supported. Feel free to bug me if this is an issue. I expect plenty more issues to crop up with mathtext since it is not widely tested and I am not Knuth so please let me know when you find them. The author of pyparsing has been helping me with the parsing problem that prevents x_i_j from parsing properly but I haven't been able to get to it yet. Dominique> A final comment, using gca().set_yticks( ... ) prints a Dominique> large number of messages "<matplotlib.axis.YTick Dominique> instance at ...>". There must be a print somethere. You're in interactive mode right? In a python shell >>> 2+2 4 >>> x = 2+2 >>> Ie, an expression which is not assigned to a name is printed in the shell in interactive mode. set_ticks returns a list of tick labels to allow you to do things like labels = gca().set_yticks(['a', 'b', 'c']) set(labels, 'color', 'r') The point is, if you assign the return value of set_ticks a name, it should no longer print to the shell. Ditto for other plot functions that return a value. If this doesn't cure you, let me know. A residual print is always a possibility. JDH |
From: Dominique O. <Dom...@po...> - 2004-03-18 22:51:55
|
Regarding my previous message on TeX labels, it would seem that having parentheses in there mix up the alignment. Not "regular" text, as i previously suggested. Dominique |
From: Dominique O. <Dom...@po...> - 2004-03-18 22:31:03
|
First of all, i am blown away by the last two releases. Congratulations. I love TkAgg and the new TeX capabilities. I have been feeling like a contour plot capability was missing from the current release. Since imshow is so much faster than pcolor, it would seem that it could do the job. How would you go about suppressing the colors altogether and plotting only the 'contours' (borders between different colors i guess)? If this is doable in a few commands, perhaps there could be a shortcut called 'contour', as in Matlab, to draw contour plots of a function of 2 variables? Titles appear differently when they contain TeX commands, depending on whether or not they also contain regular text. For instance: - title( r'$\rm{This is } \psi(\omega)$' ) appears nicely, although the spacing in the "regular" text looks unequal on my monitor. But: - title( r'$\psi(\omega)$' ) alone, shows only the top of the symbols \psi(\omega)---it looks like the box that contains the text is placed too low, behind the plot. Same happens with [xy]label. Surprisingly, xlabel( r'$\omega$' ) works fine. Also in the documentation for matplotlib.mathtext, are there dollar signs missing in the first example? In the documentation for imshow(), i guess 'ColorMap' should actually be 'Colormap' (lowercase m)?! I couldn't find any 'ColorMap'. A final comment, using gca().set_yticks( ... ) prints a large number of messages "<matplotlib.axis.YTick instance at ...>". There must be a print somethere. Great job! Dominique |
From: John H. <jdh...@ac...> - 2004-03-18 14:45:16
|
>>>>> "Jean-Baptiste" =3D=3D Jean-Baptiste Cazier <Jean-Baptiste.cazier@d= ecode.is> writes: Jean-Baptiste> S=E6ll ! Jean-Baptiste> I followed you advice to use directly axes to Jean-Baptiste> define my subplots fig =3D Figure(figsize=3D(8,4), Jean-Baptiste> dpi=3D100) #ax =3D Subplot(fig, 211) ax =3D Plot.axes([0.1,0.3,0.8,0.7]) fig.add_axis(ax) #mrks =3D Subplot(fig, 212) mrks =3D Plot.axes([0.1,0.1,0.8,0.15], axisbg=3D'c') fig.add_axis(mrks) "Plot" is not from matplotlib. Please post a complete working matplotlib example that replicates your problem and I'll take a look. It looks like you are mixing the matlab interface with the OO interface. axes is from matplotlib.matlab. If you want to use the OO interface, use =20 from matplotlib.figure import Figure =20 from matplotlib.axes import Axes, Subplot # etc, etc ax =3D Axes(fig, [0.1, 0.3, 0.8, 0.7]) fig.add_axis(ax) mrks =3D Axes(fig, [0.1, 0.1, 0.8, 0.15], axisbg=3D'c') fig.add_axis(mrks) JDH |