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 results of 240

1 2 3 .. 10 > >> (Page 1 of 10)
From: Jan S. <js...@sl...> - 2007年09月30日 20:46:43
I'm having some problems understanding the difference between pylab.xticks()
and pylab.yticks()
Consider the following:
> import pylab as P
> import numpy as N
>
> data = N.random.random((10, 10))
> P.matshow(data)
> P.xticks([0, 1, 2], ['1', '2', '3'])
> P.show()
Why does this work, but if I change P.xticks to P.yticks, it doesn't?
The error message that I get back doesn't give me any insight as to what
could cause the difference between xticks and yticks.
 File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/figure.py",
line 612, in draw
 for a in self.axes: a.draw(renderer)
 File
"/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py",
line 1287, in draw
 self.transData.freeze() # eval the lazy objects
ValueError: Domain error on eval_scalars in Transformation::freeze
 matplotlib.__version__
Out[2]: '0.90.1'
I am still in the learning phase, so any insight as to what's going on is
appreciated.
Best,
 Jan
From: Dirk Z. <dir...@go...> - 2007年09月30日 10:53:10
Dear all,
thanks for your help. this is what I was looking for!
Dirk
2007年9月26日, Eric Firing <ef...@ha...>:
>
> David Huard wrote:
> > Hi Dirk,
> >
> > If you haven't already done so, look at the numpy.ma <http://numpy.ma/>
> > module. It provides a masked array object that deals gracefully with
> > missing values. To the best of my knowledge, most matplotlib functions
> > understand masked arrays and deal with it accordingly, exception made of
> > those requiring a full matrix (such as contour). Take a look at
>
> contour handles masked arrays correctly, as far as I know; contourf has
> some bugs in its masked array handling, but depending on the type and
> distribution of voids, it may still be good enough.
>
> pcolor and image have no problems with masked arrays.
>
> Eric
>
> > examples/image_masked.py. Also, in the Basemap toolkit, there is at
> > least one example showing how to plot a masked array on a map.
> >
> > Cheers,
> >
> > David
>
> -------------------------------------------------------------------------
> 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: David L. <dav...@th...> - 2007年09月30日 02:50:06
Hello.
I've been having trouble getting Unicode characters to render. I just
get a box in the title of my figure, rather than the character I need.
Here is my code:
#!/usr/bin/env python
from pylab import *
plot([1,2,3,4])
title(u"\u0251")
savefig("test.eps")
savefig("test.png")
show()
That character is LATIN SMALL LETTER ALPHA. It's used in the
International Phonetic Alphabet.
I'm on Linux and I'm using matplotlib 0.90.1-2 (debian package
version). I have a few TTF fonts in my system that contain that
glyph. One is 'Arial Unicode MS', which I copied from my windows
machine.
As you can see, I will need to generate an EPS that renders the
character... That EPS file will be imported into MS Word on a Windows
PC and printed.
I will happily use any solution that allows me to use that character
in the final product... :) It doesn't have to be unicode..
I believe that my fonts are configured correctly on this Linux
system--I can use the Arial Unicode MS font in Open Office. However,
I'm not sure that MPL is finding them.
When I point the TTFPATH environment variable a directory that only
contains ARIALUNI.TTF, I get gibberish for all characters in my
figure.
When I use ~/.matplotlib/matplotlibrc to list Arial Unicode MS as the
only font in the san-serif family, I don't observe any change in the
text in the figure.
...I did successfully instantiate an FT2FONT object out of my
ARIALUNI.TTF file, but, I didn't know what to do with it at that
point.
Help?
Cheers,
--Dave Loyall
Omaha, Nebraska, USA
From: John H. <jd...@gm...> - 2007年09月28日 12:41:43
On 9/27/07, Charles Seaton <cs...@st...> wrote:
> I am having the same problem as Eugen, and the suggested solution of using
> a.xaxis.get_major_locator().refresh()
> to force the creation of the full set of ticklabels doesn't seem to work for
> me.
matplotlib creates a prototypical tick (the prototick) and then
creates new ones on as as needed basis, copying properties from the
prototick. Of course, position is one of the properties that cannot
be copied, which is why you are having trouble in your example.
Fortunately, there is an easy solution.
Call ax.xaxis.get_major_ticks() and access the label attribute:
for tick in ax.xaxis.get_major_ticks():
 label = tick.label1
