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



Showing results of 148

<< < 1 .. 4 5 6 (Page 6 of 6)
From: Matt F. <mfi...@us...> - 2004年03月03日 02:19:26
Hello,
 
I'm trying to convert my python program that uses matplotlib to an exe
using py2exe and I'm having a problem. 
Running
>python setup.py py2exe
works fine and creates files in the /dist path. However, when I run the
.exe I get a runtime error (see below)
 
Traceback (most recent call last):
 File "out2jpg.py", line 124, in ?
 File "matplotlib\matlab.pyc", line 497, in figure
 File "matplotlib\backends\backend_wx.pyc", line 1066, in
new_figure_manager
 File "matplotlib\backends\backend_wx.pyc", line 1094, in __init__
 File "matplotlib\backends\backend_wx.pyc", line 1320, in __init__
 File "matplotlib\backends\backend_wx.pyc", line 1340, in
_create_controls
 File "matplotlib\backends\backend_wx.pyc", line 1191, in _load_bitmap
 File "matplotlib\__init__.pyc", line 157, in get_data_path
RuntimeError: Could not find the matplotlib data files
 
--Matt
 
 
From: Phil E. <pj...@ha...> - 2004年03月02日 22:13:28
Hi all,
 I am really enjoying working with matplotlib and hats off to an 
excellent effort.
 I have done a cursory search of the mailing list archives but didn't 
find the answer to a practical question that I ran into in MATLAB all 
the time (which is where I'm coming from in terms of familiarity).
 Suppose I have an array to plot, and I want to exclude certain points 
from being plotted. In MATLAB, I would set the y vector points I wanted 
excluded to "NaN" and then the plot routine would draw connected lines 
up to the point before the excluded one, skip the bad/not wanted point, 
and then continue drawing lines beginning at the next point.
 How does one accomplish that using matplotlib? This actually comes 
up quite often in our radar work here, in cases where we are making log 
plots of vectors which may contain zeros.
cheers,
-- 
----
Phil Erickson email: pj...@ha...
Atmospheric Sciences Group WWW: http://www.haystack.mit.edu
MIT Haystack Observatory voice: 781 981 5769
Westford, MA 01886 USA fax: 781 981 5766
Public key: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x54878872
From: John H. <jdh...@ac...> - 2004年03月02日 15:57:59
>>>>> "Dominique" == Dominique Orban <do...@da...> writes:
 Dominique> Allright thanks. In Linux, i can compile the new
 Dominique> matplotlib with gcc 3.3. I notice the same problem
 Dominique> with fontTools. This time i do have a FontTools.pth in
 Dominique> my source directory, but it isn't copied to
 Dominique> /whatever/python2.3/site-packages when i run python
 Dominique> setup.py install.
Just copy the file to site-packages. This problem is fixed in CVS but
with Paul's new font finder hopefully it will soon be a non-issue.
 Dominique> Now it doesn't find _backend_agg. Sorry to be bugging
 Dominique> you with all these minor annoyances.
No problem - I want to fix these problems as soon as possible so keep
them coming. 
Did you edit setup.py? You need to set the flags BUILD_AGG and
BUILD_FONTTOOLS. If this doesn't do it for you, please post compile
errors or tracebacks.
 Dominique> Also i notice the 'afm' problem i reported earlier with
 Dominique> the PS backend hasn't been fixed. Did you receive my
 Dominique> little fix?
Thanks for the reminder - it had slipped too low in the pile and I
forgot about it. It's in now.
JDH
From: Paul B. <ba...@st...> - 2004年03月02日 15:18:59
John Hunter wrote:
> 
> ttfquery and FontTools are packages to enable cross platform
> font-finding. I am very interested in factoring out this dependency
> since it complicates installation (as you are seeing). [ Perry, if
> anyone in your group is still interested in this, there is a
> reasonably well documented example in cvs examples/ftface_props.py
> that shows how to access all the relevant freetype attributes (family
> name, is italics, etc) using the matplotlib.ft2face module ]
Hi John,
I'm currently working on a replacment for FontTools. I hope to have something 
out in the next day or so.
 -- Paul
-- 
Paul Barrett, PhD Space Telescope Science Institute
Phone: 410-338-4475 ESS/Science Software Branch
FAX: 410-338-4767 Baltimore, MD 21218
From: Dominique O. <do...@da...> - 2004年03月02日 15:10:30
* On 2004年3月02日, John Hunter wrote:
>
> >>>>> "Dominique" == Dominique Orban <do...@da...> writes:
> 
> Dominique> I don't have it actually. It is on neither of my
> Dominique> Windows installs. Can i just create it?
> 
> OK, this is a bug in the windows installer - fixed for next release.
> Yes, just create it.
Allright thanks. In Linux, i can compile the new matplotlib with gcc 3.3.
I notice the same problem with fontTools. This time i do have a
FontTools.pth in my source directory, but it isn't copied to
/whatever/python2.3/site-packages when i run
python setup.py install.
Now it doesn't find _backend_agg. Sorry to be bugging you with all
these minor annoyances.
Also i notice the 'afm' problem i reported earlier with the PS
backend hasn't been fixed. Did you receive my little fix?
Dominique
From: John H. <jdh...@ac...> - 2004年03月02日 14:56:24
>>>>> "Dominique" == Dominique Orban <do...@da...> writes:
 Dominique> I don't have it actually. It is on neither of my
 Dominique> Windows installs. Can i just create it?
OK, this is a bug in the windows installer - fixed for next release.
Yes, just create it.
 Dominique> I haven't seen any other user complain about
 Dominique> this. Could this come from an upgrade of matplotlib?
 Dominique> During the upgrade, it seems to be backing up stuff but
 Dominique> who knows what it is doing exactly.
Well, you would only notice it if 1) you haven't installed FontTools
before 2) you are using windows 3) you are trying to use on of the
FontTools dependent backends (Agg, GD) and 4) you are kind enough to
report the problem. 
 Dominique> The font.cache is in site-packages/ttfquery, i presume
 Dominique> this is correct?
