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




Showing results of 219

1 2 3 .. 9 > >> (Page 1 of 9)
From: Eric F. <ef...@ha...> - 2007年07月31日 21:59:58
Alex,
Download the current mpl release and try installing that, after 
completely cleaning out the present installation. (I would also be 
inclined to delete the numpy and install that also from the latest 
tarball, and then build and install mpl.) 0.87.3 is pretty old. There 
was a while when mpl and numpy were evolving together and had to be kept 
in sync; evidently 0.87.3 was based on an older numpy version, something 
prior to numpy 1.0.
For anything that you install yourself, I recommend using the 
--prefix=/usr/local option to "python setup.py install". I like to keep 
things I install separate from things that come from distro packages.
Eric
Alexander Dietz wrote:
> Hi,
> 
> I want to use matplotlib, version 0.87.3, on my laptop (FC5) running 
> numpy1.0.1. I had the following settings in my matplotlibrc:
> 
> numerix:numpy
> 
> Then I installed matplotlib using:
> 
> python setup.py build
> python setup.py install
> 
> which all seemed to work fine. But then, trying to import pylab, leads 
> to the following error:
> 
> from pylab import *
> File "/usr/lib/python2.4/site-packages/pylab.py", line 1, in ?
> from matplotlib.pylab import *
> File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 196, 
> in ?
> import cm
> File "/usr/lib/python2.4/site-packages/matplotlib/cm.py", line 5, in ?
> import colors
> File "/usr/lib/python2.4/site-packages/matplotlib/colors.py", line 33, 
> in ?
> from numerix import array, arange, take, put, Float, Int, where, \
> File 
> "/usr/lib/python2.4/site-packages/matplotlib/numerix/__init__.py", line 
> 68, in ?
> from _sp_imports import nx, infinity
> File 
> "/usr/lib/python2.4/site-packages/matplotlib/numerix/_sp_imports.py", 
> line 1, in ?
> from numpy import Int8, UInt8, \
> ImportError: cannot import name Int8
> 
> 
> How to fix this problem?
> 
> Cheers
> Alex
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jd...@gm...> - 2007年07月31日 21:57:47
On 7/31/07, william ratcliff <wil...@gm...> wrote:
> I have a question about building from source on windows:
> I have installed freetype2 and libpng, for zlib, I have a collection of
> dlls,
> But, where do I place these so that matplotlib can find them (for the
> include files, libraries, etc. Are there any that I have to rename?)? I am
> using mingw for compilation and python 2.5--I have built numpy successfully
> from source and have installed wxpython. I have the latest version of
> matplotlib from the trunk of the svn repository.
See the instructions for building on win32 in the setupext.py file in
the src distribution. Let us know if they are out of date so we can
update them.
Thanks,
JDH
From: william r. <wil...@gm...> - 2007年07月31日 21:47:56
I have a question about building from source on windows:
I have installed freetype2 and libpng, for zlib, I have a collection of
dlls,
But, where do I place these so that matplotlib can find them (for the
include files, libraries, etc. Are there any that I have to rename?)? I am
using mingw for compilation and python 2.5--I have built numpy successfully
from source and have installed wxpython. I have the latest version of
matplotlib from the trunk of the svn repository.
Thanks,
William
From: Alexander D. <Ale...@as...> - 2007年07月31日 20:55:00
Hi,
I want to use matplotlib, version 0.87.3, on my laptop (FC5) running
numpy1.0.1. I had the following settings in my matplotlibrc:
numerix:numpy
Then I installed matplotlib using:
python setup.py build
python setup.py install
which all seemed to work fine. But then, trying to import pylab, leads to
the following error:
 from pylab import *
 File "/usr/lib/python2.4/site-packages/pylab.py", line 1, in ?
 from matplotlib.pylab import *
 File "/usr/lib/python2.4/site-packages/matplotlib/pylab.py", line 196, in