Axis.get_major_ticks will force a call to the locator and update the
tick list. The Axes methods like get_xticklabels are just working on
the existing tick list rather than calling the get_major_ticks method
which is why you are not getting the full list. This is a bug. I
just made changes in svn so that all the accessor methods
(ax.get_xticklines, ax.get_yticklabels, and friends) all trigger a
call to axis.get_major_ticks rather so they should give the same
results going forward.
JDH
FYI, the Tick attributes are:
 tick1line : a Line2D instance
 tick2line : a Line2D instance
 gridline : a Line2D instance
 label1 : a Text instance
 label2 : a Text instance
 gridOn : a boolean which determines whether to draw the tickline
 tick1On : a boolean which determines whether to draw the 1st tickline
 tick2On : a boolean which determines whether to draw the 2nd tickline
 label1On : a boolean which determines whether to draw tick label
 label2On : a boolean which determines whether to draw tick label
From: Darren D. <dd...@co...> - 2007年09月28日 12:23:34
On Friday 28 September 2007 07:36:23 am John Hunter wrote:
> On 9/27/07, Darren Dale <dd...@co...> wrote:
> > Hi Eric, John,
> >
> > Have either of you been following this thread?
>
> I am now :-)
>
> As Eric suggests, None is overloaded vis-a-vis color handling, because
> for mpl properties it generally means do the default as defined by rc.
> For colors people often want to use None for "no color" which is why
> we added support for the string "None". Does this work in your use
> case Tom?
The above exchange was off-list, we're back on now. I think that would be what 
Tom is looking for, but it doesnt work:
In [1]: plot([1,2])
Out[1]: [<matplotlib.lines.Line2D instance at 0x710cb0>]
In [2]: savefig('dsd.png', facecolor='None', edgecolor='None')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/home/darren/<ipython console> in <module>()
/usr/lib64/python2.5/site-packages/matplotlib/pyplot.py in savefig(*args, 
**kwargs)
 272 def savefig(*args, **kwargs):
 273 fig = gcf()
--> 274 return fig.savefig(*args, **kwargs)
 275 if Figure.savefig.__doc__ is not None:
 276 savefig.__doc__ = dedent(Figure.savefig.__doc__)
/usr/lib64/python2.5/site-packages/matplotlib/figure.py in savefig(self, 
*args, **kwargs)
 768 kwargs[key] = rcParams['savefig.%s'%key]
 769
--> 770 self.canvas.print_figure(*args, **kwargs)
 771
 772 def colorbar(self, mappable, cax=None, **kw):
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py in 
print_figure(self, *args, **kwargs)
 153 self.update(l, self.renderer.height-t, w, h)
 154
 155 def print_figure(self, *args, **kwargs):
--> 156 FigureCanvasAgg.print_figure(self, *args, **kwargs)
 157 self.draw()
/usr/lib64/python2.5/site-packages/matplotlib/backend_bases.py in 
print_figure(self, filename, dpi, facecolor, edgecolor, orientation, format, 
**kwargs)
 1194 edgecolor=edgecolor,
 1195 orientation=orientation,
-> 1196 **kwargs)
 1197 finally:
 1198 self.figure.dpi.set(origDPI)
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_agg.py in 
print_png(self, filename, *args, **kwargs)
 415
 416 def print_png(self, filename, *args, **kwargs):
--> 417 self.draw()
 418 self.get_renderer()._renderer.write_png(str(filename))
 419
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_qt4agg.py in 
draw(self)
 140 if DEBUG: print "FigureCanvasQtAgg.draw", self
 141 self.replot = True