After you fix the FontTools.pth problem erase this file and it will be
automagically recreated by ttfquery.
JDH
From: Dominique O. <do...@da...> - 2004年03月02日 14:00:05
* On 2004年3月02日, John Hunter wrote:
> Critically, you should also have
> c:\Python23\Lib\site-packages\FontTools.pth. I am pretty certain it
> is in the windows installer. This file should contain one line, which
> reads simply 
> 
> FontTools
> 
> If you don't have it I would like to know! 
I don't have it actually. It is on neither of my Windows installs.
Can i just create it?
I haven't seen any other user complain about this. Could this come from
an upgrade of matplotlib? During the upgrade, it seems to be backing up
stuff but who knows what it is doing exactly.
 
> All of this is consistent with a missing FontTools.pth. ttfquery will
> try and load each windows font, but catches all exceptions and
> continues. So you'll get an exception *for each font* the first time
> you load ttfquery if something is wrong with your install. After you
> have fixed fontools, be sure to remove site-packages/font.cache so
> ttfquery can regenerate the font cache.
The font.cache is in site-packages/ttfquery, i presume this is correct?
 
> Agg is a pure image backend - ie, it only produces image output. In
> the next release of matplotlib (this week) there will are 2 GUI
> backends that use agg for rendering GtkAgg and TkAgg, both of which
> are compiled into the windows installer.
Great!
 
Thanks much,
Dominique
From: Dominique O. <do...@da...> - 2004年03月02日 13:50:52
* On 2004年3月02日, John Hunter wrote:
>
> >>>>> "Dominique" == Dominique Orban <do...@da...> writes:
> 
> Dominique> I am in Windows 2000 and XP. I am using 0.50e in Linux,
> Dominique> because i am upgrading my gcc. The newer 0.50 won't
> Dominique> compile with the gcc i have now. I only get the 'None
> Dominique> Active' in Linux though. I suspect it comes from my
> Dominique> GTK. I am using KDE and installing Gnome libraries when
> Dominique> i need them. There might be a glitch somewhere.
> 
> Note, you can just set all the BUILD_* flags at the top of setup.py
> and matplotlib won't try and compile anything. It will install all of
> the pre 0.50 modules (GTK, WX, PS, etc) but you won't have access to
> Agg.
Yes i will try that to start with. In the end, i'll want to use Agg
though, given the apparent quality of the plots.
 
> For the record, what gcc were you using and what error message did you
> get? 
gcc version 2.95.3 20010315 (SuSE)
I wanted to try the Intel c++ compiler for Linux, but am not sure how
to tell setup.py which compiler i want to use and with which options.
'python setup.py build' eventually gives
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC -Isrc -Iagg2/include -I/usr/include/freetype1 -I/usr/local/include/python2.3 -c src/_backend_agg.cpp -o build/temp.linux-i686-2.3/src/_backend_agg.o
In file included from /usr/local/include/python2.3/Python.h:8,
 from src/_backend_agg.h:40,
 from src/_backend_agg.cpp:8:
 /usr/local/include/python2.3/pyconfig.h:847: warning: `_POSIX_C_SOURCE' redefined
 /usr/include/features.h:171: warning: this is the location of the previous definition
 src/_backend_agg.cpp:286: multiple storage classes in declaration of `RendererAgg_Type'
error: command 'gcc' failed with exit status 1
Many thanks for the help.
Dominique
From: John H. <jdh...@ac...> - 2004年03月02日 13:22:58
>>>>> "Dominique" == Dominique Orban <do...@da...> writes:
 Dominique> I am in Windows 2000 and XP. I am using 0.50e in Linux,
 Dominique> because i am upgrading my gcc. The newer 0.50 won't
 Dominique> compile with the gcc i have now. I only get the 'None
 Dominique> Active' in Linux though. I suspect it comes from my
 Dominique> GTK. I am using KDE and installing Gnome libraries when
 Dominique> i need them. There might be a glitch somewhere.
Note, you can just set all the BUILD_* flags at the top of setup.py
and matplotlib won't try and compile anything. It will install all of
the pre 0.50 modules (GTK, WX, PS, etc) but you won't have access to
Agg.
For the record, what gcc were you using and what error message did you
get? 
Thanks,
JDH
From: John H. <jdh...@ac...> - 2004年03月02日 13:19:08
>>>>> "Dominique" == Dominique Orban <do...@da...> writes:
 Dominique> Just wanted to signal some path issues with the current
 Dominique> Windows installer. I have looked in the mailing list,
 Dominique> but haven't seen anyone having the same problem.
 Dominique> In both Windows 2000 and XP, installation of Matplotlib
 Dominique> 0.50 results in the following directory hierarchy in my
 Dominique> main Python directory c:\Python23\Lib\site-packages
 Dominique> (Enthought Edition):
 Dominique> FontTools/ fontTools/ sstruct.py ttLib/