?
 import cm
 File "/usr/lib/python2.4/site-packages/matplotlib/cm.py", line 5, in ?
 import colors
 File "/usr/lib/python2.4/site-packages/matplotlib/colors.py", line 33, in
?
 from numerix import array, arange, take, put, Float, Int, where, \
 File "/usr/lib/python2.4/site-packages/matplotlib/numerix/__init__.py",
line 68, in ?
 from _sp_imports import nx, infinity
 File "/usr/lib/python2.4/site-packages/matplotlib/numerix/_sp_imports.py",
line 1, in ?
 from numpy import Int8, UInt8, \
ImportError: cannot import name Int8
How to fix this problem?
Cheers
 Alex
From: Brent P. <bpe...@gm...> - 2007年07月31日 20:02:47
sending again, doesnt seem to have gone through...
hi, with the simple script below, how can i make the image have a
transparent background instead of white? it's saving RGB, not RGBA.
thanks,
-brent
import matplotlib
matplotlib.use('Agg')
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
fig = Figure()
canvas = FigureCanvas(fig)
dpi = 64
fig.set_size_inches(256/dpi, 256/dpi)
#fig.figurePatch.set_alpha(1.)
fig.set_alpha(1.)
ax = fig.add_axes((0,0,1,1), axis_bgcolor=(1, 1, 1, 1.), alpha=1.,
frame_on=False, xticks=(), yticks=())
ax.plot([1,2,3])
fig.set_facecolor((1.,1.,1.,1.))
canvas.print_figure('t.png', dpi=dpi, facecolor=(1.,1.,1.,1.))
From: Steve L. <st...@ar...> - 2007年07月31日 05:26:43
>> Trying to import pylab from the shell gives me a Bus Error.
> [...]
>> Anybody have any ideas on what to do from here?
>
> Follow the instructions in the SEGFAULTS file, which begins as 
> follows:
>
> | First thing to try is simply rm -rf the site-packages/matplotlib and
> | build subdirs and get a clean install. Installing a new version 
> over
> | a pretty old version has been known to cause trouble, segfault, etc.
Thanks Jouni,
For the sake of posterity- after going through a witch-hunt of stale 
library versions, etc, it turned out that nuking the matplotlib dir 
from my site-packages folder was probably what ended up doing the trick.
If you, like me, have python installed in via macports, note that 
you'll have two site-packages folders (in this case, it's python 2.4):
 * /opt/local/lib/python2.4/site-packates
 * /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/ 
python2.4/site-packages
Not sure how it might happen, but it wouldn't hurt to ensure that 
there isn't a matplotlib install in both of those places :-)
Thanks again,
-steve
From: Brent P. <bpe...@gm...> - 2007年07月29日 20:51:35
hi, with the simple script below, how can i make the image have a
transparent background instead of white? it's saving RGB, not RGBA.
thanks,
-brent
import matplotlib
matplotlib.use('Agg')
from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
from matplotlib.figure import Figure
fig = Figure()
canvas = FigureCanvas(fig)
dpi = 64
fig.set_size_inches(256/dpi, 256/dpi)
#fig.figurePatch.set_alpha(1.)
fig.set_alpha(1.)
ax = fig.add_axes((0,0,1,1), axis_bgcolor=(1, 1, 1, 1.), alpha=1.,
frame_on=False, xticks=(), yticks=())
ax.plot([1,2,3])
fig.set_facecolor((1.,1.,1.,1.))
canvas.print_figure('t.png', dpi=dpi, facecolor=(1.,1.,1.,1.))
From: <jk...@ik...> - 2007年07月27日 11:45:50
Steve Lianoglou
<lis...@ar...> writes:
> Trying to import pylab from the shell gives me a Bus Error.
 [...]
