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
(9) |
2
(8) |
3
(6) |
4
(5) |
5
(10) |
6
(1) |
7
|
8
(5) |
9
(3) |
10
(12) |
11
(24) |
12
(28) |
13
(16) |
14
(3) |
15
(10) |
16
(17) |
17
(19) |
18
(10) |
19
(20) |
20
(7) |
21
(11) |
22
(7) |
23
(5) |
24
(4) |
25
(11) |
26
(19) |
27
(1) |
28
(1) |
29
(13) |
30
(7) |
31
(22) |
|
|
|
From: Mathew Y. <mat...@gm...> - 2011-08-15 21:56:51
|
Hi Is there a simple way to do the following l1=Line2D(xdata=[1,2,3],ydata=[4,5,6]) l2=Line2D(xdata = [1].ydata=[3]) if l2 in l1 #error, Line2D not iterable -Mathew |
From: Jeff K. <kl...@wi...> - 2011-08-15 19:32:10
|
Hello all, I am running Mac OS X 10.7 Lion with matplotlib 1.0.1 and the MacTex 2011 distrubution. I am able to run the tex_demo.py with no problems and I can create output files using the Agg backend. When I try to use the PDF backend, however, I get an error which stems from dviread.py (pasted below). Any thoughts on what could be going wrong? Thanks! Jeff || Jeff Klukas || Research Assistant (Physics), University of Wisconsin || jeff.klukas@gmail | jeffyklukas@aim | jeffklukas@skype || http://hep.wisc.edu/~jklukas/ Traceback (most recent call last): File "tex_demo.py", line 32, in <module> savefig('tex_demo') File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/pyplot.py", line 363, in savefig return fig.savefig(*args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/figure.py", line 1084, in savefig self.canvas.print_figure(*args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 1923, in print_figure **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 2156, in print_pdf self.figure.draw(renderer) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/figure.py", line 798, in draw func(*args) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axes.py", line 1946, in draw a.draw(renderer) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axis.py", line 1017, in draw tick.draw(renderer) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/axis.py", line 234, in draw self.label1.draw(renderer) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/artist.py", line 55, in draw_wrapper draw(artist, renderer, *args, **kwargs) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/text.py", line 571, in draw self._fontproperties, angle) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 1549, in draw_tex psfont = self.tex_font_mapping(dvifont.texname) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/backends/backend_pdf.py", line 1365, in tex_font_mapping dviread.PsfontsMap(dviread.find_tex_file('pdftex.map')) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py", line 668, in __init__ self._parse(file) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py", line 701, in _parse self._register(words) File "/Library/Frameworks/EPD64.framework/Versions/7.1/lib/python2.7/site-packages/matplotlib/dviread.py", line 727, in _register assert encoding is None AssertionError |
From: Stan W. <sta...@nr...> - 2011-08-15 17:36:14
|
From: David Just [mailto:Jus...@ma...] Sent: Friday, August 12, 2011 11:05 Now that I'm pre-building all my enlarged interpolated images to scroll through, I'm having trouble forcing the figure/FigureCanvas to be the size I want. I'm trying: fig.set_size_inches(768 / 72.0, 768 / 72.0), but it ends up the same size as the default plot. If the issue is that the GUI window is not changing size, try adding "forward=True" to the set_size_inches call. |
From: Michael D. <md...@st...> - 2011-08-15 15:53:08
|
It looks like it isn't finding the Computer Modern Bakoma fonts. They don't seem to be included in the Fedora Package (see here: http://koji.fedoraproject.org/koji/buildinfo?buildID=230966) and the package does not depend on those fonts. Some of them are packaged in the lyx-fonts package, so installing that may help. But basically this is a packaging bug -- the package should either include the fonts or depend on the fonts. It might be a good idea to file a bug against the python-matplotlib package in the Fedora bug tracker. Mike On 08/15/2011 07:05 AM, Neal Becker wrote: > Fedora f15. What am I missing that causes this? > > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: > findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: UserWarning: > findfont: Could not match :family=Bitstream Vera > Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12. Returning > /usr/share/fonts/texlive-gfsdidot/GFSDidotBold.otf > UserWarning) > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: > findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: > findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Michael D. <md...@st...> - 2011-08-15 14:52:08
|
On 08/14/2011 11:28 AM, Vlastimil Brom wrote: > #################################################### > > Regarding wxagg, it seems, that the suggestion about unsuitable fonts > being used was correct; > after setting the font to Arial, adapted from: > http://matplotlib.sourceforge.net/examples/api/font_family_rc.html > all the characters in the title are displayed ok. > > #################################################### > #! Python > # -*- coding: utf-8 -*- > > import wxversion > wxversion.select('2.9.2') # 2.9.2.1 > import wx > > # setting the font to Arial - the title is displayed completely; > # with the default font only the "latin-1" characters are shown > from matplotlib import rcParams > rcParams['font.family'] = 'sans-serif' > rcParams['font.sans-serif'] = ['Arial'] + rcParams['font.sans-serif'] > # > > import matplotlib > matplotlib.use('WXAgg') > import pylab > > pylab.plot(range(3), range(3)) > pylab.title(u"abcd áčďéěíňóřšťúůýž äöüß ê αβγδ абвгд אבגד xyz") > pylab.show() > > #################################################### > (using python 2.7.2, MPL 1.0.1; Win 7, Czech) > > Is there maybe some machanism available in matplotlib, which would > select the appropriate font for the given characters? (Like in wx or, > even more powerful in tk?) Or is it the expected way to set the > suitable font individually, as only the font list in rcParams are > tried sequentially - regardless of the character support? That's correct: matplotlib doesn't currently do this. It renders a particular string of text with a single font and does not do font substitution for characters that are not in that font. The best practice is to use a font that contains the full set of characters, such as Arial or Deja Vu as you've discovered. There a lot of other i18n shortcomings to the way matplotlib supports text (such as a lack of bidi support). That's a large wheel to reinvent, so the solution would involve using a third-party text layout library such as pango, but I know there is licensing friction against that. It may be worth revisiting that at some point. Mike |
From: Neal B. <ndb...@gm...> - 2011-08-15 13:20:53
|
Looks like this is fixed by: mathtext.fontset: stix Neal Becker wrote: > Fedora f15. What am I missing that causes this? > > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: > UserWarning: findfont: Font family ['cmb10'] not found. Falling back to > Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: > UserWarning: findfont: Could not match :family=Bitstream Vera > Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12. > Returning /usr/share/fonts/texlive-gfsdidot/GFSDidotBold.otf > UserWarning) > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: > UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to > Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: > UserWarning: findfont: Font family ['cmss10'] not found. Falling back to > Bitstream Vera Sans > (prop.get_family(), self.defaultFamily[fontext])) > > > ------------------------------------------------------------------------------ > uberSVN's rich system and user administration capabilities and model > configuration take the hassle out of deploying and managing Subversion and > the tools developers use with it. Learn more about uberSVN and get a free > download at: http://p.sf.net/sfu/wandisco-dev2dev |
From: Neal B. <ndb...@gm...> - 2011-08-15 11:05:56
|
Fedora f15. What am I missing that causes this? /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmb10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1252: UserWarning: findfont: Could not match :family=Bitstream Vera Sans:style=normal:variant=normal:weight=normal:stretch=normal:size=12. Returning /usr/share/fonts/texlive-gfsdidot/GFSDidotBold.otf UserWarning) /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmtt10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) /usr/lib64/python2.7/site-packages/matplotlib/font_manager.py:1242: UserWarning: findfont: Font family ['cmss10'] not found. Falling back to Bitstream Vera Sans (prop.get_family(), self.defaultFamily[fontext])) |
From: Vlastimil B. <vla...@gm...> - 2011-08-14 15:29:07
|
2011/8/14 Eric Firing <ef...@ha...>: > On 08/13/2011 01:11 PM, Vlastimil Brom wrote: >> Hi all, >> I'd like to ask a probably basic qustion about backends in matplotlib >> - specifically with regard to WXAgg and WX. >> What are the differences of the two, and what are the supposed >> usecases, and maybe restrictions for them? > > http://matplotlib.sourceforge.net/faq/installing_faq.html#backends > > WXAgg is WX for window and widgets, but with all figure rendering done > using the Agg library to generate an image which is then displayed as > such by WX. There is the same sort of pair for gtk: gtkagg and plain > gtk. Only the *agg interactive backends are fully supported; it is > expected that not everything will work with the non-agg interactive > backends, and every now and then there is discussion of whether they > should be eliminated for that reason. Their only advantage, as far as I > know, is that under some circumstances, such as working remotely with X > on a slow link, the non-agg backends may be faster. > >> >> Using matplotlib/pylab pylab in a rather basic way I encountered >> problems with both backends and would like to clarify the differences >> before i try to find a fix. >> >> using wxAgg I am not able to display unicode text (some accents, >> non-latin scripts etc. e.g. in pylab.title(...) and otherwhere . > > This is surprising; in general, unicode works with the *agg backends. > Maybe plain WX is finding some fonts that WXAgg is not finding? > > Eric > > Thanks for the reference and for the important info, that only wxagg is considered fully supported as opposed to wx backend. It appears, that in the current state, using the latest wxpython 2.9.2.1, it is indeed unusable, as no graph canvas is displayed at all (at least on my setup - win 7, py-2.7), cf.: #################################################### #! Python # -*- coding: utf-8 -*- import wxversion # wxversion.select('2.9.1') # 2.9.1.1 # plot ok wxversion.select('2.9.2') # 2.9.2.1 # invalid "transparent" canvas without any graph content import wx import matplotlib matplotlib.use('WX') import pylab pylab.plot(range(3), range(3)) pylab.show() #################################################### Regarding wxagg, it seems, that the suggestion about unsuitable fonts being used was correct; after setting the font to Arial, adapted from: http://matplotlib.sourceforge.net/examples/api/font_family_rc.html all the characters in the title are displayed ok. #################################################### #! Python # -*- coding: utf-8 -*- import wxversion wxversion.select('2.9.2') # 2.9.2.1 import wx # setting the font to Arial - the title is displayed completely; # with the default font only the "latin-1" characters are shown from matplotlib import rcParams rcParams['font.family'] = 'sans-serif' rcParams['font.sans-serif'] = ['Arial'] + rcParams['font.sans-serif'] # import matplotlib matplotlib.use('WXAgg') import pylab pylab.plot(range(3), range(3)) pylab.title(u"abcd áčďéěíňóřšťúůýž äöüß ê αβγδ абвгд אבגד xyz") pylab.show() #################################################### (using python 2.7.2, MPL 1.0.1; Win 7, Czech) Is there maybe some machanism available in matplotlib, which would select the appropriate font for the given characters? (Like in wx or, even more powerful in tk?) Or is it the expected way to set the suitable font individually, as only the font list in rcParams are tried sequentially - regardless of the character support? Regards, vbr |
From: Goyo <goy...@gm...> - 2011-08-14 11:30:31
|
Maybe you need to call fig.canvas.draw() to get the figura actually resized. 2011/8/12, Benjamin Root <ben...@ou...>: > On Fri, Aug 12, 2011 at 10:04 AM, David Just <Jus...@ma...> wrote: > >> Now that I’m pre-building all my enlarged interpolated images to scroll >> through, I’m having trouble forcing the figure/FigureCanvas to be the >> size >> I want. >> >> I’m trying: >> fig.set_size_inches(768 / 72.0, 768 / 72.0), but it ends up the same size >> as the default plot. >> >> Thanks, >> Dave >> >> >> > Dave, > > Don't know if that is a bug or not (never tried that function). Typically, > I just use the figsize kwarg in the figure constructor. Is it possible to > do it from there, or are you looking to adjust the figure size *after* the > figure has been displayed already? > > Ben Root > |
From: Eric F. <ef...@ha...> - 2011-08-14 01:46:50
|
On 08/13/2011 01:11 PM, Vlastimil Brom wrote: > Hi all, > I'd like to ask a probably basic qustion about backends in matplotlib > - specifically with regard to WXAgg and WX. > What are the differences of the two, and what are the supposed > usecases, and maybe restrictions for them? http://matplotlib.sourceforge.net/faq/installing_faq.html#backends WXAgg is WX for window and widgets, but with all figure rendering done using the Agg library to generate an image which is then displayed as such by WX. There is the same sort of pair for gtk: gtkagg and plain gtk. Only the *agg interactive backends are fully supported; it is expected that not everything will work with the non-agg interactive backends, and every now and then there is discussion of whether they should be eliminated for that reason. Their only advantage, as far as I know, is that under some circumstances, such as working remotely with X on a slow link, the non-agg backends may be faster. > > Using matplotlib/pylab pylab in a rather basic way I encountered > problems with both backends and would like to clarify the differences > before i try to find a fix. > > using wxAgg I am not able to display unicode text (some accents, > non-latin scripts etc. e.g. in pylab.title(...) and otherwhere . This is surprising; in general, unicode works with the *agg backends. Maybe plain WX is finding some fonts that WXAgg is not finding? Eric > Just changing: > matplotlib.use('WXAgg') > to > matplotlib.use('WX') > seemed to fix this, and the graph gui also looks more consistent with > my wxPython app. > > However, using the current wxPython 2.9.2.1. (python 2.7.2, Win 7, > Czech) I see a more serious bug in the wx-backend (basically failing > to display the graph at all > (cf. http://sourceforge.net/mailarchive/message.php?msg_id=27902016 ), > which doesn't apply for WXAgg. > > Coud someone maybe provide some hints, where I should look into to > understand the backend differences better? > > Thanks in advance, > > Regards, > Vlastimil Brom > > ------------------------------------------------------------------------------ > FREE DOWNLOAD - uberSVN with Social Coding for Subversion. > Subversion made easy with a complete admin console. Easy > to use, easy to manage, easy to install, easy to extend. > Get a Free download of the new open ALM Subversion platform now. > http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Özgür <ozg...@m3...> - 2011-08-13 23:41:43
|
I guess that is the problem. Thanks for the idea. Regards, Ozgur On Sat, 13 Aug 2011, Benjamin Root wrote: > > > On Saturday, August 13, 2011, Özgür <ozg...@m3...> wrote: > > Please forget it. For now the real problem is: I am plotting by using "contour" and I get the data values by using get_paths. But > it does not include some part of the contour. A screenshot is attached. The colored lines are those returned by get_paths. But the > black line is not included. I guess this is a bug? > > > > contour = plt.contour(xi,yi,zi,numberoflevels,linewidths=1,colors='k') > > lev = contour.levels > > col = contour.collections > > polygons = [] > > for i in range(len(lev)): > > polygons.append (col[i].get_paths()[0].vertices) > > > > ... other code to plot the colored points... > > > > You are assuming that there are the same number of contours as levels. In the general case, this can never be assumed. Why not > just simply loop over the collections(or, even better, use a list comprehension)? > > Ben Root > |
From: Vlastimil B. <vla...@gm...> - 2011-08-13 23:35:57
|
Hi all, I'd like to ask a probably basic qustion about backends in matplotlib - specifically with regard to WXAgg and WX. What are the differences of the two, and what are the supposed usecases, and maybe restrictions for them? Using matplotlib/pylab pylab in a rather basic way I encountered problems with both backends and would like to clarify the differences before i try to find a fix. using wxAgg I am not able to display unicode text (some accents, non-latin scripts etc. e.g. in pylab.title(...) and otherwhere . Just changing: matplotlib.use('WXAgg') to matplotlib.use('WX') seemed to fix this, and the graph gui also looks more consistent with my wxPython app. However, using the current wxPython 2.9.2.1. (python 2.7.2, Win 7, Czech) I see a more serious bug in the wx-backend (basically failing to display the graph at all (cf. http://sourceforge.net/mailarchive/message.php?msg_id=27902016 ), which doesn't apply for WXAgg. Coud someone maybe provide some hints, where I should look into to understand the backend differences better? Thanks in advance, Regards, Vlastimil Brom |
From: Benjamin R. <ben...@ou...> - 2011-08-13 20:37:33
|
On Saturday, August 13, 2011, Özgür <ozg...@m3...> wrote: > Please forget it. For now the real problem is: I am plotting by using "contour" and I get the data values by using get_paths. But it does not include some part of the contour. A screenshot is attached. The colored lines are those returned by get_paths. But the black line is not included. I guess this is a bug? > > contour = plt.contour(xi,yi,zi,numberoflevels,linewidths=1,colors='k') > lev = contour.levels > col = contour.collections > polygons = [] > for i in range(len(lev)): > polygons.append (col[i].get_paths()[0].vertices) > > ... other code to plot the colored points... > You are assuming that there are the same number of contours as levels. In the general case, this can never be assumed. Why not just simply loop over the collections(or, even better, use a list comprehension)? Ben Root |
From: Özgür <ozg...@m3...> - 2011-08-13 19:34:10
|
Please forget it. For now the real problem is: I am plotting by using "contour" and I get the data values by using get_paths. But it does not include some part of the contour. A screenshot is attached. The colored lines are those returned by get_paths. But the black line is not included. I guess this is a bug? contour = plt.contour(xi,yi,zi,numberoflevels,linewidths=1,colors='k') lev = contour.levels col = contour.collections polygons = [] for i in range(len(lev)): polygons.append (col[i].get_paths()[0].vertices) ... other code to plot the colored points... On Sat, 13 Aug 2011, Özgür wrote: > Hi, when I use the function "contour" sometimes I get a broken contour > line. This should be continuous. Probably this is a bug. Does anyone know > anything about this issue? > > Regards, > Ozgur > > ------------------------------------------------------------------------------ > FREE DOWNLOAD - uberSVN with Social Coding for Subversion. > Subversion made easy with a complete admin console. Easy > to use, easy to manage, easy to install, easy to extend. > Get a Free download of the new open ALM Subversion platform now. > http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2011-08-13 18:50:06
|
On Saturday, August 13, 2011, Özgür <ozg...@m3...> wrote: > Hi, when I use the function "contour" sometimes I get a broken contour > line. This should be continuous. Probably this is a bug. Does anyone know > anything about this issue? > > Regards, > Ozgur > Could you please post an image of what you are seeing, and possibly the data used to create this? Also, which version of mpl are you using? Ben Root |
From: Özgür <ozg...@m3...> - 2011-08-13 18:38:00
|
Hi, when I use the function "contour" sometimes I get a broken contour line. This should be continuous. Probably this is a bug. Does anyone know anything about this issue? Regards, Ozgur |
From: Michael M. F. <mf...@ph...> - 2011-08-13 10:46:14
|
Hi, I am trying to figure out how to produce a mixed-mode rendering PDF of a contourf plot. I tried something like this: >>> from pylab import meshgrid, sin, cos, linspace, contourf, savefig, clf >>> x, y = meshgrid(*(linspace(-1,1,500),)*2) >>> z = sin(20*x**2)*cos(30*y) >>> c = contourf(x,y,z,30,rasterized=True) >>> savefig('tst0.pdf') but this does not work. (The QuadContourSet c does not support set_rasterized() so the rasterized argument is just ignored. Is the ignoring of the argument a bug or a feature?) I tried calling set_rasterized() on all of the of PathCollection objects in c.collections but this did not help: >>> for pc in c.collections: >>> pc.set_rasterized(True) >>> savefig('tst1.pdf') While this helps, there are still 30 rasterized patches which renders slowly as a PDF. I found one possible solution: make a custom Collection subclass as shown below, then remove all of the PathCollection instances from the figure, inserting instead this new collection as a single rasterized entity: >>> insert(c) # See code below for definition of insert() >>> savefig('tst2.pdf') The file-sizes are: $ ls -lah *.pdf ... 4.2M Aug 13 02:38 tst0.pdf ... 1.8M Aug 13 02:38 tst1.pdf ... 629K Aug 13 02:40 tst2.pdf but tst2.pdf looks as good as tst1.pdf, and is much faster to load. (There are some faint white lines between the patches similar to those discussed before: http://thread.gmane.org/gmane.comp.python.matplotlib.devel/8540/focus=8590 but the rasterizer here is in the PDF backend, so maybe something can be done? Should I look into this as a potential bug? I am using the version of matplotlib included with the latest EPD on a 32 bit Mac.) Question: Is there some way of doing this with current matplotlib API, or is some sort of extension like this required? If the latter, is there anything I should be careful about? (The ListCollection should probably be inserted in contourf rather than retroactively like this.) Thanks, Michael. ----------------------------------------------- from matplotlib.collections import Collection from matplotlib.artist import allow_rasterization from matplotlib import pyplot as plt class ListCollection(Collection): def __init__(self, collections, **kwargs): Collection.__init__(self, **kwargs) self.set_collections(collections) def set_collections(self, collections): self._collections = collections def get_collections(self): return self._collections @allow_rasterization def draw(self, renderer): for _c in self._collections: _c.draw(renderer) def insert(c): collections = c.collections for _c in collections: _c.remove() cc = ListCollection(collections, rasterized=True) ax = plt.gca() ax.add_artist(cc) return cc |
From: <lu...@ip...> - 2011-08-13 07:21:27
|
Hello! I'm using matplotlib in my wx.Frame to draw some arrows and text at a certain position. The number and position of the arrows is based on previously created data. I do some calculations but basically it's like this: arrow = primer for each primer: draw one arrow at position y - 0.05 to the previos arrow (primer_y - 0.05). The x position of the arrow comes from the data, which is calculated and scaled (not so important know, it's just to now where the arrow should be at primer_x). Everything works fine until I have many arrows to draw. E.g. in my code example the data contain 62 arrows, where 18 are drawn correctly, the next 3 are missing but the text is there and the rest is completly missing. Does anyone knows what could be the problem? I tried allready to change the FigureSize but it's only stretch the arrows. Here's a quick and dirty working example, data is included in the code: http://pastebin.com/7mQmZm2c Any help is highly appreciated! Thanks in advance! Stefanie |
From: Christopher B. <c-...@as...> - 2011-08-13 03:26:01
|
Hi Ben, Eric and Paul, Paul's partial solution is actually exactly what I need. Thanks! -Chris On Friday, August 12, 2011 07:26:22 PM Benjamin Root wrote: > On Friday, August 12, 2011, Christopher Brown <c-...@as...> wrote: > > Thanks Ben, > > > > I should have been more clear. In fact I do want to create an entirely > > new figure containing the already created axes. This might not be the > > best way > > to > > > do what I want to do, but the docs for add_axes states that passing an > > axes > > > instance will add that instance to the figure. I must be misunderstanding > > something. > > > > -Chris > > So, are you specifically wanting the same axes object in two figures? If > so, as Paul said, it is technically possible (using the method that Eric > mentioned), but that mode is currently unsupported and we can not guarantee > that things will work as expected. Matplotlib assumes that an axes object > has a single parent, and breaking that assumption can cause issues down the > line. > > However, if you don't intend to have the same axes appear twice, then the > question becomes why do you need to create the figure after the axes? > > Ben Root |
From: Eric F. <ef...@ha...> - 2011-08-13 02:59:56
|
On 08/12/2011 03:58 PM, Christopher Brown wrote: > Thanks Ben, > > I should have been more clear. In fact I do want to create an entirely new > figure containing the already created axes. This might not be the best way to > do what I want to do, but the docs for add_axes states that passing an axes > instance will add that instance to the figure. I must be misunderstanding > something. The docstring is seriously misleading; I will fix it. Eric > > -Chris > > On Friday, August 12, 2011 05:57:17 PM Benjamin Root wrote: >> Yes, you are making it harder on yourself... >> >> On Friday, August 12, 2011, Christopher Brown<c-...@as...> wrote: >>> I feel like I'm doing this right, but it doesn't work. Any clues? >>> >>> from matplotlib import pyplot as pp >>> >>> pp.plot((1,2,3)) >>> ax = pp.gca() >> >> At this point, a figure is implicitly created because none exists at this >> point. The ax object is implicitly added to that. >> >>> f = pp.figure(num=2) >> >> This will be a completely new figure. >> >>> print 'first: %i' % ax.figure.number >>> print 'second: %i' % f.number >>> f.add_axes(ax) >> >> Since ax was already attached, it can't be in two figures at once, so the >> assertion fails. >> >>> yields: >>> >>> Traceback (most recent call last): >>> File "<stdin>", line 1, in<module> >>> File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 606, >>> >>> in add_axes >>> >>> assert(a.get_figure() is self) >>> >>> AssertionError >> >> So, just simply create your figure first, and call ax = f.gca() after. >> There should be no need to call add_axes except in very special >> situations. >> >> I hope that helps! >> >> Ben Root > > ------------------------------------------------------------------------------ > FREE DOWNLOAD - uberSVN with Social Coding for Subversion. > Subversion made easy with a complete admin console. Easy > to use, easy to manage, easy to install, easy to extend. > Get a Free download of the new open ALM Subversion platform now. > http://p.sf.net/sfu/wandisco-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Eric F. <ef...@ha...> - 2011-08-13 02:59:31
|
On 08/12/2011 03:00 PM, Paul Ivanov wrote: > Christopher Brown, on 2011-08-12 16:56, wrote: >> I feel like I'm doing this right, but it doesn't work. Any clues? >> >> from matplotlib import pyplot as pp >> >> pp.plot((1,2,3)) >> ax = pp.gca() >> f = pp.figure(num=2) >> print 'first: %i' % ax.figure.number >> print 'second: %i' % f.number >> f.add_axes(ax) >> >> yields: >> >> Traceback (most recent call last): >> File "<stdin>", line 1, in<module> >> File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 606, >> in add_axes >> assert(a.get_figure() is self) >> AssertionError > > Right now, matplotlib allows an axes to participate in only one > figure. You can get part-way to what you want by setting > ax.figure=f before calling f.add_axes(ax). Then, you'll have ax > in both figures, but its transforms are still rooted in the first > figure, so resizing the first figure, you'll see changes to the > size of the plot in the second figure. It's worse than that; it really just doesn't work in any useful way, and it was never intended to do so. Try it: In [1]: fig = gcf() In [2]: fig.add_axes? In [3]: plot([1,2,3]) Out[3]: [<matplotlib.lines.Line2D at 0x335cf10>] In [4]: ax = gca() In [5]: fig2 = figure() In [6]: ax.set_figure(fig2) In [7]: fig2.add_axes(ax) Out[7]: <matplotlib.axes.AxesSubplot at 0x333b250> In [8]: ax.plot([3,4,5]) Out[8]: [<matplotlib.lines.Line2D at 0x3368890>] In [9]: draw() Eric > > best, > > > > ------------------------------------------------------------------------------ > FREE DOWNLOAD - uberSVN with Social Coding for Subversion. > Subversion made easy with a complete admin console. Easy > to use, easy to manage, easy to install, easy to extend. > Get a Free download of the new open ALM Subversion platform now. > http://p.sf.net/sfu/wandisco-dev2dev > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Benjamin R. <ben...@ou...> - 2011-08-13 02:26:28
|
On Friday, August 12, 2011, Christopher Brown <c-...@as...> wrote: > Thanks Ben, > > I should have been more clear. In fact I do want to create an entirely new > figure containing the already created axes. This might not be the best way to > do what I want to do, but the docs for add_axes states that passing an axes > instance will add that instance to the figure. I must be misunderstanding > something. > > -Chris > So, are you specifically wanting the same axes object in two figures? If so, as Paul said, it is technically possible (using the method that Eric mentioned), but that mode is currently unsupported and we can not guarantee that things will work as expected. Matplotlib assumes that an axes object has a single parent, and breaking that assumption can cause issues down the line. However, if you don't intend to have the same axes appear twice, then the question becomes why do you need to create the figure after the axes? Ben Root |
From: Christopher B. <c-...@as...> - 2011-08-13 01:58:45
|
Thanks Ben, I should have been more clear. In fact I do want to create an entirely new figure containing the already created axes. This might not be the best way to do what I want to do, but the docs for add_axes states that passing an axes instance will add that instance to the figure. I must be misunderstanding something. -Chris On Friday, August 12, 2011 05:57:17 PM Benjamin Root wrote: > Yes, you are making it harder on yourself... > > On Friday, August 12, 2011, Christopher Brown <c-...@as...> wrote: > > I feel like I'm doing this right, but it doesn't work. Any clues? > > > > from matplotlib import pyplot as pp > > > > pp.plot((1,2,3)) > > ax = pp.gca() > > At this point, a figure is implicitly created because none exists at this > point. The ax object is implicitly added to that. > > > f = pp.figure(num=2) > > This will be a completely new figure. > > > print 'first: %i' % ax.figure.number > > print 'second: %i' % f.number > > f.add_axes(ax) > > Since ax was already attached, it can't be in two figures at once, so the > assertion fails. > > > yields: > > > > Traceback (most recent call last): > > File "<stdin>", line 1, in <module> > > File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 606, > > > > in add_axes > > > > assert(a.get_figure() is self) > > > > AssertionError > > So, just simply create your figure first, and call ax = f.gca() after. > There should be no need to call add_axes except in very special > situations. > > I hope that helps! > > Ben Root |
From: Eric F. <ef...@ha...> - 2011-08-13 01:08:39
|
On 08/12/2011 01:56 PM, Christopher Brown wrote: > I feel like I'm doing this right, but it doesn't work. Any clues? > > from matplotlib import pyplot as pp > > pp.plot((1,2,3)) > ax = pp.gca() > f = pp.figure(num=2) > print 'first: %i' % ax.figure.number > print 'second: %i' % f.number > f.add_axes(ax) That looks pretty convoluted. What are you really trying to do, and why? It looks like you are trying to transplant an Axes from one figure to another; add_axes doesn't do that. I'm not sure add_axes should even include a signature in which an axes instance is the argument; it is part of the behavior in which add_axes returns an existing Axes if it can find one that matches the requested args and kwargs. There was probably a good reason for this, but it looks to me like excessive overloading of add_axes--making it do something other than what its name clearly states it should do. The Figure instance is a required argument when creating an Axes instance. Axes are not designed to be copied or moved between figures, as far as I can see. Eric > > yields: > > Traceback (most recent call last): > File "<stdin>", line 1, in<module> > File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 606, > in add_axes > assert(a.get_figure() is self) > AssertionError > > |
From: Paul I. <piv...@gm...> - 2011-08-13 01:01:04
|
Christopher Brown, on 2011-08-12 16:56, wrote: > I feel like I'm doing this right, but it doesn't work. Any clues? > > from matplotlib import pyplot as pp > > pp.plot((1,2,3)) > ax = pp.gca() > f = pp.figure(num=2) > print 'first: %i' % ax.figure.number > print 'second: %i' % f.number > f.add_axes(ax) > > yields: > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 606, > in add_axes > assert(a.get_figure() is self) > AssertionError Right now, matplotlib allows an axes to participate in only one figure. You can get part-way to what you want by setting ax.figure=f before calling f.add_axes(ax). Then, you'll have ax in both figures, but its transforms are still rooted in the first figure, so resizing the first figure, you'll see changes to the size of the plot in the second figure. best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |