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






Showing 13 results of 13

From: Charles S. <cs...@st...> - 2007年09月27日 23:25:42
Looking back through the archives, I found this discussion of manipulating
ticklabels.
Jouni K. Sepp=C3=A4nen wrote:
>=20
> Eugen Wintersberger <eug...@jk...>
> writes:
>=20
>> The first line is the printing of the ticklabel list before the
>> pylab.show() command. The second after pylab.show(). Why the list
>> contains 1 entry before and 7 (as is should) after pylab.show()?
>=20
> I think matplotlib is deferring the creation of the tick labels because
> for all it knows, you might be going to plot something that will cause
> the axes to be rescaled and change the tick locations and labels.
>=20
>> I would like to access the labels before the final show command in a
>> script. But how is this possible with this behavior?=20
>=20
> You could set the tick positions and labels explicitly, or if you like
> the default tick locator, add the following before getting the ticklabel
> objects:
>=20
> a.xaxis.get_major_locator().refresh()
>=20
I am having the same problem as Eugen, and the suggested solution of using=
=20
a.xaxis.get_major_locator().refresh()
to force the creation of the full set of ticklabels doesn't seem to work fo=
r
me.
Sample script:
from pylab import *
#ion()
a =3Daxes([0.2,0.2,0.7,0.7])
t =3D arange(0.0, 2.0, 0.01)
s =3D sin(2*pi*t)
a.plot(t, s)
a.grid(True)
# matlab handle graphics style
a.xaxis.get_major_locator().refresh()
xticklabels =3D getp(a, 'xticklabels')
setp(xticklabels, 'color', 'r', fontsize=3D'medium')
setp(xticklabels, dashdirection=3D0, dashlength=3D10, dashrotation=3D90)
#savefig('axprops_demo')
show()
even with a.xaxis.get_major_locator().refresh(), only the first ticklabel
has its position adjusted.
replacing=20
setp(xticklabels, dashdirection=3D0, dashlength=3D10, dashrotation=3D90)
with code modifying the position
for i in range(len(xticklabels)):
 xtp =3D getp(xticklabels[i],'position')
 setp(xticklabels[i],position=3D(xtp[0],-0.05))
also only effects the first ticklabel.
changes to color and fontsize of the first ticklabel do carry over the full
set of ticklabels, but TextWithDash properties do not carry over.=20
Uncommenting ion() at the beginning of the script generates the desired
image with offset ticklabels, but requires using interactive mode.
Any help either getting=20
a.xaxis.get_major_locator().refresh()
to work properly, or to get TextWithDash properties to carry over from the
initial single ticklabel to the full set of ticklabels would be greatly
appreciated.=20
thanks,
Charles Seaton
Research Associate
STC-CMOP
www.stccmop.org
--=20
View this message in context: http://www.nabble.com/Problem-with-tick-label=
s-in-scripts-tf4260235.html#a12932137
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Hal H. <ha...@so...> - 2007年09月27日 23:16:52
Thanks to Eric Firing and Christopher Barker for input on trying to
resolve the problem. Christopher said:
%%%
You might try just:
easy_install numpy
easy_install matplotlib.
%%%
I did that and now the problem moved and I get:
===
>>> from pylab import *
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File
 "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/pylab.py", line 1, in ?
 from matplotlib.pylab import *
 File
 "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/pylab.py", line 222, in ?
 new_figure_manager, draw_if_interactive, show = pylab_setup()
 File
 "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/__init__.py", line 24, in pylab_setup
 globals(),locals(),[backend_name])
 File
 "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gtkagg.py", line 10, in ?
 from matplotlib.backends.backend_gtk import gtk, FigureManagerGTK,
 FigureCanvasGTK,\
 File
 "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gtk.py", line 21, in ?
 from matplotlib.backends.backend_gdk import RendererGDK, FigureCanvasGDK
 File
 "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gdk.py", line 35, in ?
 from matplotlib.backends._ns_backend_gdk import pixbuf_get_pixels_array