> Anybody have any ideas on what to do from here?
Follow the instructions in the SEGFAULTS file, which begins as follows:
| First thing to try is simply rm -rf the site-packages/matplotlib and
| build subdirs and get a clean install. Installing a new version over
| a pretty old version has been known to cause trouble, segfault, etc.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Steve L. <lis...@ar...> - 2007年07月27日 03:42:05
Hi all,
I just upgraded to the latest svn for matlotlib and she's blowing up 
on me with this error:
terminate called after throwing an instance of 'std::bad_cast'
 what(): St8bad_cast
Abort trap
It happens when I fire up ipython w/ -pylab ... (and some other non 
specified code in one of my project's code base if I fire up python 
as is and import that -- helpful, right?)
Trying to import pylab from the shell gives me a Bus Error.
I'm running on OS X 10.4.10 (intel) with pretty much everything 
compiled from macports (using the GTKAgg backend):
 * python2.4.4
 * gtk2 @2.10.13_0
 * antigraingeometry @2.5_0
 * ... so many other packages ..
I'm trying to see if there are any outdated ports that might be 
necessary to upgrade, but at a glance, nothing is jumping out at me 
(I also just upgraded the gtk2 and agg -- so I'm assuming all of 
their dependencies were upgraded as well).
Anybody have any ideas on what to do from here?
Thanks,
-steve
From: Brian B. <bb...@br...> - 2007年07月27日 01:27:39
On Jul 26, 2007, at Jul 26:4:49 PM, Jouni K. Sepp=E4nen wrote:
> Brian Blais <bb...@br...> writes:
>
>> and it works with pylab. But, if I use matplotlib.Figure directly in
>> an app, and then call:
>> myfig.savefig('blah.pdf') it saves it as 'blah.pdf.jpg', a jpeg =20
>> file.
>
> Sounds like you are using a backend other than the pdf one. Can you
> write up a complete example of code that behaves like you describe?
>
This is the smallest example I can write. I am embedding the figure =20
in a wx window. In this test case, I print (successfully) a PNG and =20
EPS, but the PDF doesn't work (gets a .jpg attached to the end).
			bb
--=20
Brian Blais
bb...@br...
http://web.bryant.edu/~bblais
#!/usr/bin/env python
import wx
from matplotlib.backends.backend_wxagg import FigureCanvasWx as =20
FigureCanvas
from matplotlib.figure import Figure
class MainWindow(wx.Frame):
 """ We simply derive a new class of Frame. """
 def __init__(self, parent, id, title):
 wx.Frame.__init__(self, parent, id, title, size=3D(400,400))
 fig =3D Figure()
 canvas =3D FigureCanvas(self,-1, fig)
 ax=3Dfig.add_subplot(111)
 ax.plot([1,2,3,4],'o')
 canvas.draw()
 self.Show(True)
 fig.savefig('blah.eps')
 fig.savefig('blah.png')
 fig.savefig('blah.pdf')