Critically, you should also have
c:\Python23\Lib\site-packages\FontTools.pth. I am pretty certain it
is in the windows installer. This file should contain one line, which
reads simply 
FontTools
If you don't have it I would like to know! 
ttfquery and FontTools are packages to enable cross platform
font-finding. I am very interested in factoring out this dependency
since it complicates installation (as you are seeing). [ Perry, if
anyone in your group is still interested in this, there is a
reasonably well documented example in cvs examples/ftface_props.py
that shows how to access all the relevant freetype attributes (family
name, is italics, etc) using the matplotlib.ft2face module ]
 Dominique> it says it cannot import 'fontTools' (lowercase f,
 Dominique> uppercase T). Changing the name of the top directory
 Dominique> (FontTools) to 'fontTools' doesn't solve it of course,
 Dominique> since what it is looking for is the innermost
 Dominique> one. Hence i must move the 'fontTools' directory one
 Dominique> level up. Next, it can import ttLib, scans my TTFPATH,
 Dominique> but breaks down (after litterally one zillion messages)
 Dominique> saying that 'module' has no attribute 'SFNTReader'. It
 Dominique> is in fact trying to import sfnt and is stuck in the
 Dominique> __init__() of Class TTFont. Drastically reducing my
 Dominique> TTFPATH, i see that the error is in fact coming from
 Dominique> the fact that it cannot import module 'sstruct' in
 Dominique> sfnt.py.
All of this is consistent with a missing FontTools.pth. ttfquery will
try and load each windows font, but catches all exceptions and
continues. So you'll get an exception *for each font* the first time
you load ttfquery if something is wrong with your install. After you
have fixed fontools, be sure to remove site-packages/font.cache so
ttfquery can regenerate the font cache.
 Dominique> That stuns me. A 'from fontTools import sstruct' would
 Dominique> do. How comes Python isn't looking recursively into
 Dominique> directories? I guess moving everything to the top level
 Dominique> isn't a good idea. Also, still in sfnt.py, the 'import
 Dominique> struct' works, but i have no clue where it finds this
 Dominique> one; a search was unsuccessful. Anyhow, including
 Dominique> 'c:\Python23\fontTools' into the PYTHONPATH solves it
 Dominique> but i thought directories would be parsed recursively.
 Dominique> Also, can you only use savefig() with the Agg backend?
 Dominique> show() isn't popping any window.
Agg is a pure image backend - ie, it only produces image output. In
the next release of matplotlib (this week) there will are 2 GUI
backends that use agg for rendering GtkAgg and TkAgg, both of which
are compiled into the windows installer.
 Dominique> As they told me to at SuSE, i'm having a lot of fun.
You mean battling the hairy windows beast?
JDH
From: Jean-Baptiste C. <Jea...@de...> - 2004年03月02日 10:09:12
S=E6l=20
Thanks for the detailed answerS I will try to go one step further for the u=
nclear question.
I hope this will help other users too :)
> - I want to systematically disable the vertical zoom/move on the
> second subplot, but not the first. How can I do that ?
>=20
> Well, when the menu is working properly that is how you do it. By
> "systematically", do you mean by default so it's disabled when the
> plot comes up?
>=20
> If so, this depends on how you are building your GUI window.
> Basically you need to get your hands on the gtk.Toolbar instance,
> which contains an omenu (gtk.OptionMenu) attribute (wait until the
> next release, a couple of days, where I've cleaned this up a bit).
> Eg, if you are using the matlab interface
>=20
> manager =3D get_current_fig_manager()
> items =3D manager.toolbar.omenuItems
> items[-1].set_active(False)
>=20
> Turns off navigation for the last subplot. items[0] would turn off
> navigation for the first subplot, and so on.
Indeed I meant 'by default' and you answered partially my question.
I would like to disable only the veritcal zoom, not the horizontal one.
Is it possible ?
> - How can I activate a tooltip on top of my plots ?
>=20
> You'll have to read up on gtk tooltips. Depends on what elements you
> want to add tips to. Give me a little more info. DO you want to add
> tips to the navigation buttons or lines on your plot or text elements
> or what?
I am aware of tooltips in pygtk, and I would liek to use them on the axes o=
nly.
As I understood those axes are included in a figure which is a DrwaingArea.=
 But DrawingArea do not accept tooltip easily.
Did you implement a workaround to have a tooltip on the axes
> - How could I add a button to directly print out the picture in the too=
lbar ?
>=20
> Print as in to a printer? No support for that yet and am not sure I
> want to go there right now (cross platform printing would might take
> lot of work). Best I can offer you currently is the savefig button.
> I think gnome-print has made a fair amount of progress since I first
> wrote matplotlib so if you want to be on the vanguard and explore this
> option I would be happy.
I used the NavigationToolbar as a GTKToolbar and added a button with the fu=
nction I wanted.
This solved my problem
> - Is there any density plot available ?
>=20
> Do you mean hist?
The histogram provide a similar plot to what I want.
I am currently using it, but when i zoom horizontally I can get very few an=
d large bars.
Therefore I would be interested in a simple curve fitted to pass through al=
l the tops of histograms.
This would make the picture more consistent throughout the zooming
If the curve was filled it would be even better :)
> - I have MANY small plots on my graph. Is there a cost effective way
> to filter which plots to show ?
>=20
> I don't know what this means. Wouldn't you want to show all the plots
> on your figure? Why else would you put them there? Please elaborate.
Within one Sublot I have thousands of small "lines" plotted. This takes tim=
e to draw and show on the screen
Within my software I would like to be able to filter interactively that inf=
ormation according to various criteria to show only few of them
In order to do that cost effectively I was wondering if matplotlib provides=
 an option to show/hide specific "lines" that I could turn on/off