--> 142 FigureCanvasAgg.draw(self)
 143 self.update()
 144
/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_agg.py in 
draw(self)
 377
 378 self.renderer = self.get_renderer()
--> 379 self.figure.draw(self.renderer)
 380
 381 def get_renderer(self):
/usr/lib64/python2.5/site-packages/matplotlib/figure.py in draw(self, 
renderer)
 586 self.transFigure.freeze() # eval the lazy objects
 587
--> 588 if self.frameon: self.figurePatch.draw(renderer)
 589
 590 for p in self.patches: p.draw(renderer)
/usr/lib64/python2.5/site-packages/matplotlib/patches.py in draw(self, 
renderer)
 198 #renderer.open_group('patch')
 199 gc = renderer.new_gc()
--> 200 gc.set_foreground(self._edgecolor)
 201 gc.set_linewidth(self._linewidth)
 202 gc.set_alpha(self._alpha)
/usr/lib64/python2.5/site-packages/matplotlib/backend_bases.py in 
set_foreground(self, fg, isRGB)
 617 self._rgb = fg
 618 else:
--> 619 self._rgb = colors.colorConverter.to_rgb(fg)
 620
 621 def set_graylevel(self, frac):
/usr/lib64/python2.5/site-packages/matplotlib/colors.py in to_rgb(self, arg)
 277
 278 except (KeyError, ValueError, TypeError), exc:
--> 279 raise ValueError('to_rgb: Invalid rgb arg "%s"\n%s' % 
(str(arg), exc))
 280 # Error messages could be improved by handling TypeError
 281 # separately; but this should be rare and not too hard
