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
(3) |
2
(5) |
3
(11) |
4
|
|
5
|
6
(8) |
7
(4) |
8
(4) |
9
(2) |
10
(4) |
11
(1) |
|
12
(3) |
13
(3) |
14
(5) |
15
(11) |
16
(8) |
17
(5) |
18
(3) |
|
19
(1) |
20
(6) |
21
(7) |
22
(5) |
23
(6) |
24
(4) |
25
(5) |
|
26
|
27
(1) |
28
(13) |
29
(4) |
30
(2) |
31
(8) |
|
|
From: Albert K. <alb...@gm...> - 2013-05-28 17:30:37
|
Correct. On Tue, May 28, 2013 at 9:42 AM, zetah <ot...@hu...> wrote: > Albert Kottke wrote: > > > >I had this problem as well. I think my solution was to tell the > >garbage collector to collect. > > > >import gc > >import numpy as np > >import matplotlib.pyplot as plt > > > >def draw_fig(arr, fn): > > fig = plt.figure() > > ax = fig.add_subplot(111) > > ax.contourf(arr) > > plt.savefig(fn) > > plt.close(fig) > > gc.collect() > > > >I tried to test this with Python3.3, but didn't have any issues > >with memory increasing when using 'plt.close'. > > > Thanks Albert, that indeed does the trick :) > > If I understand your last sentence, you are saying garbage collector > intervention isn't needed for Python 3.3. > > > Cheers > > |
|
From: zetah <ot...@hu...> - 2013-05-28 16:42:53
|
Albert Kottke wrote: > >I had this problem as well. I think my solution was to tell the >garbage collector to collect. > >import gc >import numpy as np >import matplotlib.pyplot as plt > >def draw_fig(arr, fn): > fig = plt.figure() > ax = fig.add_subplot(111) > ax.contourf(arr) > plt.savefig(fn) > plt.close(fig) > gc.collect() > >I tried to test this with Python3.3, but didn't have any issues >with memory increasing when using 'plt.close'. Thanks Albert, that indeed does the trick :) If I understand your last sentence, you are saying garbage collector intervention isn't needed for Python 3.3. Cheers |
|
From: Albert K. <alb...@gm...> - 2013-05-28 16:25:52
|
I had this problem as well. I think my solution was to tell the garbage
collector to collect.
import gc
import numpy as np
import matplotlib.pyplot as plt
def draw_fig(arr, fn):
fig = plt.figure()
ax = fig.add_subplot(111)
ax.contourf(arr)
plt.savefig(fn)
plt.close(fig)
gc.collect()
I tried to test this with Python3.3, but didn't have any issues with memory
increasing when using 'plt.close'.
On Tue, May 28, 2013 at 8:04 AM, zetah <ot...@hu...> wrote:
> "zetah" wrote:
> >
> >Eric Firing wrote:
> >>
> >> plt.close(fig) # that should take care of it
> >
> >Thanks for your quick reply.
> >
> >I tried before posting `plt.close()` and it didn't work, but also
> >`plt.close(fig)` doesn't change memory pumping with every loop.
> >BTW, I'm on Windows with Matplotlib 1.2.1
>
> I solved the problem by using animation class. If was a bit tricky, as I
> had inner loops that also were producing plots for same sequence, and from
> what I understood about this class, iterator is "frames" argument in
> FuncAnimation() function, which also returns the frame, so you may imagine
> how I solved inner loops.
> I guess there is instrumentation for such case, but documentation about
> animation class is beyond my comprehension. Also couple of blogs explaining
> basics of FuncAnimation() function weren't very helpful to me. Maybe it's
> my limitation...
>
> Anyway, I'm still curious how to close figure from my initial message, so
> that memory won't leak. I welcome your replies
>
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: klo uo <kl...@gm...> - 2013-05-28 15:19:31
|
On Tue, May 28, 2013 at 4:40 PM, Michael Droettboom wrote: > Which version of Windows are you on? Apparently, the Segoe UI font is > different on Windows 7 and 8 and I'd like to download and test with the > correct one. I'm on Windows XP, but problem was with the name of the font. This font's name is "Segoe UI" and if I reference it in matplotlibrc as "SegoeUI" (without space), then it works in all above vector formats. "Segoe UI" works only in PDF. |
|
From: Benjamin R. <ben...@ou...> - 2013-05-28 15:19:18
|
On Tue, May 28, 2013 at 3:50 AM, Nils Wagner <ni...@go...> wrote:
> Hi all,
>
> I would like to add a legend to a 3D plot.
> However, the legend ist not visible in the example given below.
> Am I missing something ?
>
> Nils
>
> import numpy as np
> from mpl_toolkits.mplot3d import Axes3D
> import matplotlib.pyplot as plt
> import random
>
> def fun(x, y):
> return x**2 + y
> def fun1(x, y):
> return 10+x**2 + y
>
> fig = plt.figure()
> ax = fig.add_subplot(111, projection='3d')
> x = y = np.arange(-3.0, 3.0, 0.05)
> X, Y = np.meshgrid(x, y)
> zs = np.array([fun(x,y) for x,y in zip(np.ravel(X), np.ravel(Y))])
> Z = zs.reshape(X.shape)
> zs = np.array([fun1(x,y) for x,y in zip(np.ravel(X), np.ravel(Y))])
> Z1 = zs.reshape(X.shape)
>
> ax.plot_surface(X, Y, Z, label=r'$f$')
> ax.plot_surface(X, Y, Z1,label=r'$f_1$')
>
> ax.set_xlabel('X Label')
> ax.set_ylabel('Y Label')
> ax.set_zlabel('Z Label')
> ax.legend()
> plt.show()
>
>
plot_surface() does not have any default representation in a legend. I
have never thought about it before, but what would one want to display for
it? It is kind of like wanting a legend entry for an imshow() or pcolor()
display. If you have something in mind to display, I would suggest using
proxy artists.
Cheers!
Ben Root
|
|
From: zetah <ot...@hu...> - 2013-05-28 15:04:39
|
"zetah" wrote: > >Eric Firing wrote: >> >> plt.close(fig) # that should take care of it > >Thanks for your quick reply. > >I tried before posting `plt.close()` and it didn't work, but also >`plt.close(fig)` doesn't change memory pumping with every loop. >BTW, I'm on Windows with Matplotlib 1.2.1 I solved the problem by using animation class. If was a bit tricky, as I had inner loops that also were producing plots for same sequence, and from what I understood about this class, iterator is "frames" argument in FuncAnimation() function, which also returns the frame, so you may imagine how I solved inner loops. I guess there is instrumentation for such case, but documentation about animation class is beyond my comprehension. Also couple of blogs explaining basics of FuncAnimation() function weren't very helpful to me. Maybe it's my limitation... Anyway, I'm still curious how to close figure from my initial message, so that memory won't leak. I welcome your replies |
|
From: Michael D. <md...@st...> - 2013-05-28 14:42:59
|
Which version of Windows are you on? Apparently, the Segoe UI font is different on Windows 7 and 8 and I'd like to download and test with the correct one. Mike On 05/28/2013 06:12 AM, klo uo wrote: > As suggested by Phil, I'm reposting github issue #2067 on this list. > > I use MPL 1.2.1 on Windows with Python 2.7.5. In my matplotlibrc I've > set sans-serif font to "Segoe UI". > > Now, if I try to save a plot to PDF, MPL saves it fine, but if I try > PS or EPS or SVG it fails, because of the font set. (If I don't change > the font everything is fine) > > Here is PDF info from mutool: > ============================================================ > PDF-1.4 > Info object (27 0 R): > << > /CreationDate (D:20130528120149+02'00') > /Producer (matplotlib pdf backend) > /Creator (matplotlib 1.2.1, http://matplotlib.sf.net) > Pages: 1 > > Retrieving info from pages 1-1... > Mediaboxes (1): > 1 ( 10 0 R): [ 0 0 576 432 ] > > Fonts (1): > 1 ( 10 0 R): Type3 'SegoeUI' (14 0 R) > ============================================================ > > > So I wonder how can MPL output PDF, but can't output PS/EPS, let aside SVG? > > > And here is full trace from IPython: > ================================================================================ > KeyError Traceback (most recent call last) > <ipython-input-63-6bec7f50eb05> in <module>() > ----> 1 savefig('test.eps') > > C:\Python27\lib\site-packages\matplotlib\pyplot.pyc in savefig(*args, **kwargs) > 470 def savefig(*args, **kwargs): > 471 fig = gcf() > --> 472 return fig.savefig(*args, **kwargs) > 473 > 474 @docstring.copy_dedent(Figure.ginput) > > C:\Python27\lib\site-packages\matplotlib\figure.pyc in savefig(self, > *args, **kwargs) > 1368 kwargs.setdefault('edgecolor', > rcParams['savefig.edgecolor']) > 1369 > -> 1370 self.canvas.print_figure(*args, **kwargs) > 1371 > 1372 if transparent: > > C:\Python27\lib\site-packages\matplotlib\backend_bases.pyc in > print_figure(self, filename, dpi, facecolor, edgecolor, orientation, > format, **kwargs) > 2094 orientation=orientation, > 2095 bbox_inches_restore=_bbox_inches_restore, > -> 2096 **kwargs) > 2097 finally: > 2098 if bbox_inches and restore_bbox: > > C:\Python27\lib\site-packages\matplotlib\backend_bases.pyc in > print_eps(self, *args, **kwargs) > 1841 from backends.backend_ps import FigureCanvasPS # lazy import > 1842 ps = self.switch_backends(FigureCanvasPS) > -> 1843 return ps.print_eps(*args, **kwargs) > 1844 > 1845 def print_pdf(self, *args, **kwargs): > > C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in > print_eps(self, outfile, *args, **kwargs) > 972 > 973 def print_eps(self, outfile, *args, **kwargs): > --> 974 return self._print_ps(outfile, 'eps', *args, **kwargs) > 975 > 976 > > C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in > _print_ps(self, outfile, format, *args, **kwargs) > 1005 self._print_figure(outfile, format, imagedpi, > facecolor, edgecolor, > 1006 orientation, isLandscape, papertype, > -> 1007 **kwargs) > 1008 > 1009 def _print_figure(self, outfile, format, dpi=72, > facecolor='w', edgecolor='w', > > C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in > _print_figure(self, outfile, format, dpi, facecolor, edgecolor, > orientation, isLandscape, papertype, **kwargs) > 1098 bbox_inches_restore=_bbox_inches_restore) > 1099 > -> 1100 self.figure.draw(renderer) > 1101 > 1102 if dryrun: # return immediately if dryrun (tightbbox=True) > > C:\Python27\lib\site-packages\matplotlib\artist.pyc in > draw_wrapper(artist, renderer, *args, **kwargs) > 52 def draw_wrapper(artist, renderer, *args, **kwargs): > 53 before(artist, renderer) > ---> 54 draw(artist, renderer, *args, **kwargs) > 55 after(artist, renderer) > 56 > > C:\Python27\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer) > 1004 dsu.sort(key=itemgetter(0)) > 1005 for zorder, a, func, args in dsu: > -> 1006 func(*args) > 1007 > 1008 renderer.close_group('figure') > > C:\Python27\lib\site-packages\matplotlib\artist.pyc in > draw_wrapper(artist, renderer, *args, **kwargs) > 52 def draw_wrapper(artist, renderer, *args, **kwargs): > 53 before(artist, renderer) > ---> 54 draw(artist, renderer, *args, **kwargs) > 55 after(artist, renderer) > 56 > > C:\Python27\lib\site-packages\matplotlib\axes.pyc in draw(self, > renderer, inframe) > 2084 > 2085 for zorder, a in dsu: > -> 2086 a.draw(renderer) > 2087 > 2088 renderer.close_group('axes') > > C:\Python27\lib\site-packages\matplotlib\artist.pyc in > draw_wrapper(artist, renderer, *args, **kwargs) > 52 def draw_wrapper(artist, renderer, *args, **kwargs): > 53 before(artist, renderer) > ---> 54 draw(artist, renderer, *args, **kwargs) > 55 after(artist, renderer) > 56 > > C:\Python27\lib\site-packages\matplotlib\axis.pyc in draw(self, > renderer, *args, **kwargs) > 1053 > 1054 for tick in ticks_to_draw: > -> 1055 tick.draw(renderer) > 1056 > 1057 # scale up the axis label box to also find the neighbors, not > > C:\Python27\lib\site-packages\matplotlib\artist.pyc in > draw_wrapper(artist, renderer, *args, **kwargs) > 52 def draw_wrapper(artist, renderer, *args, **kwargs): > 53 before(artist, renderer) > ---> 54 draw(artist, renderer, *args, **kwargs) > 55 after(artist, renderer) > 56 > > C:\Python27\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer) > 238 > 239 if self.label1On: > --> 240 self.label1.draw(renderer) > 241 if self.label2On: > 242 self.label2.draw(renderer) > > C:\Python27\lib\site-packages\matplotlib\artist.pyc in > draw_wrapper(artist, renderer, *args, **kwargs) > 52 def draw_wrapper(artist, renderer, *args, **kwargs): > 53 before(artist, renderer) > ---> 54 draw(artist, renderer, *args, **kwargs) > 55 after(artist, renderer) > 56 > > C:\Python27\lib\site-packages\matplotlib\text.pyc in draw(self, renderer) > 594 renderer.draw_text(gc, x, y, clean_line, > 595 self._fontproperties, angle, > --> 596 ismath=ismath) > 597 > 598 gc.restore() > > C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in > draw_text(self, gc, x, y, s, prop, angle, ismath) > 749 > 750 self.set_color(*gc.get_rgb()) > --> 751 self.set_font(font.get_sfnt()[(1,0,0,6)], > prop.get_size_in_points()) > 752 > 753 cmap = font.get_charmap() > > KeyError: (1, 0, 0, 6) > ================================================================================ > > ------------------------------------------------------------------------------ > Try New Relic Now & We'll Send You this Cool Shirt > New Relic is the only SaaS-based application performance monitoring service > that delivers powerful full stack analytics. Optimize and monitor your > browser, app, & servers with just a few lines of code. Try New Relic > and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: ratomatrix <rat...@gm...> - 2013-05-28 11:32:25
|
Hi, Gregorio Bastardo wrote > When I use the "Zoom-to-rectangle" button of > the navigation toolbar while holding the x or y key, sometimes nothing > happens when the mouse is released. I have also experienced the same behavior, and I still don't know what it exactly depends on. It works most of the time, but sometimes it is almost impossible to zoom to the desired area. Gregorio Bastardo wrote > python 2.7.4 win32 > matplotlib 1.1.1 and 1.2.1 > PyQt4 QtCore 4.8.3 > PySide QtCore 4.8.3 > PySide 1.1.2 I have python 2.7.3 win32 with matplotlib 1.1.1 and PySide 1.1.2, but it is the same with the default Tk backend as well. Any help would be appreciated. Thanks, Tom -- View this message in context: http://matplotlib.1069221.n5.nabble.com/constrained-rectangular-zoom-does-not-always-work-with-Qt4-backend-tp41108p41142.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: klo uo <kl...@gm...> - 2013-05-28 10:13:06
|
As suggested by Phil, I'm reposting github issue #2067 on this list. I use MPL 1.2.1 on Windows with Python 2.7.5. In my matplotlibrc I've set sans-serif font to "Segoe UI". Now, if I try to save a plot to PDF, MPL saves it fine, but if I try PS or EPS or SVG it fails, because of the font set. (If I don't change the font everything is fine) Here is PDF info from mutool: ============================================================ PDF-1.4 Info object (27 0 R): << /CreationDate (D:20130528120149+02'00') /Producer (matplotlib pdf backend) /Creator (matplotlib 1.2.1, http://matplotlib.sf.net) >> Pages: 1 Retrieving info from pages 1-1... Mediaboxes (1): 1 ( 10 0 R): [ 0 0 576 432 ] Fonts (1): 1 ( 10 0 R): Type3 'SegoeUI' (14 0 R) ============================================================ So I wonder how can MPL output PDF, but can't output PS/EPS, let aside SVG? And here is full trace from IPython: ================================================================================ KeyError Traceback (most recent call last) <ipython-input-63-6bec7f50eb05> in <module>() ----> 1 savefig('test.eps') C:\Python27\lib\site-packages\matplotlib\pyplot.pyc in savefig(*args, **kwargs) 470 def savefig(*args, **kwargs): 471 fig = gcf() --> 472 return fig.savefig(*args, **kwargs) 473 474 @docstring.copy_dedent(Figure.ginput) C:\Python27\lib\site-packages\matplotlib\figure.pyc in savefig(self, *args, **kwargs) 1368 kwargs.setdefault('edgecolor', rcParams['savefig.edgecolor']) 1369 -> 1370 self.canvas.print_figure(*args, **kwargs) 1371 1372 if transparent: C:\Python27\lib\site-packages\matplotlib\backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, **kwargs) 2094 orientation=orientation, 2095 bbox_inches_restore=_bbox_inches_restore, -> 2096 **kwargs) 2097 finally: 2098 if bbox_inches and restore_bbox: C:\Python27\lib\site-packages\matplotlib\backend_bases.pyc in print_eps(self, *args, **kwargs) 1841 from backends.backend_ps import FigureCanvasPS # lazy import 1842 ps = self.switch_backends(FigureCanvasPS) -> 1843 return ps.print_eps(*args, **kwargs) 1844 1845 def print_pdf(self, *args, **kwargs): C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in print_eps(self, outfile, *args, **kwargs) 972 973 def print_eps(self, outfile, *args, **kwargs): --> 974 return self._print_ps(outfile, 'eps', *args, **kwargs) 975 976 C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in _print_ps(self, outfile, format, *args, **kwargs) 1005 self._print_figure(outfile, format, imagedpi, facecolor, edgecolor, 1006 orientation, isLandscape, papertype, -> 1007 **kwargs) 1008 1009 def _print_figure(self, outfile, format, dpi=72, facecolor='w', edgecolor='w', C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in _print_figure(self, outfile, format, dpi, facecolor, edgecolor, orientation, isLandscape, papertype, **kwargs) 1098 bbox_inches_restore=_bbox_inches_restore) 1099 -> 1100 self.figure.draw(renderer) 1101 1102 if dryrun: # return immediately if dryrun (tightbbox=True) C:\Python27\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 52 def draw_wrapper(artist, renderer, *args, **kwargs): 53 before(artist, renderer) ---> 54 draw(artist, renderer, *args, **kwargs) 55 after(artist, renderer) 56 C:\Python27\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer) 1004 dsu.sort(key=itemgetter(0)) 1005 for zorder, a, func, args in dsu: -> 1006 func(*args) 1007 1008 renderer.close_group('figure') C:\Python27\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 52 def draw_wrapper(artist, renderer, *args, **kwargs): 53 before(artist, renderer) ---> 54 draw(artist, renderer, *args, **kwargs) 55 after(artist, renderer) 56 C:\Python27\lib\site-packages\matplotlib\axes.pyc in draw(self, renderer, inframe) 2084 2085 for zorder, a in dsu: -> 2086 a.draw(renderer) 2087 2088 renderer.close_group('axes') C:\Python27\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 52 def draw_wrapper(artist, renderer, *args, **kwargs): 53 before(artist, renderer) ---> 54 draw(artist, renderer, *args, **kwargs) 55 after(artist, renderer) 56 C:\Python27\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer, *args, **kwargs) 1053 1054 for tick in ticks_to_draw: -> 1055 tick.draw(renderer) 1056 1057 # scale up the axis label box to also find the neighbors, not C:\Python27\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 52 def draw_wrapper(artist, renderer, *args, **kwargs): 53 before(artist, renderer) ---> 54 draw(artist, renderer, *args, **kwargs) 55 after(artist, renderer) 56 C:\Python27\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer) 238 239 if self.label1On: --> 240 self.label1.draw(renderer) 241 if self.label2On: 242 self.label2.draw(renderer) C:\Python27\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *args, **kwargs) 52 def draw_wrapper(artist, renderer, *args, **kwargs): 53 before(artist, renderer) ---> 54 draw(artist, renderer, *args, **kwargs) 55 after(artist, renderer) 56 C:\Python27\lib\site-packages\matplotlib\text.pyc in draw(self, renderer) 594 renderer.draw_text(gc, x, y, clean_line, 595 self._fontproperties, angle, --> 596 ismath=ismath) 597 598 gc.restore() C:\Python27\lib\site-packages\matplotlib\backends\backend_ps.pyc in draw_text(self, gc, x, y, s, prop, angle, ismath) 749 750 self.set_color(*gc.get_rgb()) --> 751 self.set_font(font.get_sfnt()[(1,0,0,6)], prop.get_size_in_points()) 752 753 cmap = font.get_charmap() KeyError: (1, 0, 0, 6) ================================================================================ |
|
From: zetah <ot...@hu...> - 2013-05-28 08:15:57
|
Eric Firing wrote: > > plt.close(fig) # that should take care of it Thanks for your quick reply. I tried before posting `plt.close()` and it didn't work, but also `plt.close(fig)` doesn't change memory pumping with every loop. BTW, I'm on Windows with Matplotlib 1.2.1 |
|
From: Eric F. <ef...@ha...> - 2013-05-28 08:04:17
|
On 2013/05/27 9:51 PM, zetah wrote:
> Hi,
>
> if I use something like this:
>
> ==================================================
> import numpy as np
> import matplotlib.pyplot as plt
>
> def draw_fig(arr, fn):
> fig = plt.figure()
> ax = fig.add_subplot(111)
> ax.contourf(arr)
> plt.savefig(fn)
plt.close(fig) # that should take care of it
>
> if __name__ == '__main__':
> for i in range(10):
> draw_fig(np.random.random((10, 10)), 'fig_%02d.png' % i)
> ==================================================
>
> memory usage grows with every loop, so I can't plot this way many sequences.
>
> I know there is animation class in Matplotlib, but this way is easier to me, and I think I miss something fundamental because this is happening. How can I avoid memory leak using this approach?
>
> Thanks
>
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
|
|
From: zetah <ot...@hu...> - 2013-05-28 07:51:24
|
Hi,
if I use something like this:
==================================================
import numpy as np
import matplotlib.pyplot as plt
def draw_fig(arr, fn):
fig = plt.figure()
ax = fig.add_subplot(111)
ax.contourf(arr)
plt.savefig(fn)
if __name__ == '__main__':
for i in range(10):
draw_fig(np.random.random((10, 10)), 'fig_%02d.png' % i)
==================================================
memory usage grows with every loop, so I can't plot this way many sequences.
I know there is animation class in Matplotlib, but this way is easier to me, and I think I miss something fundamental because this is happening. How can I avoid memory leak using this approach?
Thanks
|
|
From: Nils W. <ni...@go...> - 2013-05-28 07:50:11
|
Hi all,
I would like to add a legend to a 3D plot.
However, the legend ist not visible in the example given below.
Am I missing something ?
Nils
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import random
def fun(x, y):
return x**2 + y
def fun1(x, y):
return 10+x**2 + y
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
x = y = np.arange(-3.0, 3.0, 0.05)
X, Y = np.meshgrid(x, y)
zs = np.array([fun(x,y) for x,y in zip(np.ravel(X), np.ravel(Y))])
Z = zs.reshape(X.shape)
zs = np.array([fun1(x,y) for x,y in zip(np.ravel(X), np.ravel(Y))])
Z1 = zs.reshape(X.shape)
ax.plot_surface(X, Y, Z, label=r'$f$')
ax.plot_surface(X, Y, Z1,label=r'$f_1$')
ax.set_xlabel('X Label')
ax.set_ylabel('Y Label')
ax.set_zlabel('Z Label')
ax.legend()
plt.show()
|