ImportError: No module named _ns_backend_gdk
===
Googling around has indicated that the X11 stuff wasn't available when the
numpy and matplotlib were made. The gtk files and "-devel" seem to be there
when I do an "rpm -qa". I went and got a new numpy from source and did
"python setup.py install". It is interesting that when I get in to python
now, I can do:
>>> import gtk
>>> import numpy
>>> import matplotlib
and they all just return the prompt, indicating, I thought, that the
programs were installed ok. 
Here is the naive question -> Is there something wrong, then with a
"from pylab import *"? The user is trying to do that. 
Thanks for any assistance that can be given.
Hal
=======================
> Hal Huntley wrote:
> > I'm a sys admin trying to install the matplotlib python package for
> > someone on our staff. I'm not overly familar with python.
> > We are trying to use matplotlib with pylab. 
> > uname -a
> > Linux andromeda 2.6.13-1.1532_FC4smp #1 SMP Thu Oct 20 01:51:51 EDT 2005
> > i686 i686 i386 GNU/Linux
> > The python version we have is the default that we got with the Fedora
> > Core 4 package.
> > python -V
> > Python 2.4.1
> > I've installed using /usr/bin/easy_install:
> > matplotlib-0.90.1-py2.4-win32.egg numpy-1.0.3.1-py2.4-win32.egg
> 
> I've never understood eggs and easy_install, but it certainly doesn't 
> look right that you are installing things labelled "win32" on a Linux 
> box! I'm surprised you got that far.
> 
> For linux, I like to install from source, since the distro packages for 
> numpy and mpl are usually too old. If you get the tarballs, build and 
> install numpy first, then mpl. You don't need or want Numeric or 
> numarray. The build process may fail. If it does, it is because you 
> need to install distro packages with headers for various libraries, and 
> you should be able to see from the failures which headers are missing.
> 
> Maybe someone else can provide more detailed instructions for Fedora C4.
> 
> Eric
> 
> 
> 
> > 
> > If we get in to python and give the command:
> >>>> from pylab import *
> > 
> > We get:
> > ==
> > Traceback (most recent call last):
> > File "<stdin>", line 1, in ?
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-win32.egg/pylab.py", line 1, in ?
> > from matplotlib.pylab import *
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-win32.egg/matplotlib/pylab.py", line 201, in ?
> > import mlab #so I can override hist, psd, etc...
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-win32.egg/matplotlib/mlab.py", line 64, in ?
> > import nxutils
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-win32.egg/matplotlib/nxutils.py", line 17, in ?
> > from matplotlib._ns_nxutils import *
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-win32.egg/matplotlib/_ns_nxutils.py", line 7, in ?
> > __bootstrap__()
> > File
> > "/usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-win32.egg/matplotlib/_ns_nxutils.py", line 5, in __bootstrap__
> > del __bootstrap__, __loader__
> > NameError: global name '__loader__' is not defined
> > ==
> > 
> > I've read that numeric may need to be installed, so I got "Numeric-24.2"
> > and did:
> > python setup.py build
> > python setup.py install
> > 
> > That didn't help solve the issue.
> > 
> > Is there some other package that needs to be installed? I checked the FAQ
> > and this issue does not seem to be there.
> > 
> > Regards,
> > 
> > Hal Huntley
> > SRI International
From: Tom J. <tj...@gm...> - 2007年09月27日 18:30:20
On 9/27/07, Tom Johnson <tj...@gm...> wrote:
> However, it will be a little while before I can provide a status
> update----I have a presentation very soon and do not have the time to
> regenerate all my images so that the background matches my
> presentation background. Since my setup had been creating
> 'transparent' facecolors, I did not bother setting facecolor at all
> and kept the default. :(
Assuming that GPL 8.60 fixes the problem, do you anticipate that mpl
will move to support None as a color? I realize this is a nontrivial
change to the color functionality...but there is a major portability
benefit. With None as an option, I would probably always set the axis
background color, figure facecolor, and figure edgecolor to None.
Then, my figures would work no matter which theme I selected for my
presentation....and it avoids the situation I am in now, which
requires significant time to regenerate images.
>
> Thanks!
>
From: Tom J. <tj...@gm...> - 2007年09月27日 18:22:20
On 9/27/07, Darren Dale <dd...@co...> wrote:
> On Thursday 27 September 2007 01:28:46 am Tom Johnson wrote:
> > On 9/26/07, Darren Dale <dd...@co...> wrote:
> > > I used your script to create the eps file, and created the attached
> > > postscript
> > > (you need an \end{document} in your latex code).
> >
> > Whoops!
> >
> >
> > Do you see anything wrong
> >
> > > with the resulting postscript? It looks fine to me.
> >
> > Indeed. I didn't realize this before, but the problem is actually with the
> > pdf. I have attached it. Can you confirm that your pdf looks like mine?
>
> No, it does not look like yours. See attached.
Interesting.
>
> > Mine looks like this no matter which viewer I use (acrobat, evince, xpdf).
> > This makes me wonder if it is 1) the eps file or 2) the compilation
> > process.
>
> It is probably a problem with either ghostscript or pdftops.
>
> > Actually, the problem exists as early as the dvi file.
>
> The dvi looks fine here, and so does my pdf. It is often the case that
> problems with usetex are solved by updating the external dependencies. I am
> using:
>
> GPL Ghostscript 8.60
> pdftops version 3.00
> pdfeTeX 3.141592-1.30.5-2.2 (tetex-3.0_p1)
>
>
>
Hmm...I have:
ESP Ghostscript 8.15.04 (2007年03月14日)
pdftops version 3.01 (coming from libpoppler1 version 0.5.4-0ubuntu8)
pdfeTeX 3.141592-1.21a-2.2 (tetex-3.0.dfsg.3-4)
The CUPS page (http://www.cups.org/espgs/index.php) indicates that ESP
8.15.04 and GPL 8.57 have merged into 8.60. This is probably the
solution. So I will give that a try as a first fix and report back to
the list.
However, it will be a little while before I can provide a status
update----I have a presentation very soon and do not have the time to
regenerate all my images so that the background matches my
presentation background. Since my setup had been creating
'transparent' facecolors, I did not bother setting facecolor at all
and kept the default. :(
Thanks!
From: Alan G I. <ai...@am...> - 2007年09月27日 16:04:22
On 2007年9月27日, David Huard apparently wrote:
> scipy/sandbox/dhuard/stats.py 
Well, I also did not think of a double application of 
argsort to rank the observations. Nice. OK, I've got plenty 
to work with now.
Thanks,
Alan
From: Alan G I. <ai...@am...> - 2007年09月27日 14:56:09
On 2007年9月26日, Robert Kern apparently wrote:
> n = len(x)
> x2 = np.repeat(x, 2)
> y2 = np.hstack([0.0, np.repeat(np.arange(1,n) / float(n), 2), 1.0])
> pylab.plot(x2, y2)
OK, that's pretty slick.
I did not think about ``repeat``.
Thanks,
Alan
From: David H. <dav...@gm...> - 2007年09月27日 14:03:44
Hi Alan,
There is an empiricalcdf function in scipy/sandbox/dhuard/stats.py
It's not fancy but it might do what you want.
David
2007年9月26日, Alan Isaac <ai...@am...>:
>
> Is there a standard function or practice for
> plotting the CDF of a series? (I am aware
> of the output of hist.)
>
> Thank you,
> Alan Isaac
>
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Darren D. <dd...@co...> - 2007年09月27日 13:52:28
On Thursday 27 September 2007 09:34:28 am Darren Dale wrote:
> On Thursday 27 September 2007 01:28:46 am Tom Johnson wrote:
> > On 9/26/07, Darren Dale <dd...@co...> wrote:
> > > I used your script to create the eps file, and created the attached
> > > postscript
> > > (you need an \end{document} in your latex code).
> >
> > Whoops!
> >
> >
> > Do you see anything wrong
> >
> > > with the resulting postscript? It looks fine to me.
> >
> > Indeed. I didn't realize this before, but the problem is actually with
> > the pdf. I have attached it. Can you confirm that your pdf looks like
> > mine?
>
> No, it does not look like yours. See attached.
>
> > Mine looks like this no matter which viewer I use (acrobat, evince,
> > xpdf). This makes me wonder if it is 1) the eps file or 2) the
> > compilation process.
>
> It is probably a problem with either ghostscript or pdftops.
>
> > Actually, the problem exists as early as the dvi file.
>
> The dvi looks fine here, and so does my pdf. It is often the case that
> problems with usetex are solved by updating the external dependencies. I am
> using:
>
> GPL Ghostscript 8.60
> pdftops version 3.00
> pdfeTeX 3.141592-1.30.5-2.2 (tetex-3.0_p1)
On my machine, pdftops is provided by poppler-0.6, not xpdf.
Darren
From: Darren D. <dd...@co...> - 2007年09月27日 13:34:32
Attachments: mpl.pdf
On Thursday 27 September 2007 01:28:46 am Tom Johnson wrote:
> On 9/26/07, Darren Dale <dd...@co...> wrote:
> > I used your script to create the eps file, and created the attached
> > postscript
> > (you need an \end{document} in your latex code).
>
> Whoops!
>
>
> Do you see anything wrong
>
> > with the resulting postscript? It looks fine to me.
>
> Indeed. I didn't realize this before, but the problem is actually with the
> pdf. I have attached it. Can you confirm that your pdf looks like mine?
No, it does not look like yours. See attached.
> Mine looks like this no matter which viewer I use (acrobat, evince, xpdf).
> This makes me wonder if it is 1) the eps file or 2) the compilation
> process.
It is probably a problem with either ghostscript or pdftops.
> Actually, the problem exists as early as the dvi file.
The dvi looks fine here, and so does my pdf. It is often the case that 
problems with usetex are solved by updating the external dependencies. I am 
using:
GPL Ghostscript 8.60
pdftops version 3.00
pdfeTeX 3.141592-1.30.5-2.2 (tetex-3.0_p1)
From: Lee, Young-J. <yo...@uc...> - 2007年09月27日 11:26:22
Thanks much! But, it didn't help. The second figure got still really
slow and closes right away after it finishes drawing not giving enough
time to me to see the figure. Then, it crashed for the third one. Any
idea?
Young Jin
-----Original Message-----
From: Wolfgang Kerzendorf [mailto:wke...@go...]=20
Sent: Wednesday, September 26, 2007 9:03 PM
To: Lee, Young-Jin
Cc: mat...@li...
Subject: Re: [Matplotlib-users] multiple figures interactively
This might help you it destroys the whole window:
pylab.get_current_fig_manager().destroy()
and then you open it again with show
Lee, Young-Jin wrote:
>
> Hi,
>
> I 'm writing a python program that draws figures one by one=20
> interactively with the user's input in dos mode. Basically, I give the
> program a decision after each figure and then it draws the next one.=20
> After the first figure, it got very much slowed down for the second=20
> one and crashed for the third one. I feel like it has some memory=20
> issues as I keep using 'show' after I close each. I used 'clf()'=20
> before I draw a new one, but it doesn't seem to help. Any idea?
Thanks.
>
> Young Jin
>
>
------------------------------------------------------------------------
>
>
------------------------------------------------------------------------
-
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>
------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> =20
From: David C. <da...@ar...> - 2007年09月27日 07:03:25
Andrew Straw wrote:
> I came across this piece by Adam Hupp on programming.reddit.com just 
> now. It looks interesting:
>
> http://hupp.org/adam/weblog/2007/09/03/etframes-applying-the-ideas-of-edward-tufte-to-matplotlib/ 
>
> 
This is indeed really interesting. Thanks for this link,
David
From: Wolfgang K. <wke...@go...> - 2007年09月27日 04:03:26
This might help you it destroys the whole window:
pylab.get_current_fig_manager().destroy()
and then you open it again with show
Lee, Young-Jin wrote:
>
> Hi,
>
> I ’m writing a python program that draws figures one by one 
> interactively with the user’s input in dos mode. Basically, I give the 
> program a decision after each figure and then it draws the next one. 
> After the first figure, it got very much slowed down for the second 
> one and crashed for the third one. I feel like it has some memory 
> issues as I keep using ‘show’ after I close each. I used ‘clf()’ 
> before I draw a new one, but it doesn’t seem to help. Any idea? Thanks.
>
> Young Jin
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2005.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Robert K. <rob...@gm...> - 2007年09月27日 00:11:41
Alan Isaac wrote:
> Is there a standard function or practice for
> plotting the CDF of a series? (I am aware
> of the output of hist.)
import numpy as np
from matplotlib import pylab
x = ... # whatever
n = len(x)
x2 = np.repeat(x, 2)
y2 = np.hstack([0.0, np.repeat(np.arange(1,n) / float(n), 2), 1.0])
pylab.plot(x2, y2)
-- 
Robert Kern
"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
 -- Umberto Eco

Showing 13 results of 13

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