app =3D wx.PySimpleApp()
frame=3DMainWindow(None, wx.ID_ANY, 'Test')
app.MainLoop()
From: Eric F. <ef...@ha...> - 2007年07月26日 23:40:15
3D plotting in mpl should be considered, at best, to be experimental and 
unsupported. Some interesting and fairly extensive capabilities were 
added but have not been consistently maintained. Mpl is at heart 2D.
Eric
Lorenzo Isella wrote:
> Dear All,
> I would like to try out matplotlib for some basic 3D plotting.
> First of all, is matplotlib suitable for that? I am asking since I read 
> on the website that matplotlib's selling point is 2D plotting.
> What I would like to plot should be relatively easy: say that I have a 
> distribution (e.g. think of a Gaussian) whose features evolve as time 
> goes on.
> I aim at a 3D plot where time is the z coordinate, x is the independent 
> variable of my distribution at t fixed and y=f(x) is my Gaussian 
> distribution.
> The data I would like to plot are in the following form:
> 
> f(t_1,x_1),f(t_1,x_2)...f(t_1,x_n)
> f(t_2,x_1),f(t_2,x_2)...f(t_2,x_n)
> .
> .
> .
> f(t_m,x_1),f(t_m,x_2)...f(t_m,x_n)
> 
> and I know both the time sequence {t_1,t_2...t_m} and the x sequence 
> {x_1,x_2,x_n}.
> I got something roughly similar to what I had in mind using R, but I do 
> not think it is the right tool for that.
> Should I resort to Gnuplot by necessity or is Matplotlib up to the task?
> Judging from what I see on:
> http://www.scipy.org/Cookbook/Matplotlib/mplot3D
> that would seem the case.
> I have been trying to modify the last example with some artificially 
> generated data, but so far unsuccessfully.
> Any suggestions? I suppose I am not the first one to come across this!
> Many thanks
> 
> Lorenzo
> 
> 
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Lorenzo I. <lor...@gm...> - 2007年07月26日 23:24:21
Dear All,
I would like to try out matplotlib for some basic 3D plotting.
First of all, is matplotlib suitable for that? I am asking since I read 
on the website that matplotlib's selling point is 2D plotting.
What I would like to plot should be relatively easy: say that I have a 
distribution (e.g. think of a Gaussian) whose features evolve as time 
goes on.
I aim at a 3D plot where time is the z coordinate, x is the independent 
variable of my distribution at t fixed and y=f(x) is my Gaussian 
distribution.
The data I would like to plot are in the following form:
f(t_1,x_1),f(t_1,x_2)...f(t_1,x_n)
f(t_2,x_1),f(t_2,x_2)...f(t_2,x_n)
.
.
.
f(t_m,x_1),f(t_m,x_2)...f(t_m,x_n)
and I know both the time sequence {t_1,t_2...t_m} and the x sequence 
{x_1,x_2,x_n}.
I got something roughly similar to what I had in mind using R, but I do 
not think it is the right tool for that.
Should I resort to Gnuplot by necessity or is Matplotlib up to the task?
Judging from what I see on:
http://www.scipy.org/Cookbook/Matplotlib/mplot3D
that would seem the case.
I have been trying to modify the last example with some artificially 
generated data, but so far unsuccessfully.
Any suggestions? I suppose I am not the first one to come across this!
Many thanks
Lorenzo
From: <jk...@ik...> - 2007年07月26日 21:28:15
John T Whelan <joh...@li...> writes:
> Shouldn't
> r"some label text ($\mu V$)"
> work?
It doesn't work in any released version, but it seems that Michael
Droettboom's recent mathtext improvements include this (and much more).
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jk...@ik...> - 2007年07月26日 20:55:07
"Jonathan Makem" <jma...@qu...>
writes:
> However, if I try:
> savefig('name.pdf')
> The program crashes. Is there anyway of solving this problem?
You'll need to provide more information than "the program crashes", but
if you're seeing the cp1252 bug, you'll need to use the bleeding-edge
svn version or apply the patch at
http://thread.gmane.org/gmane.comp.python.matplotlib.general/9792/focus=9796
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: <jk...@ik...> - 2007年07月26日 20:50:34
Brian Blais <bb...@br...> writes:
> and it works with pylab. But, if I use matplotlib.Figure directly in
> an app, and then call:
> myfig.savefig('blah.pdf') it saves it as 'blah.pdf.jpg', a jpeg file.
Sounds like you are using a backend other than the pdf one. Can you
write up a complete example of code that behaves like you describe?
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Berit H. <be...@to...> - 2007年07月26日 15:07:06
<html><body>
<p>Hi,<br>
<br>
I am installing matplotlib on a RedHat x86_64 machine, running Python 2=
.3.4. I could not find any binary for it on sourceforge and thus I have=
 to compile it. Has somebody tried this and are there some pitfalls? <b=
r>
Also, what does the setup utility peak do? Has anybody gotten it to wor=
k with 64bit under Python 2.3.4 (I'd like to avoid upgrading if possibl=
e).<br>
<br>
Any pointers are appreciated. Thanks a lot!<br>
<br>
Best regards,<br>
Berit<br>
<br>
<br>
-----------------------------------------------------------------------=
-----------<br>
This e-mail message (including attachments, if any) is confidential and=
 may be privileged. It is intended only for the addressee. Any unauthor=
