SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(16)
2
(16)
3
(5)
4
(4)
5
(4)
6
(10)
7
(33)
8
(11)
9
(20)
10
(7)
11
(8)
12
(18)
13
(27)
14
(21)
15
(15)
16
(10)
17
(12)
18
(3)
19
(12)
20
(12)
21
(14)
22
(32)
23
(15)
24
(20)
25
(12)
26
(32)
27
(29)
28
(17)
29
(25)
30
(12)
31
(5)

Showing 9 results of 9

From: Eric F. <ef...@ha...> - 2010年07月16日 21:31:43
I am always looking for ways to make mpl maintenance easier, and one way 
is to delete unused code. In that spirit, I am wondering:
Is anyone out there actually using the fltkagg backend?
Thanks.
Eric
From: Simon F. <sim...@a-...> - 2010年07月16日 17:34:54
Hello List.
Is it just me or does the alignment in the picture at
http://matplotlib.sourceforge.net/users/text_props.html
look off?
Best
Simon
From: Eric F. <ef...@ha...> - 2010年07月16日 16:48:57
On 07/16/2010 01:32 AM, K.-Michael Aye wrote:
> On 2010年07月14日 19:11:58 +0200, K.-Michael Aye said:
>
>> On 2010年07月14日 18:51:26 +0200, K.-Michael Aye said:
>>
>>> On 2010年07月14日 18:45:35 +0200, John Hunter said:
>>>
>>>> On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye
>>>> <kmi...@gm...> wrote:
>>>>
>>>>> Out[12]: 1
>>>>>
>>>>> In [13]: gc.collect()
>>>>>
>>>>> Out[13]: 12
>>>>
>>>>
>>>> still not seeing a leak in your data -- you need to report_memory
>>>> after calling gc collect. Turn off hold, add an image, call collect,
>>>> report memory, the repeat several times, each time calling collect and
>>>> report memory, and report the results.
>>>
>>> Was just following your example, you were nowhere calling collect.
>>> Here is what you requested:
>>>
>>> In [1]: import gc
>>>
>>> In [2]: import matplotlib.cbook as cbook
>>>
>>> In [3]: data = ones((1500,1500,3))
>>>
>>> In [4]: hold(False)
>>>
>>> In [5]: imshow(data)
>>>
>>> Out[5]:<matplotlib.image.AxesImage object at 0x1c43e50>
>>>
>>> In [6]: gc.collect()
>>>
>>> Out[6]: 12
>>>
>>> In [7]: cbook.report_memory()
>>>
>>> Out[7]: 174540
>>>
>>> In [8]: imshow(data)
>>>
>>> Out[8]:<matplotlib.image.AxesImage object at 0x1c59e90>
>>>
>>> In [9]: gc.collect()
>>>
>>> Out[9]: 0
>>>
>>> In [10]: cbook.report_memory()
>>>
>>> Out[10]: 253400
>>>
>>> In [11]: imshow(data)
>>>
>>> Out[11]:<matplotlib.image.AxesImage object at 0x1c603b0>
>>>
>>> In [12]: gc.collect()
>>>
>>> Out[12]: 0
>>>
>>> In [13]: cbook.report_memory()
>>>
>>> Out[13]: 333360
>>>
>>> In [14]: imshow(data)
>>>
>>> Out[14]:<matplotlib.image.AxesImage object at 0x1c60410>
>>>
>>> In [15]: gc.collect()
>>>
>>> Out[15]: 0
>>>
>>> In [16]: cbook.report_memory()
>>>
>>> Out[16]: 413296
>>>
>>
>>
>> Here are the commands as macro form, for easy cut and paste into pylab:
>>
>> import gc
>> import matplotlib.cbook as cbook
>> data = ones((1500,1500,3))
>> hold(False)
>> imshow(data)
>> gc.collect()
>> cbook.report_memory()
>> imshow(data)
>> gc.collect()
>> cbook.report_memory()
>> imshow(data)
>> gc.collect()
>> cbook.report_memory()
>> imshow(data)
>> gc.collect()
>> cbook.report_memory()
>
> Furthermore,
> deleting images from ax.images does not free memory :
Maybe because ipython is keeping a reference to every AxesImage object 
that you make...
Eric
>
> In [1]: import gc
>
> In [2]: import matplotlib.cbook as cbook
>
> In [3]: data = ones((1500,1500,3))
>
> In [4]: imshow data
> ------> imshow(data)
>
> Out[4]:<matplotlib.image.AxesImage object at 0x1c57550>
>
> In [5]: imshow data
> ------> imshow(data)
>
> Out[5]:<matplotlib.image.AxesImage object at 0x1c442b0>
>
> In [6]: imshow data
> ------> imshow(data)
>
> Out[6]:<matplotlib.image.AxesImage object at 0x1400cd0>
>
> In [7]: imshow data
> ------> imshow(data)
>
> Out[7]:<matplotlib.image.AxesImage object at 0x1414cb0>
>
> In [8]: ax =gca()
>
> In [9]: ax.images
>
> Out[9]:
> [<matplotlib.image.AxesImage object at 0x1c57550>,
> <matplotlib.image.AxesImage object at 0x1c442b0>,
> <matplotlib.image.AxesImage object at 0x1400cd0>,
> <matplotlib.image.AxesImage object at 0x1414cb0>]
>
> In [10]: gc.collect()
>
> Out[10]: 15
>
> In [11]: cbook.report_memory()
>
> Out[11]: 414588
>
> In [12]: del ax.images[:-1]
>
> In [13]: gc.collect()
>
> Out[13]: 3
>
> In [14]: cbook.report_memory()
>
> Out[14]: 414600
>
From: Simon F. <sim...@a-...> - 2010年07月16日 15:11:41
Hello List.
I'm trying to plot a confusion matrix and I got this far:
http://paste.pocoo.org/show/238332/
Basically what I still want to do is get the ticklabels from the bottom
to the top, have every ticklabel shown and start showing them from the
first not from the second.
I have experimented with this for a while now and don't have all the
code states at hand anymore but basically at several points some of the
above worked but the others didn't or something else (like the axis
length) broke.
Best
Simon
From: Benjamin R. <ben...@ou...> - 2010年07月16日 14:40:39
Please attach the code you used to generate this image.
Ben Root
On Fri, Jul 16, 2010 at 7:11 AM, Waléria Antunes David <
wal...@gm...> wrote:
> I forgot of the my image.
>
>
> On Fri, Jul 16, 2010 at 9:10 AM, Waléria Antunes David <
> wal...@gm...> wrote:
>
>> Hi...
>>
>> I tried the first option, but failed.... see my image attached
>>
>> And the second option, i don't understand the variable 'val'
>>
>> ...?
>>
>>
>> On Thu, Jul 15, 2010 at 3:22 PM, Ryan May <rm...@gm...> wrote:
>>
>>> On Thu, Jul 15, 2010 at 8:41 AM, Waléria Antunes David
>>> <wal...@gm...> wrote:
>>> > Hi all,
>>> >
>>> > I have a code base so that:
>>> >
>>> >
>>> > from pylab import *
>>> > x = arange (3000,3400)
>>> > y = -108 * (3.0e14 ** 2)/x**2
>>> >
>>> > pylab..title("Teste")
>>> > pylab.savefig("imagem.png")
>>> > plot(x, y)
>>> >
>>> >
>>> > Well.... the values of the function range(3000,3400) are in Hz......i
>>> need
>>> > to pass GHz which would be in scientific notation as follows bellow:
>>> >
>>> > 3000 Hz = 3,0 ×ばつ 10-6 GHz
>>> > 3400 Hz = 3,4 x 10-6 Ghz
>>> >
>>> > How do I make the graph x-axis is shown in figures
>>> > scientific notation, for this currently so
>>> >
>>> > 3000,3050,3100,....,3400
>>> >
>>> > in scientific notation is: (3.0e-6, 3.4e-6)
>>>
>>> One way is to just change the values in the GHz and plot them:
>>>
>>> plot(x/1e9, y)
>>> # Need to change some limits so that they show up in scientific notation:
>>> gca().xaxis.get_major_formatter().set_powerlimits((-5,5))
>>>
>>> The other way is make a custom formatter that changes the values of the
>>> ticks:
>>>
>>> def fmt_ghz(val, pos=None):
>>> return '%g' % (val / 1e9)
>>>
>>> plot(x, y)
>>> gca().xaxis.set_major_formatter(FuncFormatter(fmt_ghz))
>>>
>>> You can get more information here:
>>> http://matplotlib.sourceforge.net/api/ticker_api.html
>>>
>>> Ryan
>>>
>>> --
>>> Ryan May
>>> Graduate Research Assistant
>>> School of Meteorology
>>> University of Oklahoma
>>>
>>
>>
>
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Bartosz T. <b.t...@bi...> - 2010年07月16日 13:17:36
Hi all,
I am trying to create legend with multiple-line labels, but I noticed that the labels are not properly aligned. I tried also changing the alignment of the text objects to center, but this requires separate handling of multi-line and single-line labels:
import matplotlib.pyplot as plt
plt.plot([1,2,3], label"multi\nline 1")
plt.plot([1,2,3], label="multi\nline 1")
plt.plot([1,2,3], label="multi\nline 2")
plt.plot([1,2,3], label=" single line")
leg=plt.legend()
#change alignment of multiline labels only
plt.setp(leg.get_texts()[:2], va='center')
I found a discussion thread on this topic:
http://article.gmane.org/gmane.comp.python.matplotlib.devel/6116
Is there a way to achieve a clean rendering independent of number of lines?
Yours,
Bartosz
From: Waléria A. D. <wal...@gm...> - 2010年07月16日 12:11:02
Hi...
I tried the first option, but failed.... see my image attached
And the second option, i don't understand the variable 'val'
...?
On Thu, Jul 15, 2010 at 3:22 PM, Ryan May <rm...@gm...> wrote:
> On Thu, Jul 15, 2010 at 8:41 AM, Waléria Antunes David
> <wal...@gm...> wrote:
> > Hi all,
> >
> > I have a code base so that:
> >
> >
> > from pylab import *
> > x = arange (3000,3400)
> > y = -108 * (3.0e14 ** 2)/x**2
> >
> > pylab..title("Teste")
> > pylab.savefig("imagem.png")
> > plot(x, y)
> >
> >
> > Well.... the values of the function range(3000,3400) are in Hz......i
> need
> > to pass GHz which would be in scientific notation as follows bellow:
> >
> > 3000 Hz = 3,0 ×ばつ 10-6 GHz
> > 3400 Hz = 3,4 x 10-6 Ghz
> >
> > How do I make the graph x-axis is shown in figures
> > scientific notation, for this currently so
> >
> > 3000,3050,3100,....,3400
> >
> > in scientific notation is: (3.0e-6, 3.4e-6)
>
> One way is to just change the values in the GHz and plot them:
>
> plot(x/1e9, y)
> # Need to change some limits so that they show up in scientific notation:
> gca().xaxis.get_major_formatter().set_powerlimits((-5,5))
>
> The other way is make a custom formatter that changes the values of the
> ticks:
>
> def fmt_ghz(val, pos=None):
> return '%g' % (val / 1e9)
>
> plot(x, y)
> gca().xaxis.set_major_formatter(FuncFormatter(fmt_ghz))
>
> You can get more information here:
> http://matplotlib.sourceforge.net/api/ticker_api.html
>
> Ryan
>
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
>
From: K.-Michael A. <kmi...@gm...> - 2010年07月16日 11:32:41
On 2010年07月14日 19:11:58 +0200, K.-Michael Aye said:
> On 2010年07月14日 18:51:26 +0200, K.-Michael Aye said:
> 
>> On 2010年07月14日 18:45:35 +0200, John Hunter said:
>> 
>>> On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye
>>> <kmi...@gm...> wrote:
>>> 
>>>> Out[12]: 1
>>>> 
>>>> In [13]: gc.collect()
>>>> 
>>>> Out[13]: 12
>>> 
>>> 
>>> still not seeing a leak in your data -- you need to report_memory
>>> after calling gc collect. Turn off hold, add an image, call collect,
>>> report memory, the repeat several times, each time calling collect and
>>> report memory, and report the results.
>> 
>> Was just following your example, you were nowhere calling collect.
>> Here is what you requested:
>> 
>> In [1]: import gc
>> 
>> In [2]: import matplotlib.cbook as cbook
>> 
>> In [3]: data = ones((1500,1500,3))
>> 
>> In [4]: hold(False)
>> 
>> In [5]: imshow(data)
>> 
>> Out[5]: <matplotlib.image.AxesImage object at 0x1c43e50>
>> 
>> In [6]: gc.collect()
>> 
>> Out[6]: 12
>> 
>> In [7]: cbook.report_memory()
>> 
>> Out[7]: 174540
>> 
>> In [8]: imshow(data)
>> 
>> Out[8]: <matplotlib.image.AxesImage object at 0x1c59e90>
>> 
>> In [9]: gc.collect()
>> 
>> Out[9]: 0
>> 
>> In [10]: cbook.report_memory()
>> 
>> Out[10]: 253400
>> 
>> In [11]: imshow(data)
>> 
>> Out[11]: <matplotlib.image.AxesImage object at 0x1c603b0>
>> 
>> In [12]: gc.collect()
>> 
>> Out[12]: 0
>> 
>> In [13]: cbook.report_memory()
>> 
>> Out[13]: 333360
>> 
>> In [14]: imshow(data)
>> 
>> Out[14]: <matplotlib.image.AxesImage object at 0x1c60410>
>> 
>> In [15]: gc.collect()
>> 
>> Out[15]: 0
>> 
>> In [16]: cbook.report_memory()
>> 
>> Out[16]: 413296
>> 
> 
> 
> Here are the commands as macro form, for easy cut and paste into pylab:
> 
> import gc
> import matplotlib.cbook as cbook
> data = ones((1500,1500,3))
> hold(False)
> imshow(data)
> gc.collect()
> cbook.report_memory()
> imshow(data)
> gc.collect()
> cbook.report_memory()
> imshow(data)
> gc.collect()
> cbook.report_memory()
> imshow(data)
> gc.collect()
> cbook.report_memory()
Furthermore,
deleting images from ax.images does not free memory :
In [1]: import gc
In [2]: import matplotlib.cbook as cbook
In [3]: data = ones((1500,1500,3))
In [4]: imshow data
------> imshow(data)
Out[4]: <matplotlib.image.AxesImage object at 0x1c57550>
In [5]: imshow data
------> imshow(data)
Out[5]: <matplotlib.image.AxesImage object at 0x1c442b0>
In [6]: imshow data
------> imshow(data)
Out[6]: <matplotlib.image.AxesImage object at 0x1400cd0>
In [7]: imshow data
------> imshow(data)
Out[7]: <matplotlib.image.AxesImage object at 0x1414cb0>
In [8]: ax =gca()
In [9]: ax.images
Out[9]:
[<matplotlib.image.AxesImage object at 0x1c57550>,
 <matplotlib.image.AxesImage object at 0x1c442b0>,
 <matplotlib.image.AxesImage object at 0x1400cd0>,
 <matplotlib.image.AxesImage object at 0x1414cb0>]
In [10]: gc.collect()
Out[10]: 15
In [11]: cbook.report_memory()
Out[11]: 414588
In [12]: del ax.images[:-1]
In [13]: gc.collect()
Out[13]: 3
In [14]: cbook.report_memory()
Out[14]: 414600
From: Jeff B. <jj...@em...> - 2010年07月16日 03:55:27
Hi,
I'm using the new mixed axes feature in matplotlib 1.0.0 to combine 3D and 2D plots in a single figure. The problem is that the 3D axes have a lot of extra white space around them that prevents the plot to line up flush with the 2D plot. Here is an example image of this:
using matplotlib: http://www.u.arizona.edu/~jjberry/matplotlib.png
vs. matlab of the same thing: http://www.u.arizona.edu/~jjberry/matlab.png
Is there any way of changing the space on the 3D axis to look more like the matlab figure?
Thanks,
Jeff Berry
1 message has been excluded from this view by a project administrator.

Showing 9 results of 9

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /