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




Showing 11 results of 11

From: Jose Gomez-D. <jgo...@gm...> - 2009年03月05日 20:44:23
Jeff,
Solved, I think!
2009年3月3日 Jose Gomez-Dans <jgo...@gm...>:
> OK, I wasn't aware of this. However, memory consumption still flies. I am
> aware that it could be other bits of the program that are eating up loads of
> memory, but I don't know how to test where the bottleneck is. In the end, I
> resorted to getting rid of basemap instances, but the problem persists.
> There must be something in what I'm doing that's eating memory up, but I'm
> not sure how to check what it is.
A message to the list suggested that calling pyplot.close( fig_num)
freed up the memory used, which I'm happy to report, is happening. I
still haven't managed to "cut and paste" a background into my figures,
but we'll get there... eventually!!!
Thanks!
Jose
From: Timmie <tim...@gm...> - 2009年03月05日 18:40:57
Hello,
I tried to modify the bar chart demo for my case.
I want to plot only bar charts for one data set.
But the xticklables are not centered below the bars, rather are they left in
place as if there were still two data sets.
How do I modify set_xticklabels in oder to get the lables centered below the bar
one data set?
Thanks in advance,
Timmie
#### modified bar charts demo 
#!/usr/bin/env python
# a bar plot with errorbars
import numpy as np
import matplotlib.pyplot as plt
N = 5
menMeans = (20, 35, 30, 35, 27)
menStd = (2, 3, 4, 1, 2)
ind = np.arange(N) # the x locations for the groups
width = 0.35 # the width of the bars
fig = plt.figure()
ax = fig.add_subplot(111)
rects1 = ax.bar(ind, menMeans, width, color='r', yerr=menStd)
womenMeans = (25, 32, 34, 20, 25)
womenStd = (3, 5, 2, 3, 3)
#~ rects2 = ax.bar(ind+width, womenMeans, width, color='y', yerr=womenStd)
# add some
ax.set_ylabel('Scores')
ax.set_title('Scores by group and gender')
ax.set_xticks(ind+width)
ax.set_xticklabels( ('G1', 'G2', 'G3', 'G4', 'G5'), multialignment='left',
position=(-2,0) )
#~ ax.legend( (rects1[0], rects2[0]), ('Men', 'Women') )
def autolabel(rects):
 # attach some text labels
 for rect in rects:
 #~ print rect
 height = rect.get_height()
 print height
 ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
 ha='center', va='bottom')
 
autolabel(rects1)
#~ autolabel(rects2)
plt.show()
From: Chaitanya K. <ic...@gm...> - 2009年03月05日 17:10:57
Hi all,
I am wondering how I can get space in the axis label while using the Latex mode.
That is, when I use pylab.ylabel(r'$V [A^{3}]$') I don't get any space
in between V and [.
I also tried using the math mode spacing for Latex, So, if I try to do
pylab.ylabel(r'$V\;[A^{3}]$'), I only get V and not even A^3.
Any help is appreciated.
Chaitanya
From: Erik G. <egr...@gm...> - 2009年03月05日 17:03:47
Hello,
I found an issue in working with subplots and using figlegend: it
doesn't display markers. This code illustrates the problem:
x=r_[0.:11.:1.]
y=x**1.5
figure()
subplot(211)
line=plot(x,y,'sb-.')
figlegend( (line,),('y',),'right' )
Supplying the "numpoints" keyword to figlegend doesn't seem to have
any effect, ie. I get the same results with:
figlegend( (line,),('y',),'right',numpoints=10 )
Is this the intended behavior? Is there a good way to display the markers?
I did find a workaround, but I don't think this is the ideal method:
x=r_[0.:11.:1.]
y=x**1.5
figure()
subplot(111)
line=plot(x,y,'sb-.')
figlegend( (line,),('y',),'right' )
subplot(211)
line=plot(x,y,'sb-.')
Thanks,
-Erik
From: Erik G. <egr...@gm...> - 2009年03月05日 16:18:37
Hello,
I am generating a figure with 4 subplots, then using the "figlegend"
command to generate a legend on the right side of the four plots.
This is part of a script designed to handle varrying numbers of lines
to be plotted, so sometimes the legend has many entries and sometimes
it has a few. Is there an easy way to prevent the legend from
extending beyond the figure boundaries when the legend has many
entries, ie. to automatically adjust the vertical spacing in the
legend, font size, etc. to make it fit?
Thanks,
-Erik
From: Ryan M. <rm...@gm...> - 2009年03月05日 15:50:27
On Thu, Mar 5, 2009 at 1:56 AM, Torsten Bronger <
br...@ph...> wrote:
> Hallöchen!
>
> In my web app, I have an "about" page which contains the major
> components, together with the logos (Ubuntu, Apache, Django etc).
> http://matplotlib.sourceforge.net/_static/logo2.png is too wide, and
> since the name is in the list anyway, I'd like to have the circular
> plot itself. Do you have it separately, or the Python code which
> generates it? Thank you!
You can find the script here:
http://matplotlib.sourceforge.net/examples/api/logo2.html
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from: Norman Oklahoma United States.
From: Jorg R. <jo...@ne...> - 2009年03月05日 15:32:58
Hi
I'm plotting a value for each day as bars, and another value for the same
exact time as a regular graph. The problem is that the bars overlap, so I
thought I could try to make the plot wider, to make more room, but I have
been unable to do so. I was thinking that if I increased the space between
ticks, that would solve the problem, but I've not found out how that is
done either. Can I control the space between the ticks?
I would be grateful for any hints into how I could solve this:)
My graph looks like this:
http://neoplex.org/bob/test.png
And my code looks like this:
http://neoplex.org/bob/plot_packages.py.txt
And if it matters, the data is here:
http://neoplex.org/bob/data.txt
regards
Jorg
From: Timmie <tim...@gm...> - 2009年03月05日 15:00:10
Hello,
I have a question regarding autolabels for bar charts.
It seems that the pie charts have already incorporated such a functionality [1].
Is there any reason why this isn't built in the bar chart function [2]?
The function I am referring to is:
def autolabel(rects):
 # attach some text labels
 for rect in rects:
 #~ print rect
 height = rect.get_height()
 print height
 ax.text(rect.get_x()+rect.get_width()/2., 1.05*height, '%d'%int(height),
 ha='center', va='bottom')
Thanks in advance for the clarification,
Timmie
[1]
http://matplotlib.sourceforge.net/examples/pylab_examples/pie_demo.html?highlight=autolabel
[2]
http://matplotlib.sourceforge.net/examples/api/barchart_demo.html?highlight=autolabel
From: Michael D. <md...@st...> - 2009年03月05日 13:10:01
There are at least three possible causes of what you're seeing here:
1) ipython stores references to all results in the console. (ipython 
maintains a history of results so they can easily be accessed later). I 
don't recall the details, but it may be possible to turn this feature 
off or limit the number of objects stored.
2) matplotlib stores references to all figures until they are explicitly 
closed with pyplot.close(fignum)
3) Python uses pools of memory, and is often imposes a significant delay 
returning memory to the operating system. It is actually very hard to 
determine from the outside whether something is leaking or just pooling 
without compiling a special build of Python with memory pooling turned off.
In general, interactive use is somewhat at odds with creating many large 
plots in a single session, since all of the nice interactive features 
(history etc.) do not know automagically when the user is done with 
certain objects.
I am not aware of any memory leaks in current versions of matplotlib 
with *noninteractive* use, other than small leaks caused by bugs in 
older versions of some of the GUI toolkits (notably gtk+). If you find 
a script that produces a leak reproducibly, please share so we can track 
down the cause.
Gary Ruben wrote:
> Doing 
> plot(rand(1000000)) or matshow(rand(1000,1000)) for example eats a big 
> chunk of memory (tried with TkAgg and WxAgg in Windows (mpl v0.98.5.2) 
> and Linux (mpl v0.98.3)), most of which is not returned when the window 
> is closed. The same goes if you create an array, plot it, and explicitly 
> del it after closing the window.
Can you elaborate on these steps? It's possible that the del has little 
effect, since del only deletes a single reference to the object, not all 
references which may be keeping it alive (such as the figure, which 
matplotlib itself keeps a reference to). In general, you need to 
explicitly call pyplot.close(fignum) to delete a figure.
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Torsten B. <br...@ph...> - 2009年03月05日 07:57:24
Hallöchen!
In my web app, I have an "about" page which contains the major
components, together with the logos (Ubuntu, Apache, Django etc).
http://matplotlib.sourceforge.net/_static/logo2.png is too wide, and
since the name is in the list anyway, I'd like to have the circular
plot itself. Do you have it separately, or the Python code which
generates it? Thank you!
Tschö,
Torsten.
P.S.: Cutting it out didn't work because of the background.
-- 
Torsten Bronger, aquisgrana, europa vetus
 Jabber ID: tor...@ja...
From: Gary R. <gr...@bi...> - 2009年03月05日 04:25:25
Is there a summary somewhere of the current state of knowledge about 
memory leaks when using the pylab interface interactively? Doing 
plot(rand(1000000)) or matshow(rand(1000,1000)) for example eats a big 
chunk of memory (tried with TkAgg and WxAgg in Windows (mpl v0.98.5.2) 
and Linux (mpl v0.98.3)), most of which is not returned when the window 
is closed. The same goes if you create an array, plot it, and explicitly 
del it after closing the window. I've seen lots of posts over the years 
about memory leaks, but there's nothing in the FAQ about this. I found 
old posts about similar things, but nothing that had a clear resolution.
thanks,
Gary

Showing 11 results of 11

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 によって変換されたページ (->オリジナル) /