ised distribution or disclosure is prohibited. Disclosure to anyone oth=
er than the intended recipient does not constitute waiver of privilege.=
<br>
If you have received this e-mail in error, please notify the sender by =
e-mail and delete it and any attachments from your computer system and =
records.<br>
HALDOR TOPS=D8E A/S (www.haldortopsoe.com)<br>
-----------------------------------------------------------------------=
-----------</body></html>=
From: Jonathan M. <jma...@qu...> - 2007年07月26日 14:58:20
Hi,
 I'm havind difficulty plotting saving pylab images in pdf format. At =
the moment, they are saved as .png files by default using:=20
savefig('name',dpi=3D300)
However, if I try:
savefig('name.pdf')
The program crashes. Is there anyway of solving this problem?
Regards,
Jony
From: J M. <j....@nt...> - 2007年07月26日 14:20:31
Hi,
 I'm havind difficulty plotting saving pylab images in pdf format. At =
the moment, they are saved as .png files by default using:=20
savefig('name',dpi=3D300)
However, if I try:
savefig('name.pdf')
The program crashes. Is there anyway of solving this problem?
Regards,
Jony
From: Brian B. <bb...@br...> - 2007年07月26日 13:30:31
Hello
I am having trouble saving a figure to pdf on Mac OS X (matplotlib 
version 0.90.1). I applied the patch for pylab, here:
http://www.mail-archive.com/mat...@li.../ 
msg00940.html
and it works with pylab. But, if I use matplotlib.Figure directly in 
an app, and then call:
myfig.savefig('blah.pdf') it saves it as 'blah.pdf.jpg', a jpeg file.
any ideas? I can try to throw together some example, in case someone 
needs to repeat it.
		thanks,
			Brian Blais