ValueError: to_rgb: Invalid rgb arg "None"
invalid literal for float(): None
From: Alan G I. <ai...@am...> - 2007年09月28日 04:13:47
After thinking it over, I did not go for
Robert or David's cool numpy tricks, but
I'll append a simple object in case someone
else wants to do more.
Cheers,
Alan Isaac
class EmpiricalCDF(object):
 '''Empirical cdf.
 First point will be (xmin,0).
 Last point will be (xmax,1).
 '''
 def __init__(self, data, sortdata=True):
 if sortdata:
 data = N.sort(data)
 self.data = data
 self.nobs = len(data)
 def gen_xp(self):
 data, nobs = self.data, self.nobs
 prob = N.linspace(0, 1, nobs+1)
 xsteps = ( data[(idx)//2] for idx in xrange(2*nobs) )
 psteps = ( prob[(idx+1)//2] for idx in xrange(2*nobs) )
 return xsteps, psteps
 def get_steps(self):
 '''Return: 2-tuple of arrays,
 the data values and corresponding cumulative 
 probabilities.
 '''
 xsteps, psteps = self.gen_xp()
 return N.fromiter(xsteps,'f'), N.fromiter(psteps,'f')
From: Eric F. <ef...@ha...> - 2007年09月28日 00:46:54
Hal Huntley wrote:
> 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_gdkd4
> ===
Is it a rotten egg?
> 
> 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. 
No, that should work fine. I don't know how the egg-based 
matplotlib/pylab should work with the installed-from-source numpy, 
though. If the versions are compatible, then I expect it would work.
You gave a traceback resulting from "from pylab import *" after 
installing the two eggs, correct? If so, what was the result after you 
installed numpy from source? I would expect no difference, because the 
problem reported in the traceback is a missing matplotlib module, not a 
missing numpy module.
Or did you mean that you installed matplotlib from source? That would 
make more sense, and certainly should work if all the right header files 
and libraries are present.
If you installed matplotlib from source, what do you get from
ls /usr/lib/python2.4/site-packages/matplotlib/backends/*.so
Another diagnostic would be to delete the build directory from the 
matplotlib source tree (assuming you are now building matplotlib from 
source), and save the output from the "python setup.py build" command. 
This should make it clear whether the necessary headers really were found.
Eric
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
From: Tommy G. <tg...@ma...> - 2007年09月26日 23:08:15
On Sep 26, 2007, at 5:09 PM, 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.)
Without really knowing what CDF is (I am assuming
it is Cumulative Density Fucntion or something similar).
I would suggest taking a look at numpy and the histogram
and cumsum functions therein.
Cheers
 Tommy
From: Eric F. <ef...@ha...> - 2007年09月26日 21:35:45
Tom Johnson wrote:
> How can I keep a 1:1 aspect ratio after adding a colorbar? 
After adding the colorbar, try
axis('scaled')
or
axis('image')
or
axis('equal')
Or for full control use the set_aspect() method of the Axes object for 
your plot. There is also an axis() method corresponding to the pylab 
axis() function if you are using an OO style.
help(axis) will explain the various axis() options.
Eric
> 
> ratio='exact' seems to include the colorbar in the calculations. For 
> example, if I have a circle and color it....I want it to still look like 
> a circle (rather than an ellipse) after adding the colorbar.
> 
> ~t
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> 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: Alan I. <ai...@am...> - 2007年09月26日 21:09:56
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
From: Simon F. <saj...@gm...> - 2007年09月26日 21:04:26
On 9/26/07, Simon Forman <saj...@gm...> wrote:
> Hello,
>
> I just installed Matplotlib (and NumPy) on a windows XP machine, and
> I'm getting the following traceback when I try to use the TkAgg
> backend.
>
> Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
> win32
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import matplotlib
> >>> matplotlib.use('TkAgg')
> >>> from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> File "C:\Python25\Lib\site-packages\matplotlib\backends\backend_tkagg.py",
> line 8, in <module>
> import tkagg # Paint image to Tk photo blitter extension
> File "C:\Python25\lib\site-packages\matplotlib\backends\tkagg.py",
> line 1, in <module>
> import _tkagg
> ImportError: DLL load failed: The specified module could not be found.
> >>>
>
> I found one old (2004) post
> http://mail.python.org/pipermail/python-list/2004-April/258963.html
> that seems to indicate that some sort version mismatch of the Tk/Tcl
> libraries may be to blame. But I don't know how to diagnose that or
> what to do about it.
>
> FWIW, I installed using matplotlib-0.90.1.win32-py2.5.exe and
> numpy-1.0.3.1.win32-py2.5.exe.
>
> Thanks in advance for any help you can give me.
> Sincerely,
> ~Simon
>
Please disregard. I was missing MSVCP71.dll.
Sorry for the 'noise',
Sincerely,
~Simon
From: Darren D. <dd...@co...> - 2007年09月26日 20:40:20
Attachments: dsd_test.ps
On Wednesday 26 September 2007 03:30:41 pm Tom Johnson wrote:
> Any comments on this? The behavior is, at best, inconsistent. At worst,
> the current behavior is incorrect, as it is not possible to have a white
> facecolor when using usetex/xpdf.
I used your script to create the eps file, and created the attached postscript 
(you need an \end{document} in your latex code). Do you see anything wrong 
with the resulting postscript? It looks fine to me.
> On 9/23/07, Tom Johnson <tj...@gm...> wrote:
> > On 9/23/07, Tom Johnson <tj...@gm...> wrote:
> > > Also, it seems like there needs to be an extra keyword or option.
> > > Suppose someone wanted a white facecolor in the (usetex=True) EPS file.
> > > It doesn't seem like this is currently possible. It would be nice if
> > > I could specify:
> > >
> > > savefig(file, facecolor=None, edgecolor=None)
> >
> > It would also be nice if we could specify the axis background color to be
> > None as well (again, perhaps only useful when creating an EPS)...when
> > using the plot command.
That is probably a nontrivial change to mpl's existing color support.
Darren
2 messages has been excluded from this view by a project administrator.

Showing results of 240

1 2 3 .. 10 > >> (Page 1 of 10)
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 によって変換されたページ (->オリジナル) /