That woudl avoid me to redraw the whole picture after 1 single change
Takk
Kve=F0ja
Jean-Baptiste
--=20
-----------------------------
Jea...@de...
Department of Statistics
deCODE genetics Sturlugata,8
570 2993 101 Reykjav=EDk
From: Dominique O. <do...@da...> - 2004年03月02日 06:30:33
Just wanted to signal some path issues with the current
Windows installer. I have looked in the mailing list, but
haven't seen anyone having the same problem.
In both Windows 2000 and XP, installation of Matplotlib 0.50
results in the following directory hierarchy in my main Python
directory c:\Python23\Lib\site-packages (Enthought Edition):
 FontTools/
 fontTools/
 sstruct.py
 ttLib/
When i try to import the Agg backend:
 import matplotlib
 matplotlib.use( 'Agg' )
 from matplotlib.matlab import *
it says it cannot import 'fontTools' (lowercase f, uppercase T).
Changing the name of the top directory (FontTools) to 'fontTools'
doesn't solve it of course, since what it is looking for is the
innermost one. Hence i must move the 'fontTools' directory one
level up. Next, it can import ttLib, scans my TTFPATH, but breaks
down (after litterally one zillion messages) saying that 'module'
has no attribute 'SFNTReader'. It is in fact trying to import
sfnt and is stuck in the __init__() of Class TTFont. Drastically
reducing my TTFPATH, i see that the error is in fact coming from
the fact that it cannot import module 'sstruct' in sfnt.py.
That stuns me. A 'from fontTools import sstruct' would do. How
comes Python isn't looking recursively into directories? I guess
moving everything to the top level isn't a good idea. Also,
still in sfnt.py, the 'import struct' works, but i have no clue
where it finds this one; a search was unsuccessful. Anyhow,
including 'c:\Python23\fontTools' into the PYTHONPATH solves it
but i thought directories would be parsed recursively.
Also, can you only use savefig() with the Agg backend? show()
isn't popping any window.
As they told me to at SuSE, i'm having a lot of fun.
Dominique
From: Dominique O. <do...@da...> - 2004年03月02日 06:18:24
* On 2004年3月01日, John Hunter wrote:
> It looks like there is a "print" statement somewhere in your code.
> It's possible that this was from a vestigial debug command I left in.
> I don't get get it on my system. Are you using matplotlib-0.50? I
> also don't get the "None Active" line.
I am in Windows 2000 and XP. I am using 0.50e in Linux, because i am
upgrading my gcc. The newer 0.50 won't compile with the gcc i have now.
I only get the 'None Active' in Linux though. I suspect it comes from
my GTK. I am using KDE and installing Gnome libraries when i need them.
There might be a glitch somewhere.
 
> I'm using this as a test script 
> 
> from matplotlib.matlab import *
> 
> x = 100*rand(100000)
> y = 100*rand(100000)
> s = rand(100000)
> 
> scatter(x,y,s)
> #plot(x,y,'o')
> show()
> 
> Takes about 30s on my system. Note that plot with circles can be must
> faster that scatter if you don't need to vary the size or color of the
> symbols.
I see that plot is usually faster than scatter. The script works fine
with smaller data sets, and takes a pretty long time with larger sets.
 
> There are several areas where matplotlib performance is subpar -
> mostly for large numbers of patches (circles for scatter, rectangles
> for pcolor). Fixing this is a fairly high priority and I have a good
> idea how to go about it - see
> http://sourceforge.net/mailarchive/message.php?msg_id=7142332 for a
> recent discussion. I think in the next 3-4 weeks I can get this
> fixed. Basically, the plan is to set up an additional backend method
> or two that the various backends may optionally implement in extension
> code for performance.
That would be wonderful. I have never looked into the Gnuplot code but
they have a fairly efficient algorithm. Plotting data sets like that i
described takes less than a second on my laptop (from the Python
interface). It would be great if matplotlib could do it too.
 
> Are you using the default GTK that comes with SuSE or did you upgrade?
> I have gotten myself into a world of pain before trying to upgraded
> GTK libs on a linux box. It does look like you are getting some
> unusual behavior. Make sure you are using the latest matplotlib and
> try running the test script I posted above. If you still get the same
> errors, something is whacked with your install or paths. Otherwise,
> stay tuned for performance enhancements coming soon to theaters
> everywhere.
You can be sure i'm staying tuned.
Dominique
From: John H. <jdh...@ac...> - 2004年03月01日 23:47:37
>>>>> "James" == James Boyle <bo...@ll...> writes:
 James> I have used nc = 3 or 4 if I use the plot command and all
 James> the plots are squished into the subregions for which I
 James> asked - even if things get ugly.