-- 
Brian Blais
bb...@br...
http://web.bryant.edu/~bblais
From: Eric F. <ef...@ha...> - 2007年07月25日 21:25:22
Attachments: Lorenzo2.py
Lorenzo Isella wrote:
> Eric Firing wrote:
>> Lorenzo,
>>
>> 1) What version of mpl are you using?
>>
>> 2) Please generate a short, simple stand-alone script that illustrates 
>> the problem. Use some minimal amount of fake data, preferably 
>> generated by a function rather than read from a table.
>>
>> Eric
>>
> Dear Eric,
> Thanks for your help.
> (1) To be fair, I am quite a newbie and I do not know. I am using Debian 
> testing on my box; is there an easy way to find out what mpl I have 
> installed? However, I installed pylab from standard repositories, if 
> that matters.
import matplotlib
print matplotlib.__version__
> (2) Here I first present a script with fake data (basically I generate a 
> function for the contour plot) and the original one using two input 
> data files (I have no really other choice here, since with a function I 
> cannot reproduce the bug so far).
The problem seems to be the previous plot, which is fouling up the 
colorbar axes tick labeling. This looks like a bug, but I have not 
tried to track it down. In any case if you don't make the previous plot 
then the colorbar labeling is OK. See attached modification of your 
second script.
Eric
From: Eric F. <ef...@ha...> - 2007年07月24日 23:06:00
Lorenzo,
1) What version of mpl are you using?
2) Please generate a short, simple stand-alone script that illustrates 
the problem. Use some minimal amount of fake data, preferably generated 
by a function rather than read from a table.
Eric
Lorenzo Isella wrote:
> Dear All,
> Some weeks ago I emailed the list asking how to represent data on a 
> non-rectangular domain (namely a velocity component along a tube 
> cross-section in my case).
> I now can tell that everything goes as in the example described by 
> Hansen in Matplotlib-users Digest, Vol 14, Issue 13, which dealt about 
> plotting a contour of gridded data.
> However, when I try the following (rsin_t and rcos_t contain the 
> position of a point on a circle, namely
> (r*cos(t), r*sin(t)) ):
> 
> import pylab
> #.... do my stuff here to load the data and manipulate the coordinates
> 
> #pylab.colorbar()
> pylab.clf()
> pylab.contourf(rsin_t.transpose(), rcos_t.transpose(), 
> vel_section.transpose(),arange(min(ravel(vel_section)),(max(ravel(vel_section))+0.01),0.01),interpolation="bilinear",cmap=pylab.cm.jet)
> pylab.colorbar()
> 
> #pylab.show()
> 
> pylab.savefig("velocity_on_section.png")
> pylab.hold(False)
> 
> Everything is almost fine if it was not for the following two problems:
> (1)the colorbar contains shows colors ranging from 0 to 1, whereas the 
> represented scalar for the contour plot goes from 0 to 0.76.
> (2)centered below the colorbar (not at its left-hand side, where there 
> is a 0), there is a number with many digits which cannot be even 
> properly read; I do not know where it comes from, but I would like to 
> get rid of it.
> 
> Overall, pylab is doing everything I want, just I would like to iron out 
> these last glitches, probably due to something I am doing wrong.
> Many thanks for any suggestion here.
> 
> Lorenzo
> 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Lorenzo I. <lor...@gm...> - 2007年07月24日 22:46:05
Dear All,
Some weeks ago I emailed the list asking how to represent data on a 
non-rectangular domain (namely a velocity component along a tube 
cross-section in my case).
I now can tell that everything goes as in the example described by 
Hansen in Matplotlib-users Digest, Vol 14, Issue 13, which dealt about 
plotting a contour of gridded data.
However, when I try the following (rsin_t and rcos_t contain the 
position of a point on a circle, namely
(r*cos(t), r*sin(t)) ):
import pylab
#.... do my stuff here to load the data and manipulate the coordinates
#pylab.colorbar()
pylab.clf()
pylab.contourf(rsin_t.transpose(), rcos_t.transpose(), 
vel_section.transpose(),arange(min(ravel(vel_section)),(max(ravel(vel_section))+0.01),0.01),interpolation="bilinear",cmap=pylab.cm.jet)
pylab.colorbar()
#pylab.show()
pylab.savefig("velocity_on_section.png")
pylab.hold(False)
Everything is almost fine if it was not for the following two problems:
(1)the colorbar contains shows colors ranging from 0 to 1, whereas the 
represented scalar for the contour plot goes from 0 to 0.76.
(2)centered below the colorbar (not at its left-hand side, where there 
is a 0), there is a number with many digits which cannot be even 
properly read; I do not know where it comes from, but I would like to 
get rid of it.
Overall, pylab is doing everything I want, just I would like to iron out 
these last glitches, probably due to something I am doing wrong.
Many thanks for any suggestion here.
Lorenzo
From: Greg W. <gre...@gm...> - 2007年07月24日 19:30:53
Nevermind. I'm an idiot. I removed the call to update_line() before p.show()
and now it works. That was cruft left over from earlier experiments
Cheers,
Greg
On 7/24/07, Greg Willden <gre...@gm...> wrote:
>
> Hello All,
> I'm looking for the most efficient way to perform 2D plot animations.
>
> I've been experimenting with the animation examples from the Matplotlib
> cookbook. More specifically I'm using a version of "Animating selected plot
> elements" that has been modified to work with wxWidgets. I want to do the
> same type of thing but with 2D plots ( i.e. imshow).
>
>
> When I try ax.draw_artist(im) where "im" is the AxesImage returned from
> the initial call to imshow I get an AssertionError for self._cachedRenderer
> is not None.
>
>
> What am I doing wrong?
> Thanks
> Greg
>
>
> Here is my hacked up version of the example.
> <code>
> # The number of blits() to make before exiting
> NBLITS = 1000
>
> import matplotlib
> matplotlib.use('WXAgg')
> matplotlib.rcParams['toolbar'] = None
>
> import wx
> import sys
> import pylab as p
> import matplotlib.numerix as nx
> import time
>
> # allow the user to disable the WXAgg accelerator from the command line
> if '--no-accel' in sys.argv:
> import matplotlib.backends.backend_wxagg
> matplotlib.backends.backend_wxagg._use_accelerator(False)
>
> ax = p.subplot(111)
> canvas = ax.figure.canvas
>
> p.subplots_adjust (left=0.3, bottom=0.3) # check for flipy bugs
> p.grid() # to ensure proper background restore
>
> # create the initial line
> appx = 10.0
> appy = 3.8
> delta = 0.125
> x = p.arange(-appx/2.0, appx/2.0, delta)
> y = p.arange(-appy/2.0, appy/2.0, delta)
> X, Y = p.meshgrid(x, y)
> # bivariate_normal(X, Y,sigmax,sigmay,mux,muy)
> Z = p.bivariate_normal(X, Y, 0.9, 0.7, 4.1, -0.15)
>
> im = p.imshow(Z,cmap=p.cm.hot)
>
> # for profiling
> tstart = time.time()
> blit_time = 0.0
>
> def update_line(*args):
> global blit_time
>
> if update_line.background is None:
> update_line.background = canvas.copy_from_bbox(ax.bbox )
>
> # restore the clean slate background
> canvas.restore_region(update_line.background)
> # update the data
> im.set_data(p.bivariate_normal(X,Y,
> 0.9,0.7,
> 4.1+p.sin(update_line.cnt/20.0),
> -0.15+p.cos(update_line.cnt/10.0)))
> # just draw the animated artist
> ax.draw_artist(im)
> # just redraw the axes rectangle
>
> t = time.time()
> canvas.blit(ax.bbox)
> blit_time += time.time() - t
>
> if update_line.cnt == NBLITS:
> # print the timing info and quit
> frame_time = time.time() - tstart
> print '%d frames: %.2f seconds' % (NBLITS, frame_time)
> print '%d blits: %.2f seconds' % (NBLITS, blit_time)
> print
> print 'FPS: %.2f' % (NBLITS/frame_time)
> if blit_time > 0:
> print 'BPS: %.2f' % (NBLITS/blit_time)
> global timer
> timer.Stop()
>
> update_line.cnt += 1
>
>
>
> update_line.cnt = 0
> update_line.background = None
> TIMER_ID=100
> panel = wx.GetApp()
> global timer
> timer = wx.Timer(panel,TIMER_ID)
> timer.Start(10)
> wx.EVT_TIMER(panel,TIMER_ID, update_line)
> update_line()
> p.show()
>
> </code>
> --
> Linux. Because rebooting is for adding hardware.
-- 
Linux. Because rebooting is for adding hardware.
From: Greg W. <gre...@gm...> - 2007年07月24日 17:58:32
Hello All,
I'm looking for the most efficient way to perform 2D plot animations.
I've been experimenting with the animation examples from the Matplotlib
cookbook. More specifically I'm using a version of "Animating selected plot
elements" that has been modified to work with wxWidgets. I want to do the
same type of thing but with 2D plots (i.e. imshow).
When I try ax.draw_artist(im) where "im" is the AxesImage returned from the
initial call to imshow I get an AssertionError for self._cachedRenderer is
not None.
What am I doing wrong?
Thanks
Greg
Here is my hacked up version of the example.
<code>
# The number of blits() to make before exiting
NBLITS = 1000
import matplotlib
matplotlib.use('WXAgg')
matplotlib.rcParams['toolbar'] = None
import wx
import sys
import pylab as p
import matplotlib.numerix as nx
import time
# allow the user to disable the WXAgg accelerator from the command line
if '--no-accel' in sys.argv:
 import matplotlib.backends.backend_wxagg
 matplotlib.backends.backend_wxagg._use_accelerator(False)
