You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
|
Jul
|
Aug
(12) |
Sep
(12) |
Oct
(56) |
Nov
(65) |
Dec
(37) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(59) |
Feb
(78) |
Mar
(153) |
Apr
(205) |
May
(184) |
Jun
(123) |
Jul
(171) |
Aug
(156) |
Sep
(190) |
Oct
(120) |
Nov
(154) |
Dec
(223) |
2005 |
Jan
(184) |
Feb
(267) |
Mar
(214) |
Apr
(286) |
May
(320) |
Jun
(299) |
Jul
(348) |
Aug
(283) |
Sep
(355) |
Oct
(293) |
Nov
(232) |
Dec
(203) |
2006 |
Jan
(352) |
Feb
(358) |
Mar
(403) |
Apr
(313) |
May
(165) |
Jun
(281) |
Jul
(316) |
Aug
(228) |
Sep
(279) |
Oct
(243) |
Nov
(315) |
Dec
(345) |
2007 |
Jan
(260) |
Feb
(323) |
Mar
(340) |
Apr
(319) |
May
(290) |
Jun
(296) |
Jul
(221) |
Aug
(292) |
Sep
(242) |
Oct
(248) |
Nov
(242) |
Dec
(332) |
2008 |
Jan
(312) |
Feb
(359) |
Mar
(454) |
Apr
(287) |
May
(340) |
Jun
(450) |
Jul
(403) |
Aug
(324) |
Sep
(349) |
Oct
(385) |
Nov
(363) |
Dec
(437) |
2009 |
Jan
(500) |
Feb
(301) |
Mar
(409) |
Apr
(486) |
May
(545) |
Jun
(391) |
Jul
(518) |
Aug
(497) |
Sep
(492) |
Oct
(429) |
Nov
(357) |
Dec
(310) |
2010 |
Jan
(371) |
Feb
(657) |
Mar
(519) |
Apr
(432) |
May
(312) |
Jun
(416) |
Jul
(477) |
Aug
(386) |
Sep
(419) |
Oct
(435) |
Nov
(320) |
Dec
(202) |
2011 |
Jan
(321) |
Feb
(413) |
Mar
(299) |
Apr
(215) |
May
(284) |
Jun
(203) |
Jul
(207) |
Aug
(314) |
Sep
(321) |
Oct
(259) |
Nov
(347) |
Dec
(209) |
2012 |
Jan
(322) |
Feb
(414) |
Mar
(377) |
Apr
(179) |
May
(173) |
Jun
(234) |
Jul
(295) |
Aug
(239) |
Sep
(276) |
Oct
(355) |
Nov
(144) |
Dec
(108) |
2013 |
Jan
(170) |
Feb
(89) |
Mar
(204) |
Apr
(133) |
May
(142) |
Jun
(89) |
Jul
(160) |
Aug
(180) |
Sep
(69) |
Oct
(136) |
Nov
(83) |
Dec
(32) |
2014 |
Jan
(71) |
Feb
(90) |
Mar
(161) |
Apr
(117) |
May
(78) |
Jun
(94) |
Jul
(60) |
Aug
(83) |
Sep
(102) |
Oct
(132) |
Nov
(154) |
Dec
(96) |
2015 |
Jan
(45) |
Feb
(138) |
Mar
(176) |
Apr
(132) |
May
(119) |
Jun
(124) |
Jul
(77) |
Aug
(31) |
Sep
(34) |
Oct
(22) |
Nov
(23) |
Dec
(9) |
2016 |
Jan
(26) |
Feb
(17) |
Mar
(10) |
Apr
(8) |
May
(4) |
Jun
(8) |
Jul
(6) |
Aug
(5) |
Sep
(9) |
Oct
(4) |
Nov
|
Dec
|
2017 |
Jan
(5) |
Feb
(7) |
Mar
(1) |
Apr
(5) |
May
|
Jun
(3) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
|
|
1
(8) |
2
(4) |
3
(21) |
4
(23) |
5
(3) |
6
|
7
(8) |
8
(2) |
9
|
10
(6) |
11
(4) |
12
(6) |
13
(1) |
14
(9) |
15
(10) |
16
(11) |
17
(3) |
18
(10) |
19
(9) |
20
(2) |
21
(10) |
22
(16) |
23
(8) |
24
(6) |
25
(6) |
26
(3) |
27
(5) |
28
(1) |
29
(14) |
30
(5) |
31
(14) |
|
|
The colors come from the current colormap. You can go all out and make your own colormap and color based on index using your map. I don't know how to do that off the top of my head though. On 8/21/06, rich kowalczyk <ric...@gm...> wrote: > I understand that 3D plotting is not fully working yet, but I have a > question that might be answerable anyway. > > I can get a nice looking 3D plot of my data using > > surf = ax3d.plot_surface(x, y, z) > > but I can't control the colors used in the plot. I can do a > > surf.set_array(ColorArray) > > and the contents of the array (ColorArray) will be translated into > colors on the plot somehow, but the translation appears to be > arbitrary. Does anyone know how the translation is done, so that I > can assign a certain color to a certain part of the plot? > > Thanks, > Rich. > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
I understand that 3D plotting is not fully working yet, but I have a question that might be answerable anyway. I can get a nice looking 3D plot of my data using surf = ax3d.plot_surface(x, y, z) but I can't control the colors used in the plot. I can do a surf.set_array(ColorArray) and the contents of the array (ColorArray) will be translated into colors on the plot somehow, but the translation appears to be arbitrary. Does anyone know how the translation is done, so that I can assign a certain color to a certain part of the plot? Thanks, Rich.
Jim, Look at examples/image_masked.py. I think that is the only example with pointed ends, and I think it was present as-is in 0.87.3. Eric James Boyle wrote: > I am using matplotlib 0.87.3 > > The documentation of colorbar in color.py seems to indicate that one > should be able to create a color bar with pointed ends, the fill color > of the ends corresponding to the over and under colors. > > I have not been able to get this to work. I have set the > colormap.set_under and set_over values but no success. > > If this does work could someone (Eric?) post an example, of how it is > done. I feel that I am missing something simple. > > Thanks for any help. > > --Jim > > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I am using matplotlib 0.87.3 The documentation of colorbar in color.py seems to indicate that one should be able to create a color bar with pointed ends, the fill color of the ends corresponding to the over and under colors. I have not been able to get this to work. I have set the colormap.set_under and set_over values but no success. If this does work could someone (Eric?) post an example, of how it is done. I feel that I am missing something simple. Thanks for any help. --Jim
Hi, thanks for the link to the screen capture tool. I've been looking for something like it (similar to MS OneNote sort of), but haven't found one. The figure window by default has a button that allows you to save the image. As for your increased precision, I recently discovered Python's decimal package, http://www.python.org/dev/peps/pep-0327/ It allows you to specify arbitrary precision, and doesn't use hardware-based floating point representation. As far as I can tell, it manipulates digits like you would do it on paper, keeping as many digits as you tell it. Good luck! Michael -----Original Message----- From: mat...@li... [mailto:matplotlib- Incidentaly, I need to be able to find a way to increase the precision of Python but only while using an equation (or function?) that calculates gamma In Python, double precision is already used, how can a better precision be invoked for this code only? Can it be done by in-line code or is a function needed?
I am using the Navigation toolbars mode and I wonder if I should the attribute or if it can change in a future release ? The attribute I am talking about is defined in backend_bases.py in NavigationToolbar2 in the __init__() method: self.mode = '' # a mode string for the status bar The strings saved on the panning and zoom mode are kinda unconventional: self.mode = 'pan/zoom mode' or self.mode = 'Zoom to rect mode' Having the zoom word in both strings can be confusing, moreover they should start either with a lower case or upper case. Can't they just be "zoom" or "pan" ? Having just one word as a mode will remove confusion and make them easier to test when you are adding modes to the toolbar ... Just a suggestion. Daniel.
Jouni =20 I have now loaded and tried to use iPython. =20 In some cases the xyz? command gives useful output - in others, not. =20 So, if I have=20 ax =3D subplot(111) Then ax? returns a number of get_ & set_ functions that are available. So far, so good. But, if I try something like : In [9]: ax.set_xlim()? I get Object `ax.set_xlim()` not found. So, I cannot find out more about what setxlim() is meant to do, or how it works? What I did do was go and look at the class documentation on-line, and this info is available there. =20 You suggested: "The list you want is precisely the output of the getp command." But for the getp? , I get: Type: function Base Class: <type 'function'> String Form: <function getp at 0x00F67370> Namespace: Interactive File: c:\python24\lib\site-packages\matplotlib\artist.py Definition: getp(o, *args) Docstring: Return the value of handle property s =20 h is an instance of a class, eg a Line2D or an Axes or Text. if s is 'somename', this function returns o.get_somename() getp can be used to query all the gettable properties with getp(o) Many properties have aliases for shorter typing, eg 'lw' is an alias for 'linewidth'. In the output, aliases and full property names will be listed as property or alias =3D value eg linewidth or lw =3D 2 Example: plot(t,s) set(gca(), 'xlim', [0,10]) # set the x axis limits or plot(t,s) a =3D gca() a.set_xlim([0,10]) # does the same =20=20 (and gca? returns something along the same lines) =20 Which does *not* intuitively lead me to something like: xticklines =3D getp(gca(), 'xticklines') for example?? =20 So - the question is how to get to find the items I need to set - amongst others, I am still looking for something to=20 size the tick marks; setting those on the bottom X-axis to=20 a specific size, while disabling those on the top X-axis.=20=20 The matplotlabprc file has a clearly labelled line that=20 addresses part of this: =20 xtick.major.size : 2 # major tick size in points =20 but of course I would like to do this in code. I am sort of guessing this has something to do with the Tick class: http://matplotlib.sourceforge.net/matplotlib.axis.html#Tick=20 but I cannot seem to work with Tick() ?? =20 In addition, I cannot seem to see why some things work one way and others - seemingly in the "same family" - do not. For example: xticklabels =3D lab.getp(lab.gca(), 'xticklabels') works just fine, and allows you set the font size, color etc for the tick labels, whereas there is no: lab.getp(lab.gca(), 'ylabel') even though both appear to be dealing with a similar "thing" (a Text object)?? =20 *************** =20 I guess that, overall, I have been expecting matplotlib to have a simple "dot" notation throughout -=20 xaxis.xtick.major.size =3D 2 as this type of notation is readily easy to grasp and use,=20 but this preconception is blocking my grasp of how to use=20 the module 'as is'. =20 Again, apologies for the repetitive questions, and thanks for patience in answering them. =20 Derek >>> Jouni K Sepp=E4nen <jk...@ik...> 2006年08月21日 01:24 PM >>> Hi Derek, [Copying to matplotlib-users since an archive of this conversation=20=20 could be helpful to others in the future.] On 21.8.2006, at 13.34, Derek Hohls wrote: > Re the other suggestions you have made. While I appreciate the > "forming hypothesis" approach is good when venturing into the > unknown, it does seem a little strange when dealing with a known > item e.g. software. But it *is* unknown to the extent that the documentation is=20=20 lacking! :-) Also, I think that the plot-customization possibilities=20=20 of matplotlib are pretty nicely discoverable (once you know about=20=20 getp/setp), and even if the pdf manual listed everything, it would be=20=20 easier to use the introspective facilities than look things up in the=20=20 manual. > In your example below, you go from line [21] > getp(recs[0]) > to line[22] > setp(recs[0], 'facecolor') > > Now, how did you know that there was 'facecolor' property that > could be set? How would one get a list of all these properties? The list you want is precisely the output of the getp command. I=20=20 elided the output since it is quite long, but I guess I didn't make=20=20 it sufficiently clear. > The other issue is the colour: > colour=3D['red', 'green', 'blue']) > implies I would write: > colour=3D['125','125','250'] In hindsight, it was a bad idea on my part to make a barchart of=20=20 three bars and color them precisely red, green, and blue... let's try=20=20 again: In [11]:bar(arange(10), cos(arange(10)), color=3D=20 ['blanchedalmond', 'darkorchid', 'gainsboro', 'honeydew', 'hotpink',=20=20 'khaki', 'lavenderblush', 'mintcream', 'peachpuff', 'lemonchiffon']); So you can give a list of colors to make the bars different colors.=20=20 (The color names are from matplotlib.colors.cnames.) If you want to=20=20 make everything the same color, give just one color, not a list: In [12]:figure(); bar([0,1], [3,1], color=3D'lightcoral'); The syntax for shades of gray happens to be a string representing a=20=20 number from 0 to 1: In [13]:figure(); bar([0,1], [3,1], color=3D'0.9'); If you want every bar to have the color with components 125, 125, 250=20=20 on a scale of 0..255, use hex notation: In [14]:figure(); bar([0,1], [3,1], color=3D'#7d7dfa'); --=20 Jouni ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easi= er Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D1= 21642=20 _______________________________________________ Matplotlib-users mailing list Mat...@li...=20 https://lists.sourceforge.net/lists/listinfo/matplotlib-users=20 --=20 This message is subject to the CSIR's copyright, terms and conditions and e-mail legal notice. Views expressed herein do not necessarily represent the views of the CSIR. =20 CSIR E-mail Legal Notice http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html=20 =20 CSIR Copyright, Terms and Conditions http://mail.csir.co.za/CSIR_Copyright.html=20 =20 For electronic copies of the CSIR Copyright, Terms and Conditions and the C= SIR Legal Notice send a blank message with REQUEST LEGAL in the subject line to Cal...@cs.... This message has been scanned for viruses and dangerous content by MailScan= ner,=20 and is believed to be clean.
On Monday 21 August 2006 06:20, George Nurser wrote: > On 21/08/06, Jouni K Seppanen <jk...@ik...> wrote: > > "Derek Hohls" <DH...@cs...> writes: > > > It appears the manual (which I assume might be able to help me) is not > > > "downloadable". The link : > > > http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf > > > > For some reason, downloading this file fails quite often. > > I've had this problem too. On a 10.4.7 Mac, using Safari, I find that > a simple click on the link fails. > > On the other hand, right clicking (or with a 1 button mouse holding > down alt and clicking) and then releasing on > 'download linked file' from the drop down menu normally works. I dont have any trouble downloading, maybe there was a temporary problem with the sourceforge server. Darren
Hi Derek, [Copying to matplotlib-users since an archive of this conversation could be helpful to others in the future.] On 21.8.2006, at 13.34, Derek Hohls wrote: > Re the other suggestions you have made. While I appreciate the > "forming hypothesis" approach is good when venturing into the > unknown, it does seem a little strange when dealing with a known > item e.g. software. But it *is* unknown to the extent that the documentation is lacking! :-) Also, I think that the plot-customization possibilities of matplotlib are pretty nicely discoverable (once you know about getp/setp), and even if the pdf manual listed everything, it would be easier to use the introspective facilities than look things up in the manual. > In your example below, you go from line [21] > getp(recs[0]) > to line[22] > setp(recs[0], 'facecolor') > > Now, how did you know that there was 'facecolor' property that > could be set? How would one get a list of all these properties? The list you want is precisely the output of the getp command. I elided the output since it is quite long, but I guess I didn't make it sufficiently clear. > The other issue is the colour: > colour=['red', 'green', 'blue']) > implies I would write: > colour=['125','125','250'] In hindsight, it was a bad idea on my part to make a barchart of three bars and color them precisely red, green, and blue... let's try again: In [11]:bar(arange(10), cos(arange(10)), color= ['blanchedalmond', 'darkorchid', 'gainsboro', 'honeydew', 'hotpink', 'khaki', 'lavenderblush', 'mintcream', 'peachpuff', 'lemonchiffon']); So you can give a list of colors to make the bars different colors. (The color names are from matplotlib.colors.cnames.) If you want to make everything the same color, give just one color, not a list: In [12]:figure(); bar([0,1], [3,1], color='lightcoral'); The syntax for shades of gray happens to be a string representing a number from 0 to 1: In [13]:figure(); bar([0,1], [3,1], color='0.9'); If you want every bar to have the color with components 125, 125, 250 on a scale of 0..255, use hex notation: In [14]:figure(); bar([0,1], [3,1], color='#7d7dfa'); -- Jouni
On 21/08/06, Jouni K Seppanen <jk...@ik...> wrote: > "Derek Hohls" <DH...@cs...> writes: > > > It appears the manual (which I assume might be able to help me) is not > > "downloadable". The link : > > http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf > > For some reason, downloading this file fails quite often. I've had this problem too. On a 10.4.7 Mac, using Safari, I find that a simple click on the link fails. On the other hand, right clicking (or with a 1 button mouse holding down alt and clicking) and then releasing on 'download linked file' from the drop down menu normally works. George.
"Derek Hohls" <DH...@cs...> writes: > It appears the manual (which I assume might be able to help me) is not > "downloadable". The link : > http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf For some reason, downloading this file fails quite often. Perhaps it should be distributed using the same sf.net download mechanism as the software itself? Try using some software that knows how to resume interrupted downloads. E.g., run curl -O -C - http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf as many times as needed to get the whole file. > http://www.scipy.org/Cookbook/Matplotlib/BarCharts > shows how to setup labels for a bar chart - but it would be great if > there was a line-by-line explanation of what each step means I think the best way to understand the examples is to start up "ipython -pylab", copy/paste the examples line by line, inspect the resulting objects, get help on the mysterious functions (e.g. type ?gca in ipython to find out what gca does), form hypotheses on what the various steps do, and test the hypotheses with experiments. > setting line widths, font sizes, bar colours etc bar returns a list of Rectangle objects: In [19]: bar([1,2,3], [4,5,6]) Out[19]: [<matplotlib.patches.Rectangle instance at 0x2aaab2f33290>, <matplotlib.patches.Rectangle instance at 0x2aaab2f33200>, <matplotlib.patches.Rectangle instance at 0x2aaab2f33248>] Capture these objects and use getp and setp on them: In [20]: recs = _ In [21]: getp(recs[0]) ... In [22]: setp(recs[0], 'facecolor') facecolor: any matplotlib color - see help(colors) In [23]: help(colors) ... In [24]: setp(recs[0], 'facecolor', 'red') Out[24]: [None] For font sizes you need to get a handle to the relevant Text objects. For axis texts, look at the object returned by gca(): In [36]: setp(getp(gca(), 'yticklabels'), 'fontsize', 18) Most of these settings are easier to do by using keyword arguments of the initial commands: In [38]: bar([1,2,3], [4,5,6], color=['red', 'green', 'blue']) But the getp/setp method is great for tuning the image interactively and learning about what can be customized. -- Jouni
If you can't find help anywhere else, the matlab documentaiton may be helpful. Most of the matplotlib functions are taken right from there. http://www.mathworks.com/access/helpdesk/help/techdoc/ref/plot.html http://www.mathworks.com/access/helpdesk/help/techdoc/ref/subplot.html http://www.mathworks.com/access/helpdesk/help/techdoc/ref/bar.html --bb On 8/21/06, Derek Hohls <DH...@cs...> wrote: > > The matplotlib philosophy is one of "make easy things easy" - which I > totally agree with. > > I am a new user of matplotlib; and a relatively new Python programmer. > I am trying to produce some bar charts for a colleague, in an attempt to > show how easy it is to do this with Python/matplotlib (as opposed to the > old Excel/cut-n-paste approach!). > > I think I have got the basics OK (two subplots), but I am struggling > with what *I* think should be trivial tasks - such as setting line > widths, font sizes, bar colours etc. The examples do not really seem to > deal with these issues, and in fact the homepage implies these are for a > "power user", which I find strange because these are some of the first > things most users want to "fiddle" with! What I have done as a > temporary fix is alter all the settings in the matplotprc file; but this > is not ideal as these settings affect *all* charts. > > It appears the manual (which I assume might be able to help me) is not > "downloadable". The link : > http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf > results in a 2.41MB PDF file, which Acrobat Reader reports is > "damaged". (I also noticed when running > the download, that the download manager seemed to be expecting a 4.5MB > file?) > > The example: > http://www.scipy.org/Cookbook/Matplotlib/BarCharts > shows how to setup labels for a bar chart - but it would be great if > there was a line-by-line explanation of what each step means; its not > very clear! > > The last point of "mystery" to me is that of "plot" vs "subplot" vs > "bar" - are these all essentially the same family of object, with some > differences in their capabilities - or vastly different beasts? > > Any help with these "newbie" issues would be appreciated! > > Thanks > Derek > > > --
The matplotlib philosophy is one of "make easy things easy" - which I totally agree with. I am a new user of matplotlib; and a relatively new Python programmer. I am trying to produce some bar charts for a colleague, in an attempt to show how easy it is to do this with Python/matplotlib (as opposed to the old Excel/cut-n-paste approach!). I think I have got the basics OK (two subplots), but I am struggling with what *I* think should be trivial tasks - such as setting line widths, font sizes, bar colours etc. The examples do not really seem to deal with these issues, and in fact the homepage implies these are for a "power user", which I find strange because these are some of the first things most users want to "fiddle" with! What I have done as a temporary fix is alter all the settings in the matplotprc file; but this is not ideal as these settings affect *all* charts. It appears the manual (which I assume might be able to help me) is not "downloadable". The link : http://matplotlib.sourceforge.net/users_guide_0.87.1.pdf results in a 2.41MB PDF file, which Acrobat Reader reports is "damaged". (I also noticed when running the download, that the download manager seemed to be expecting a 4.5MB file?) The example: http://www.scipy.org/Cookbook/Matplotlib/BarCharts shows how to setup labels for a bar chart - but it would be great if there was a line-by-line explanation of what each step means; its not very clear! The last point of "mystery" to me is that of "plot" vs "subplot" vs "bar" - are these all essentially the same family of object, with some differences in their capabilities - or vastly different beasts? Any help with these "newbie" issues would be appreciated! Thanks Derek -- This message is subject to the CSIR's copyright, terms and conditions and e-mail legal notice. Views expressed herein do not necessarily represent the views of the CSIR. CSIR E-mail Legal Notice http://mail.csir.co.za/CSIR_eMail_Legal_Notice.html CSIR Copyright, Terms and Conditions http://mail.csir.co.za/CSIR_Copyright.html For electronic copies of the CSIR Copyright, Terms and Conditions and the CSIR Legal Notice send a blank message with REQUEST LEGAL in the subject line to Cal...@cs.... This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.
On 19 Aug 2006, at 20:13, Kevin Horton wrote: > I've got a series of subplots in a matplotlib.FigureCanvas instance > which is embedded in a gtk viewport. Everything seems to work > correctly when I start the application - i.e. the series of > subplots are displayed. But, I need to be able to interactively > change the axis settings by clicking on GTK buttons. I have not > yet figured out how to make the subplots redraw after changing the > axis settings. > > Based on the dynamic_image_gtkagg.py example, I have done the > following (code not complete here): > f = Figure(figsize=(5,4), dpi=100) > canvas = FigureCanvas(f) > manager = pylab.get_current_fig_manager() > > and later, when I need to redraw the subplots: > > manager.canvas.draw() > > But, although I have confirmed that the axis settings are changed, > the subplots are not redrawn using the new settings. > > Any hints would be greatly appreciated. I'd been working on this all day, with no progress. But I finally hit the gold mine with Google. I needed to change the draw command to: f.canvas.draw() Now my application appears to be working correctly. The previous version was not triggering any errors, but it was not working. Kevin Horton Ottawa, Canada
I've got a series of subplots in a matplotlib.FigureCanvas instance which is embedded in a gtk viewport. Everything seems to work correctly when I start the application - i.e. the series of subplots are displayed. But, I need to be able to interactively change the axis settings by clicking on GTK buttons. I have not yet figured out how to make the subplots redraw after changing the axis settings. Based on the dynamic_image_gtkagg.py example, I have done the following (code not complete here): f = Figure(figsize=(5,4), dpi=100) canvas = FigureCanvas(f) manager = pylab.get_current_fig_manager() and later, when I need to redraw the subplots: manager.canvas.draw() But, although I have confirmed that the axis settings are changed, the subplots are not redrawn using the new settings. Any hints would be greatly appreciated. Kevin Horton Ottawa, Canada
Aaron, Each text object that you add with the text() function is appended to a list called "texts" that is an attribute of the axes object. So, to remove the last text object you added, you can do: del gca().texts[-1] draw() If what you want to do is change the contents but not the position, you can do: gca().texts[-1].set_text('Big Mistake') draw() If you want to change the position, you can do: gca().texts[-1].set_position((3,4)) draw() Note that in the set_position method, unlike the text() function, the position is specified as an (x,y) tuple; the parentheses are required. Or you can just shift one coordinate: gca().texts[-1].set_x(5) draw() If you want to change the first text object, then of course you would use texts[0] instead of texts[-1], etc. There is an alternative pylab function for setting properties that takes care of redrawing automatically. Here is an example: setp(gca().texts[-1], 'fontsize', 15) # Matlab-style or setp(gca().texts[-1], fontsize=17) # nicer style If you are going to want to experiment with the properties of your text object, then grab a reference to it when you create it, like this: tt = text(6,7,'another one') setp(tt, fontsize=15) That way you don't have to keep typing "gca().texts[-1]". Eric Aaron Hoover wrote: > Matplotlib is great. Between numpy, scipy, and matplotlib, I'm almost > completely weaned myself off of Matlab (just need to rewrite a bunch of > m-files in Python). > > My question is, is there an easy way to remove text that's been added > with the text() function from a plot (like if I make a mistake in the > text or its position)? I've thought about adding a long string of spaces > in the same location, but haven't tried it yet. Is there an easier way > like a clear() function or some other method I may have missed? > > Thanks, > Aaron > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Matplotlib is great. Between numpy, scipy, and matplotlib, I'm almost completely weaned myself off of Matlab (just need to rewrite a bunch of m-files in Python). My question is, is there an easy way to remove text that's been added with the text() function from a plot (like if I make a mistake in the text or its position)? I've thought about adding a long string of spaces in the same location, but haven't tried it yet. Is there an easier way like a clear() function or some other method I may have missed? Thanks, Aaron
On Saturday 19 August 2006 13:18, Hubert Fitch wrote: > Hi! > > Matplotlib is great! (For some unknown reason Matplotlib did not work until > I finally bought a differnt Windows XP computer). > Finally after about a year of trying, I can plot! but when the figure is on > screen, how can I quickly grab it and save it to a png file? Just click the save button on the toolbar at the bottom of the window.
Hi! Matplotlib is great! (For some unknown reason Matplotlib did not work until I finally bought a differnt Windows XP computer). Finally after about a year of trying, I can plot! but when the figure is on screen, how can I quickly grab it and save it to a png file? Attached is a picture of my plot. This picture was saved using a free screen saver called "Fastone Screen Saver." It is really neat! When you start it, a small floating tool bar is on screen. Click on the capture rectangle option, and the cross hairs allow getting your plotted figure. Now your mouse wheel button allows you to enlarge or make the captured figure as small or as large as you like. You are given the option to save it to a folder as a .png file. Incidentaly, I need to be able to find a way to increase the precision of Python but only while using an equation (or function?) that calculates gamma (g), which is part of the script that generates the lists that are plotted. Code below is a small part of the calculation and plotting statements required for generating the 42 parameter arrays [lists]. Solve the quadratic, with successive energies as inputs from each kth element. and solve for gamma = g = 1/(1-v**2/LightSpeed**2)**0.5 This is where the greater precision is needed, when veleocity v is very nearly equal to LightSpeed. LightSpeed = 299792458.00000000 # Meter/Second m0 = 9.109389700e-31 # Kilogram Mass Electron h = 6.62607549351e-034 # h = Q0**2*Z0/(2*a) # Planck's Constant # SOLVE FOR ALL PARAMETERS k = 0 while k<541: # Get each kth deBroglie energy Ed = Ed_data541[k] # (deBroglie Energy array X-Axis data) f = Ed/h # ----------------------------------------------------------------- # ----------------# Solve Quadratic (V = v**2) A = 1.0 # Quadratic Coefficient A B =(h*f/(m0*LightSpeed))**2 # Quadratic Coefficient B C = -(h*f/m0)**2 # Quadratic Coefficient C V = (-B +(B**2-4*A*C)**0.5)/(2*A) v = V**0.5 # Find Velocity from square root of v**2 b = v/C Ev = Ed/Q0 # Electron Volt Energy print Ed,k,g,v,C,b,Ev," Ed, k, g, v, LightSpeed, b, Ev" if v > LightSpeed: break if v < C: g = 1/(1.0-(v**2/C**2))**0.5 # Gamma # --------------------------------------------------------------- # Calculate statements for 42 parameters, and to fill 42 arrays k = k+1 # Plot statements In Python, double precision is already used, how can a better precision be invoked for this code only? Can it be done by in-line code or is a function needed? Hubert Fitch ----- Original Message ----- From: "CL" <ane...@gm...> To: <mat...@li...> Sent: Thursday, August 17, 2006 2:16 AM Subject: [Matplotlib-users] copy to graph to clipboard > Hi, > When matplotlib is used interactively, eg, with ipython, I find > that it will be convenient if I can copy the graph into clipboard and > then paste it to other program. But this feature is missed in current > release. Is there a plan to add this functionality in a future release? > If possible, adding a print/preview button will be useful too. > > Many thanks for developers' great work. > > Chunlei > > ------------------------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
On 8/18/06, assiss <as...@16...> wrote: > From: "Charlie Moad" <cw...@gm...> > To: "assiss" <as...@16...> > Date: 2006年8月18日 20:20:59 +0800 (CST) > Subject: Re: [Matplotlib-users] python coredump when using GtkAgg mode > > Thanks. > > 9 import matplotlib._image #worked > 10 import matplotlib._transforms #worked > 11 > 12 #one of these three depending on which numerix package you are using > 13 import matplotlib.backends._na_backend_agg # for > numarray, worked > 14 import matplotlib.backends._nc_backend_agg # for > Numeric, worked > 15 import matplotlib.backends._ns_backend_agg # for numpy, > failed, because I didn't install numpy. > 16 > 17 import matplotlib.backends._tkagg #worked > 18 import matplotlib._agg #worked Since your error was with gtk try: import matplotlib.backends._gtkagg I am guessing that will fail. You might try reinstalling gtk and pygtk. I doubt anyone has NetBSD to confirm your error though.
On 8/19/06, Darren Dale <dd...@co...> wrote: > On Friday 18 August 2006 08:27, Darren Dale wrote: > > On Wednesday 16 August 2006 04:54, Samuel GARCIA wrote: > > > Thank you, > > > Sorry I did known the existence of matplotlib.backends.backend_qt4agg. > > > It is more easy than I thought. > > > > > > but I still have a problem. This is my code : > > > > > > import sys > > > > > > from PyQt4.QtCore import * > > > from PyQt4.QtGui import * > > > > > > from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as > > > FigureCanvas > > > from matplotlib.figure import Figure > > > > > > #------------------------------------------------------------------------ > > >-- ---- class MyWidget(QWidget): > > > def __init__(self, parent=None): > > > QWidget.__init__(self, parent) > > > self.menuBar = QMenuBar() > > > self.fileMenu = QMenu(self.tr("&File"), self) > > > self.menuBar.addMenu(self.fileMenu) > > > > > > mainLayout = QVBoxLayout() > > > mainLayout.setMenuBar(self.menuBar) > > > > > > self.setLayout(mainLayout) > > > > > > #------------------------------------------------------------------------ > > >-- ---- if __name__ == "__main__": > > > app = QApplication(sys.argv) > > > dialog = MyWidget() > > > dialog.show() > > > sys.exit(app.exec_()) > > > > > > and it does not works because the main window is blocking. > > There is a comment in the embedding_in_qt.py example: > > # The QApplication has to be created before backend_qt is imported, otherwise > # it will create one itself. > > This goes for qt4 as well, and is the source of the problem. You can have only > one QApplication at a time. (Ted, John, do you think the QApplication really > needs to be created during the module import? show() is the only function > that looks for the QApplication, maybe the qApp should be created there > instead. Any reason against?) > > I added an example, embedding_in_qt4.py, to the svn repository. It is closely > based on embedding_in_qt.py. >From what I saw, creating QApp in show makes more sense. - Charlie
On Friday 18 August 2006 08:27, Darren Dale wrote: > On Wednesday 16 August 2006 04:54, Samuel GARCIA wrote: > > Thank you, > > Sorry I did known the existence of matplotlib.backends.backend_qt4agg. > > It is more easy than I thought. > > > > but I still have a problem. This is my code : > > > > import sys > > > > from PyQt4.QtCore import * > > from PyQt4.QtGui import * > > > > from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as > > FigureCanvas > > from matplotlib.figure import Figure > > > > #------------------------------------------------------------------------ > >-- ---- class MyWidget(QWidget): > > def __init__(self, parent=None): > > QWidget.__init__(self, parent) > > self.menuBar = QMenuBar() > > self.fileMenu = QMenu(self.tr("&File"), self) > > self.menuBar.addMenu(self.fileMenu) > > > > mainLayout = QVBoxLayout() > > mainLayout.setMenuBar(self.menuBar) > > > > self.setLayout(mainLayout) > > > > #------------------------------------------------------------------------ > >-- ---- if __name__ == "__main__": > > app = QApplication(sys.argv) > > dialog = MyWidget() > > dialog.show() > > sys.exit(app.exec_()) > > > > and it does not works because the main window is blocking. There is a comment in the embedding_in_qt.py example: # The QApplication has to be created before backend_qt is imported, otherwise # it will create one itself. This goes for qt4 as well, and is the source of the problem. You can have only one QApplication at a time. (Ted, John, do you think the QApplication really needs to be created during the module import? show() is the only function that looks for the QApplication, maybe the qApp should be created there instead. Any reason against?) I added an example, embedding_in_qt4.py, to the svn repository. It is closely based on embedding_in_qt.py. Darren
Hello, I tried to embed matplotlib in a GTK2 application (using pygtk & glade) but encountered a problem. As I have been playing with it for a while I think that for its demonstration it is enough to look at the matplotlib example: embedding_in_gtk2.py (from the example directory of matplotlib) There, for me the figsize line: fig = Figure(figsize=(6,6), dpi=100) has no effect whatsoever (when tryong to change the size)... The window size is simply set with win.set_default_size(400,300) and the figure is always of the same size... Can anybody tell me why? (In my own application, if I do not explicitely specify a window size, I always get a window that is too small and has to be resized by hand.) Currently I am using Windows XP with matplotlib 0.87.4 pygtk 2.8.6 Thank you for any idea! Ruda
From: "Charlie Moad" <cw...@gm...> To: "assiss" <as...@16...> Date: 2006年8月18日 20:20:59 +0800 (CST) Subject: Re: [Matplotlib-users] python coredump when using GtkAgg mode Thanks. 9 import matplotlib._image #worked 10 import matplotlib._transforms #worked 11 12 #one of these three depending on which numerix package you are using 13 import matplotlib.backends._na_backend_agg # for numarray, worked 14 import matplotlib.backends._nc_backend_agg # for Numeric, worked 15 import matplotlib.backends._ns_backend_agg # for numpy, failed, because I didn't install numpy. 16 17 import matplotlib.backends._tkagg #worked 18 import matplotlib._agg #worked 1.py: ###################### from pylab import * plot(range(3)) show() ###################### Build matplotlib with VERBOSE=True , run python 1.py -dGTKAgg, it showed: ########################## LazyValue::init_type Value::init_type BinOp::init_type Point::init_type Interval::init_type Bbox::init_type Func::init_type FuncXY::init_type Transformation::init_type SeparableTransformation::init_type NonseparableTransformation::init_type Affine::init_type init_na_transforms Glyph::init_type FT2Font::init_type _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation init_na_image Image::init_type _transforms_module::new_value Value::~Value init_na_backend_agg _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation _transforms_module::new_value _transforms_module::new_value _transforms_module::new_value _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point LazyValue::number BinOp::BinOp LazyValue::number BinOp::BinOp _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_value _transforms_module::new_value _transforms_module::new_point Point::Point _transforms_module::new_bbox Bbox::Bbox _transforms_module::new_func _transforms_module::new_func _transforms_module::new_separable_transformation BBoxTransformation::BBoxTransformation SeparableTransformation::SeparableTransformation SeparableTransformation::~SeparableTransformation Func::~Func Func::~Func BBoxTransformation::~BBoxTransformation Bbox::~Bbox Point::~Point Value::~Value Value::~Value Point::~Point Value::~Value Value::~Value Bbox::~Bbox Point::~Point Value::~Value Value::~Value Point::~Point Value::~Value Value::~Value Transformation::~Transformation Segmentation fault (core dumped) ########################### > Please follow the segfault instructions and get back to us. > > http://svn.sourceforge.net/viewvc/matplotlib/trunk/matplotlib/SEGFAULTS?revision=2312&view=markup > > > On 8/18/06, assiss <as...@16...> wrote: > > hi all, > > I installed matplotlib and it worked very well with TkAgg/Agg. But when use > > GtkAgg or Gtk, python just coredumped without any prompts. > > For example, python a.py -dTkAgg, it worked. python a.py -dGtkAgg, > > "Segmentation fault (core dumped)". > > > > When running the examples with -dGtkAgg, gtk_spreadsheet.py > > embedding_in_gtk.py embedding_in_gtk3.py worked, embedding_in_gtk2.py > > pylab_with_gtk.py failed and coredumped without any prompts. > > > > My system is NetBSD AMD64-3.0. With python 2.4.3, gtk+-2.8.19, pygtk-2.8.6. > > > > Is there someting wrong with my system? Thanks for your suggestion. > > > > assiss > > 2006年8月18日 > > > > > > > > > > > > > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > > >
I too would like a simple "Reply" to go to the list. I had to use Gmail's "Reply to all" feature to put this on the list.