This is a one character bug!
I mainly use multiple rows in my own plots and never noticed it. On
or around line 1492 in axes.Subplot.__init__
change
 figLeft = left + colNum*(figW + sepH)
 ^
to
 figLeft = left + colNum*(figW + sepW)
 ^
Thanks for the detailed bug report and example code.
JDH 
From: Arnold M. <arn...@wu...> - 2004年03月01日 23:25:35
Dear John,
> Well, the behavior you are seeing is the correct, documented
> behavior. I think it would be easier for you to pass errorbar what it
> is expecting than for errorbar to handle this additional use case -
> it's already getting pretty hairy in there.
> 
> DO you have a problem doing
> 
> errorbar([1],[2],xerr=[.1])
Not really, it's just that I hate to think beforehand about whether a
routine eats everything or just arrays ;). The adjustments needed are
only minor I found out, after sending the previous mail. Here is the
diff against matplotlib-0.50e
<diff>
> 
> 7c7
< log10, Float
---
> log10, Float, NewAxis
527a528,531
> if (len(x.shape) == 0): x=x[NewAxis,] if (len(y.shape) == 0): 
> y=y[NewAxis,]
533,534c537,544
< if xerr is not None: xerr = asarray(xerr)
< if yerr is not None: yerr = asarray(yerr)
---
> if xerr is not None: xerr = asarray(xerr) if (len(xerr.shape) == 0): 
> xerr=xerr[NewAxis,] if yerr is not None: yerr = asarray(yerr) if
> (len(yerr.shape) == 0): yerr=yerr[NewAxis,]
</diff>
> 
> You're not the first! The temporary workaround is to use 
> plot(x,y,'o') which uses fixes sizes in points for the symbols (you
> can also use '*', '+', etc) However, you cannot vary the size or
> color of the symbols so this may not be workable.
I'm perfectly happy with the plot command to do normal scatter plots. I
even think that it would be more logical (but perhaps not
matlab-compatible) to move all machinery of scatter to plot.
You asked for information of how people (would like to) use scatter
plots. Well, my wishlist for scatter would be more or less like (sorry
it's a long wishlist, but see them as suggestions, not commands!):
* Scatter plots of symbols where the size of the symbols can be set per
 x-y pair. The use of this is that it depends on the number of points
 whether you want tiny dots, or large circles (the latter being nice
 when you have 10 points, but not when you have a million. For me,
 the size does not need to be specified in points, or another seemingly
 exact measure. I can live with a 'default size' (say 1/100 of the
 smallest of the axes) and a multiplier that can set by the user (like
 in Gnuplot).
* The symbols should be the same kind of symbols as used in plot (i.e.
 squares, triangles, circles etc.). The blob-symbols as plotted now
 should be a special case rather than the default. For myself, I only
 see a useful usage for *circular* (irrespective of axes) blobs where
 the radius is set by the s-keyword. But perhaps others like to have
 ellipsoid blobs that have a *two* axes that make physical sense.
* It would be nice if all symbols -as far as applicable- come in 'open'
 and 'filled' versions (nice if you want to plot in one scatter plot
 data referring to the same physical quantity, but separating between
 daytime and nighttime for instance).
 For me, the number of symbols needed in one plot is rather limited: I
 hardly use more than 4 simultaneously in one scatter plot. On the
 other hand, in general x-y plots (lines, line-points, or points in
 Gnuplot terms) I would like to have at least say 10 symbols, since I
 usually use symbols to clarify the difference between lines, because
 that's easier than to ask the reader to differentiate between dash,
 dash-dot, dash-dash-dot etc.
* With respect to the coloring (c-keyword) it is perhaps easiest if this
 is applied to the symbols directly: just as one can say 'b>' in plot,
 it would be something like:
 scatter(x, y, '>', c=color_array)
* Assume that the new symbol for the 'blobs' would be say '@', then
 scatter(x, y, '@', s=size_array, c=color_array)
 gives colored blobs with unequal axes (as now),
 scatter(x, y, 'b@', s=size_array)
 gives blue blobs with unequal axes
 scatter(x, y, 'b@', s=size_array*-1)
 gives blue blobs with equal axes
 etc.
I hope this helps. And perhaps I can help in some other ways.
With kind regards,
Arnold Moene
> 
> When I refactor the scatter / pcolor etc commands as discussed in my
> response to Dominique Orban above, I'll make sure that this case is
> handled as well. I plan to support efficient handling of scatter
> with arbitrary (or at least several) shapes where the size can be in
> data (x,y) or user-defined coords, eg, physical sizes. It would be
> helpful for me if people gave some information about how they would
> like scatter to behave, particularly in regard to the sizes since I
> am still working this out.
> 
> Would you like physical sizes, eg circles with radius in points, or
> what?
> 
> Should the shape depend on the aspect ratio of the plotting window.
> Eg, if it's a circle and you have a short, wide window, should it
> appear ellipsoidal?
> 
> What basic scatter symbols should be supported?
> 
> What are the most common uses: fixed size? fixed color? vary both?
> 
> JDH
> 
-- 
------------------------------------------------------------------------
Arnold F. Moene NEW tel: +31 (0)317 482604
Meteorology and Air Quality Group fax: +31 (0)317 482811
Wageningen University e-mail: Arn...@wu...
Duivendaal 2 url: http://www.met.wau.nl 6701
AP Wageningen
The Netherlands
------------------------------------------------------------------------
Openoffice.org - Freedom at work
------------------------------------------------------------------------
-- 
------------------------------------------------------------------------
Arnold F. Moene NEW tel: +31 (0)317 482604
Meteorology and Air Quality Group fax: +31 (0)317 482811
Wageningen University e-mail: Arn...@wu...
Duivendaal 2 url: http://www.met.wau.nl
6701 AP Wageningen
The Netherlands
------------------------------------------------------------------------
Openoffice.org - Freedom at work
------------------------------------------------------------------------
From: James B. <bo...@ll...> - 2004年03月01日 22:51:49
I was making subplots using the bar command and ran into a problem I do 
not understand.
nr = number of rows, nc = number of columns
I want nr = 1, i.e. just one row of plots. If nc is 1 or 2 all is 
well, but nc =3 the third plot is cutoff in the middle. If nc = 4, I 
get 3 plots and the fourth cannot be seen.
What seems to be happening is that the subplots are not scaled to fit 
the viewport dictated by suplot(nr,nc,plotNumber).
I have used nc = 3 or 4 if I use the plot command and all the plots 
are squished into the subregions for which I asked - even if things get 
ugly.
I use the PS and Agg backends and both yield similar results.
My code is below.
Thanks for any help.
Jim
The Code:
import matplotlib
matplotlib.use('PS')
#matplotlib.use('Agg')
from matplotlib.matlab import *
import showPS
import showAGG
nTypes = 3
ind = arange(nTypes) # the x locations for the groups
width = .2 # the width of the bars
nr = 1
nc = 3
crap = []
for c in range(nc):
 for r in range(nr):
 subplotID = nc*r + c + 1
 crap.append(subplotID)
 ax = subplot(nr,nc,subplotID)
 frame = ax.get_frame()
 frame.set_linewidth(1.5)
 amip = (20, 35, 30)
 p1 = bar(ind, amip, width, color='r')
 climo = (25, 32, 34)
 p2 = bar(ind+width, climo, width, color='y')
 isccp = (5, 10, 60)
 p3 = bar(ind+2.0*width, isccp, width, color='g')
 atlas = (20, 40, 70)
 p4 = bar(ind+3.0*width, atlas, width, color='b')
 ylabel('Cloud Fraction (%)')
 title('Cloud' + str(subplotID)+'_'+str(c)+'_'+str(r) )
 set(gca(), 'xticks', ind+2*width)
 set(gca(), 'xticklabels', ('low', 'mid', 'high') )
 set(gca(), 'yticks', arange(0,100,10))
 legend( (p1[0], p2[0],p3[0],p4[0]), ('Amip', 
'climo','isccp','atlas') )
savefig('barchart_test')
showPS.showPS('barchart_test')
From: John H. <jdh...@ac...> - 2004年03月01日 15:21:41
>>>>> "Arnold" == Arnold Moene <arn...@wu...> writes:
 Arnold> Dear all, Praise for this first serious python plotting
 Arnold> package!
Thanks!
 Arnold> I have two minor comments:
 -> when I try to do an errorbar plot with a scalar, rather than an
 Arnold> array as the argument (i.e. errorbar(scalar_x, scalar_y,
 Arnold> xerr=scalar_xerr)) I get the following error message:
 Arnold> "/usr/lib/python2.3/site-packages/matplotlib/axes.py",
 Arnold> line 569, in errorbar right = x+xerr[1] IndexError: index
 Arnold> out of bounds
 Arnold> This is due to the fact that the length of xerr is tested
 Arnold> only to be 1 or greater than 1 (asymmetric
 Arnold> errors). However, the option that I would like to plot
 Arnold> just one point is not included. So an extra if-clause is
 Arnold> needed before the present code that checks whether x and
 Arnold> xerr are arrays or not.
Well, the behavior you are seeing is the correct, documented behavior.
I think it would be easier for you to pass errorbar what it is
expecting than for errorbar to handle this additional use case - it's
already getting pretty hairy in there.
DO you have a problem doing
 errorbar([1],[2],xerr=[.1])
 -> I very much like the option for scatter to color the blobs to
 -> be
 Arnold> plotted. However, I have an application where the shape of
 Arnold> the blobs is immaterial: I would rather have filled
 Arnold> circles (or even better: filled symbols, be it circles,
 Arnold> triangles ...). Anyhow: I would like them to be symmetric
 Arnold> irrespective of the range of the axes. One option would be
 Arnold> to allow the s-keyword to be allowed to be negative, where
 Arnold> negative means: symmetric and the value of the negative
 Arnold> number being the size relative to some default size.
You're not the first! The temporary workaround is to use
plot(x,y,'o') which uses fixes sizes in points for the symbols (you
can also use '*', '+', etc) However, you cannot vary the size or
color of the symbols so this may not be workable. 
When I refactor the scatter / pcolor etc commands as discussed in my
response to Dominique Orban above, I'll make sure that this case is
handled as well. I plan to support efficient handling of scatter with
arbitrary (or at least several) shapes where the size can be in data
(x,y) or user-defined coords, eg, physical sizes. It would be helpful
for me if people gave some information about how they would like
scatter to behave, particularly in regard to the sizes since I am
still working this out. 
Would you like physical sizes, eg circles with radius in points, or
what?
Should the shape depend on the aspect ratio of the plotting window.
Eg, if it's a circle and you have a short, wide window, should it
appear ellipsoidal?
What basic scatter symbols should be supported?
What are the most common uses: fixed size? fixed color? vary both?
JDH
From: John H. <jdh...@ac...> - 2004年03月01日 15:08:36
>>>>> "Dominique" == Dominique Orban <do...@da...> writes:
 Dominique> Hello, I am having trouble viewing scatter plots of
 Dominique> large data sets with the GTK backend. The plots are
 Dominique> sparsity patterns of sparse matrices, much in the way
 Dominique> of Matlab's spy function. First of all, there may be a
 Dominique> conflict somewhere with my version of GTK/PyGTK;
 Dominique> issuing a plot() or scatter() command often results in
 Dominique> the message 'None Active' being displayed. After a
 Dominique> couple of seconds, the python prompt comes back, and
 Dominique> the 'scatter' command results in a huge number of
 Dominique> messages of the form
 Dominique> <matplotlib.patches.Circle instance at 0x4531730c>
Hi Dominique, 
It looks like there is a "print" statement somewhere in your code.
It's possible that this was from a vestigial debug command I left in.
I don't get get it on my system. Are you using matplotlib-0.50? I
also don't get the "None Active" line.
I'm using this as a test script 
 from matplotlib.matlab import *
 x = 100*rand(100000)
 y = 100*rand(100000)
 s = rand(100000)
 scatter(x,y,s)
 #plot(x,y,'o')
 show()
Takes about 30s on my system. Note that plot with circles can be must
faster that scatter if you don't need to vary the size or color of the
symbols.
 Dominique> begin displayed; litterally hundreds of them---it takes
 Dominique> some 10 seconds. Finally, a show() opens up a Figure
 Dominique> window, but no plot. The matrix has 80519 nonzero
 Dominique> elements and is symmetric, so the scatter plot contains
 Dominique> roughly twice as many points. I have a Gnuplot
 Dominique> interface and a spy-like function which works just fine
 Dominique> and displays the pattern in a matter of a fraction of a
 Dominique> second.
There are several areas where matplotlib performance is subpar -
mostly for large numbers of patches (circles for scatter, rectangles
for pcolor). Fixing this is a fairly high priority and I have a good
idea how to go about it - see
http://sourceforge.net/mailarchive/message.php?msg_id=7142332 for a
recent discussion. I think in the next 3-4 weeks I can get this
fixed. Basically, the plan is to set up an additional backend method
or two that the various backends may optionally implement in extension
code for performance.
 Dominique> Sometimes, a plot using the GTK backend gets stuck in
 Dominique> gtk.mainloop(), and i have to interrupt it with
 Dominique> Ctrl-C. I am using SuSE Linux 8.0. I have installed the
 Dominique> most recent versions of GTK and PyGTK.
Are you using the default GTK that comes with SuSE or did you upgrade?
I have gotten myself into a world of pain before trying to upgraded
GTK libs on a linux box. It does look like you are getting some
unusual behavior. Make sure you are using the latest matplotlib and
try running the test script I posted above. If you still get the same
errors, something is whacked with your install or paths. Otherwise,
stay tuned for performance enhancements coming soon to theaters
everywhere.
JDH
From: John H. <jdh...@ac...> - 2004年03月01日 14:53:07
 - I have 2 Suplots on top of each other, but when I select only one
 axis on the drop-down button I get an error: 
This was a python2.2 specific bug relating to nested scopes. It's
fixed for the next release.
 - I want to systematically disable the vertical zoom/move on the
 second subplot, but not the first. How can I do that ?
Well, when the menu is working properly that is how you do it. By
"systematically", do you mean by default so it's disabled when the
plot comes up?
If so, this depends on how you are building your GUI window.
Basically you need to get your hands on the gtk.Toolbar instance,
which contains an omenu (gtk.OptionMenu) attribute (wait until the
next release, a couple of days, where I've cleaned this up a bit).
Eg, if you are using the matlab interface
 manager = get_current_fig_manager()
 items = manager.toolbar.omenuItems
 items[-1].set_active(False)
Turns off navigation for the last subplot. items[0] would turn off
navigation for the first subplot, and so on.
Here are the docs for gtk.MenuItem -
http://www.gnome.org/~james/pygtk-docs/class-gtkmenuitem.html
 - How can I activate a tooltip on top of my plots ?
You'll have to read up on gtk tooltips. Depends on what elements you
want to add tips to. Give me a little more info. DO you want to add
tips to the navigation buttons or lines on your plot or text elements
or what?
http://www.gnome.org/~james/pygtk-docs/class-gtktooltips.html
Also check out the pygtk FAQ http://www.async.com.br/faq/pygtk and
tutorial
http://www.moeraki.com/pygtktutorial/pygtk2tutorial/index.html.
 - I cannot zoom or move an plot I set the axis ticks to , ie
 ax.set_xticks([])
This is a bug - thanks for reporting it. I use the tick width as the
default interval in pan. When there are no ticks, I divided by the
number of ticks and got a division by zero error. I now check for 0
and default to 20% of the plot if there are no ticks.
 - How could I add a button to directly print out the picture in the toolbar ?
Print as in to a printer? No support for that yet and am not sure I
want to go there right now (cross platform printing would might take
lot of work). Best I can offer you currently is the savefig button.
I think gnome-print has made a fair amount of progress since I first
wrote matplotlib so if you want to be on the vanguard and explore this
option I would be happy.
 - Is there any density plot available ?
Do you mean hist?
http://matplotlib.sourceforge.net/screenshots.html#histogram_demo
http://matplotlib.sourceforge.net/matplotlib.matlab.html#-hist
 - Can I change the size taken by each of the Suplots ? 
Just use axes. Subplot derives from Axes. With axes, you can set the
size of your subplot with a rect [left, bottom, width, height]
http://matplotlib.sourceforge.net/matplotlib.matlab.html#-axes
http://matplotlib.sourceforge.net/matplotlib.axes.html
http://matplotlib.sourceforge.net/screenshots.html#axes_demo
- I have MANY small plots on my graph. Is there a cost effective way
 to filter which plots to show ?
I don't know what this means. Wouldn't you want to show all the plots
on your figure? Why else would you put them there? Please elaborate.
Cheers,
JDH
From: John H. <jdh...@ac...> - 2004年03月01日 14:26:08
>>>>> "matthew" == matthew arnison <ma...@ca...> writes:
 matthew> Specifically, what about making the default behaviour to
 matthew> clip the data at the first point which is equal or
 matthew> greater than the axis range? That should maintain the
 matthew> efficiency gains of clipping, while still keeping the
 matthew> scientific plotting behaviour that I think most users are
 matthew> accustomed to.
Hi Matthew -
That's a good idea - the data clipping feature was a gotcha for many.
For the next release, I turned data clipping off by default since I
don't think it's the typical use case and implemented the "first point
which is equal or greater" suggestion. However, I also have created a
config file, so you can set the default as you like.
JDH 
From: Kuzminski, S. R <SKu...@fa...> - 2004年03月01日 14:08:43
I upgraded to GD v2 and gdmodule v0.52 and I noticed that line widths
don't work correctly. If the line width is >1 the line comes out as
'stripes'. This is on Linux. The GD lib < 2.0 didn't have line width
support at all so maybe I've never seen GD create variable width lines
on linux? I wonder if this is a GD problem.
=20
I tried the new Agg backend, very nice. I'm all set to jettison GD
altogether and go with Agg except that the anti-aliased graphs that look
so great, print poorly.. :-( Is there a way to turn off the
anti-aliasing? It would be *great* to be able to drop that GD
dependency.
=20
thanks,
Stefan =20
From: Arnold M. <arn...@wu...> - 2004年03月01日 12:30:33
Dear all,
Praise for this first serious python plotting package!
I have two minor comments:
-> when I try to do an errorbar plot with a scalar, rather than an array 
as the argument (i.e. errorbar(scalar_x, scalar_y, xerr=scalar_xerr)) I 
get the following error message:
"/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 569, in errorbar
 right = x+xerr[1]
IndexError: index out of bounds
This is due to the fact that the length of xerr is tested only to be 1 
or greater than 1 (asymmetric errors). However, the option that I would 
like to plot just one point is not included. So an extra if-clause is 
needed before the present code that checks whether x and xerr are arrays 
or not.
-> I very much like the option for scatter to color the blobs to be 
plotted. However, I have an application where the shape of the blobs is 
immaterial: I would rather have filled circles (or even better: filled 
symbols, be it circles, triangles ...). Anyhow: I would like them to be 
symmetric irrespective of the range of the axes. One option would be to 
allow the s-keyword to be allowed to be negative, where negative means: 
symmetric and the value of the negative number being the size relative 
to some default size.
Thanks and keep up the good work,
Arnold Moene
From: Dominique O. <do...@da...> - 2004年03月01日 00:23:17
Hello,
I am having trouble viewing scatter plots of large data sets
with the GTK backend. The plots are sparsity patterns of
sparse matrices, much in the way of Matlab's spy function.
First of all, there may be a conflict somewhere with my
version of GTK/PyGTK; issuing a plot() or scatter() command
often results in the message 'None Active' being displayed.
After a couple of seconds, the python prompt comes back, and
the 'scatter' command results in a huge number of messages
of the form 
 <matplotlib.patches.Circle instance at 0x4531730c>
begin displayed; litterally hundreds of them---it takes some
10 seconds. Finally, a show() opens up a Figure window, but
no plot. The matrix has 80519 nonzero elements and is
symmetric, so the scatter plot contains roughly twice as
many points. I have a Gnuplot interface and a spy-like
function which works just fine and displays the pattern in a
matter of a fraction of a second.
Sometimes, a plot using the GTK backend gets stuck in
gtk.mainloop(), and i have to interrupt it with Ctrl-C. I am
using SuSE Linux 8.0. I have installed the most recent
versions of GTK and PyGTK.
Thanks in advance for any suggestions.
Dominique
5 messages has been excluded from this view by a project administrator.

Showing results of 148

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