ax = p.subplot(111)
canvas = ax.figure.canvas
p.subplots_adjust(left=0.3, bottom=0.3) # check for flipy bugs
p.grid() # to ensure proper background restore
# create the initial line
appx = 10.0
appy = 3.8
delta = 0.125
x = p.arange(-appx/2.0, appx/2.0, delta)
y = p.arange(-appy/2.0, appy/2.0, delta)
X, Y = p.meshgrid(x, y)
# bivariate_normal(X, Y,sigmax,sigmay,mux,muy)
Z = p.bivariate_normal(X, Y, 0.9, 0.7, 4.1, -0.15)
im = p.imshow(Z,cmap=p.cm.hot)
# for profiling
tstart = time.time()
blit_time = 0.0
def update_line(*args):
 global blit_time
 if update_line.background is None:
 update_line.background = canvas.copy_from_bbox(ax.bbox)
 # restore the clean slate background
 canvas.restore_region(update_line.background)
 # update the data
 im.set_data(p.bivariate_normal(X,Y,
 0.9,0.7,
 4.1+p.sin(update_line.cnt/20.0),
 -0.15+p.cos(update_line.cnt/10.0)))
 # just draw the animated artist
 ax.draw_artist(im)
 # just redraw the axes rectangle
 t = time.time()
 canvas.blit(ax.bbox)
 blit_time += time.time() - t
 if update_line.cnt == NBLITS:
 # print the timing info and quit
 frame_time = time.time() - tstart
 print '%d frames: %.2f seconds' % (NBLITS, frame_time)
 print '%d blits: %.2f seconds' % (NBLITS, blit_time)
 print
 print 'FPS: %.2f' % (NBLITS/frame_time)
 if blit_time > 0:
 print 'BPS: %.2f' % (NBLITS/blit_time)
 global timer
 timer.Stop()
 update_line.cnt += 1
update_line.cnt = 0
update_line.background = None
TIMER_ID=100
panel = wx.GetApp()
global timer
timer = wx.Timer(panel,TIMER_ID)
timer.Start(10)
wx.EVT_TIMER(panel,TIMER_ID, update_line)
update_line()
p.show()
</code>
-- 
Linux. Because rebooting is for adding hardware.
From: Darren D. <dd...@co...> - 2007年07月24日 17:16:52
On Tuesday 24 July 2007 12:59:54 pm Peter W=FCrtz wrote:
> Hi,
>
> > Try getting your system set up to use the xpdf distiller, that has alwa=
ys
> > given me excellent results.
>
> Thanks alot! Using xpdf gives perfect results!
> http://www.staff.uni-mainz.de/wuertz/matplotlib/xpdf_tof_spectrum_bec_500=
ns
>.eps
> http://www.staff.uni-mainz.de/wuertz/matplotlib/xpdf_tof_spectrum_bec_500=
ns
>.pdf
Good. If you insert those into another latex document and create a pdf, the=
=20
text in your figure will even be searchable!
> > There have been many problems reported on this mailing list that concern
> > latex markup. Most often, people have difficulty getting usetex to work
> > because matplotlib depends on latex, dvipng, ghostscript, and optionally
> > xpdf (more precisely, xpdf's pdftops utility).
>
> The problem is, the whole plot/ps/eps/dvi/ghostscript/pdf/xpdf/distiller
> process is totally obscure to a normal user.=20
We know, but it is the best we have been able to do so far. It is a difficu=
lt=20
problem to solve. We document what we have, as best we can, at the usetex=20
wiki page, but it sometimes gets overlooked. There has been some effort to=
=20
produce a utility to parse the dvi file and use that information directly,=
=20
which would cut the external deps back to only latex.
> For example, i don't have=20
> xpdf installed... but choosing the xpdf setting gives me perfect results
> now. If I understand you correctly, I just need the "pdftops" utility
> included in "poppler-utils".
Thats right. Maybe I should change the rc keyword, which was named when=20
pdftops was part of xpdf.=20
Darren
2 messages has been excluded from this view by a project administrator.

Showing results of 219

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