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






Showing 17 results of 17

From: Eric F. <ef...@ha...> - 2005年07月07日 22:07:50
Attachments: hall1.py
Torsten,
You have found a bug, and I have not yet tracked down the cause and 
solution. In the meantime, a workaround (or superior alternative--see 
below) is to use set_data(x, y) instead of set_xdata and set_ydata. See 
the attached modification of your demo, which also shows an alternative 
way of making the mask.
> Every time when I pass a masked array to set_xdata() I get an error
> "MA.MA.MAError: Mask and data are not compatible".
> 
> See http://www-users.rwth-aachen.de/torsten.bronger/hall.py for the
> code that provokes this error. The "plot" command works: It
> produces a plot with the desired gap (realised by the masked array).
> However, the first line.set_xdata(x_values) fails, although I even
> didn't change the x_values.
set_xdata and set_ydata call set_data, so it is actually more efficient 
to call set_data in the first place. (This seems odd; one might expect 
the opposite, with set_data calling set_xdata and set_ydata.)
Eric
From: John H. <jdh...@ac...> - 2005年07月07日 20:57:43
>>>>> "Jos=E9" =3D=3D Jos=E9 Matos <ja...@fc...> writes:
 Jos=E9> Hi all, I have been following this list for some time, as
 Jos=E9> well as using and spreading the news about matplotlib for
 Jos=E9> all people I know and use python. :-)
 Jos=E9> I would like also to thank all the developers for all the
 Jos=E9> amazing work that has been done on matplotlib, it helps me a
 Jos=E9> lot in my work.
 Jos=E9> Now the reason why I am writing to this list is to ask
 Jos=E9> what is the preferred policy for packaging matplotlib as an
 Jos=E9> rpm for FC4. Yesterday was accepted in Fedora Extras and so
 Jos=E9> it should take a few days to be available.
 Jos=E9> The packager choose to package matplotlib (called
 Jos=E9> python-matplotlib) with both dateutils and pytz packaged
 Jos=E9> together while I use to package it as 3 separate packages.
Hi Jos=E9,
I have thought this over a bit more after talking with Fernando Perez,
a FC user, and wanted to add that in regards to the pytz and dateutils
packages, I think it is fine to package them separately. My main
motivation for including them in the distro was to keep the list of
dependencies small, and because these packages did not have win32
friendly installers; neither issue should concern the FC4 packagers.
I would emphasize vis-a-vis these dependencies that the packager
should make sure the following examples run:
 peds-pc311:~/python/projects/matplotlib> ls examples/*date*
 examples/date_demo1.py examples/date_demo_convert.py
 examples/date_demo2.py examples/date_demo_rrule.py
and in general that the script examples/backend_driver.py, which runs
a suite of examples over several image backends, should not generate
errors.
As I mentioned in a previous response, I hope to factor some of these
dependencies into a separate, optional matplotlib-deps package to ease
the installation burden on the users while making the setup as clean
as possible for package maintainers.
Let me know if I can offer any more help, and thanks for your work
promoting matplotlib!
JDH=20
From: Alan G I. <ai...@am...> - 2005年07月07日 20:13:19
Jeff wrote:
>> I was having some difficulty filling between two vertical 
>> lines, I don't think I can use axvline() with fill()? 
On 2005年6月23日, John Hunter apparently wrote: 
> It sounds like axvspan is what you want ... if all you 
> want is shading across the vertical extent over an xrange, 
> axvspan is the function for you,
Can this work directly with dates?
E.g., the following works but is non-intuitive:
import pylab
import datetime
d1 = datetime.date( 1995, 1, 1 )
d2 = datetime.date( 2004, 1, 1 )
delta = datetime.timedelta(days=365)
dates = pylab.drange(d1,d2,delta)
y = pylab.rand(len(dates))
pylab.axvspan(dates[2],dates[3])
pylab.plot_date(dates, y, 'r-')
pylab.show()
Thanks,
Alan Isaac
From: Chris B. <Chr...@no...> - 2005年07月07日 17:16:10
Christopher Kang wrote:
> Could someone please assist me in what I need to do or let me know of
> a different way to get matplotlib and gtk/gtkagg to work on my mac? 
> I'm running Tiger on the mac.
Do you really need GTK?
If not, you can use the installer at:
www.pythonmac.org/packages
It should work with TK, wx and Agg. I've heard someone is working on a 
Cocoa back-end which would be great, but it's not available now.
If you do need GTK, then you need to go the all-fink route: everything 
fink, including python itself, gtk, pygtk, etc.
Maybe whoever is maintaining the fink package can help out with your 
problems.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
 		
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Jeff P. <jef...@se...> - 2005年07月07日 16:44:58
Hello, I'm not sure I have the most efficient method for changing my
plot settings. I have an application I wrote with maplotlib that allows
a user to plot data and change different plot settings like color and
line width etc. Initially when the program is created I create a
default axes with no data plotted. The user then loads the data and
presses a plot button.
Once the data is plotted, each time the user changes the settings (for
example they change the line color from red to blue) I call
axes.clear(), then I call plot() again and this time I use the keywords
to change the settings to (change the line color to blue) and then I
call canvas.draw() to redraw the canvas.
axes.clear()
axes.plot(array,color=color, linestyle=pattern, linewidth=width,
marker='None')
canvas.draw()
Is this the best way to do this?
Thanks.
Jeff
From: John H. <jdh...@ac...> - 2005年07月07日 16:30:29
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> Hello, I'm using WXAgg for some simple plotting. when I
 Jeff> change any of the settings in my figure and then call
 Jeff> canvas.draw() the figure that is redrawn is not the same
 Jeff> size as the old drawing until I resize my frame. So
 Jeff> initially what I see is a new figure overlaying the old
 Jeff> figure. However when I resize the frame the figure snaps to
 Jeff> the size it should be. How can I fix this so that the figure
 Jeff> draws correctly without having to resize my frame? Thanks.
 
example, example, example, please. 
It is really not possible for us to help you without an example that
exposes the problem.
JDH
From: Jeff P. <jef...@se...> - 2005年07月07日 16:17:17
Hello, I'm using WXAgg for some simple plotting. when I change any of
the settings in my figure and then call canvas.draw() the figure that is
redrawn is not the same size as the old drawing until I resize my frame.
So initially what I see is a new figure overlaying the old figure.
However when I resize the frame the figure snaps to the size it should
be. How can I fix this so that the figure draws correctly without having
to resize my frame? Thanks.
 
 _____ 
Jeffrey Thomas Peery
SeaMetrics, Inc.
Mechanical Engineer 
Jef...@Se...
253.872.0285 (fax)
253.872.0284 (phone)
 _____ 
 
From: John H. <jdh...@ac...> - 2005年07月07日 14:35:49
>>>>> "Torsten" == Torsten Bronger <br...@ph...> writes:
 Torsten> However, the datalim seems so implicitly include zero.
 Torsten> For example, if min(y_values) is 3, I still see the point
 Torsten> of origin. How can I avoid this behaviour?
We're just doing what we're told here :-)
Your first plot call is
 y_values = total_number_values * [0.0]
 line, = plot(x_values, y_values)
So zero is *explicitly* included. The datalim remember the history of
objects have have been added. If you want them to ignore their
history, call 
ax.dataLim.update_numerix(x_values, y_values, True)
The third argument if True will cause the datalim to update it's
bounds ignoring history. If False, it will update the bounds
including it's past history.
Note that in the original example you posted
for i in range(2*cycles):
 voltages = number_of_values * [i % 2 + 3]
 y_values[i * number_of_values : (i+1) * number_of_values] = \
 voltages
 line.set_ydata(y_values)
 print min(y_values), max(y_values)
 ax.dataLim.update_numerix(x_values, y_values, True)
min(y_values) == 0
JDH
From: John H. <jdh...@ac...> - 2005年07月07日 14:25:45
>>>>> "Brice" == Brice Thurin <B.P...@ci...> writes:
 Brice> Thank you for your help, I tried to do as you said and I
 Brice> got the following messages and then python quit: (I haven't
 Brice> planned to use PyGTK as I want to use WX.) Many Thanks
 Brice> Brice
You have to set which GUI you want to use with the backend parameter
in the matplotlibrc configuration file. Typically, people put a copy
of this in their HOME dir. If you want to use WX, I suggest setting
backend : WXAgg
in your rc file.
You can obtain a default copy of the rc file at
http://matplotlib.sf.net/.matplotlibrc or in the matplotlib src
distribution.
JDH
From: John H. <jdh...@ac...> - 2005年07月07日 14:07:32
>>>>> "David" =3D=3D David Abreu Rodriguez <dav...@ia...> writes:
 David> Hello, I am new in the list and new using matplotlib.
 David> I am using matplotlib version 0.74
 David> I want to write (in the title of a plot, for example) non
 David> ascii characters like =E1 or =E9, but I can't. Other problem
 David> is writting mathtex expresions with normal text: I can't
 David> put 'title(r"test $\lambda$")' because I don't see the TeX
 David> character. I can write TeX characters only if I want to see
 David> the symbols.
matplotlib-0.74 introduced unicode support in the *Agg and PS backends
-- see examples/unicode_demo.py
Strings with "embedded mathtext" like (r"test $\lambda$") are
currently not supported but this is listed on the goals page -
http://matplotlib.sourceforge.net/goals.html. You have to use
something like r"$\rm{test}\ \lambda$" currently. This is discussed
in the mathtext class documentation at http://matplotlib.sourceforge.net/=
matplotlib.mathtext.html
matplotlib0.81 introduced mathtext support using TeX proper, see
http://matplotlib.sourceforge.net/screenshots.html#tex_demo and
http://matplotlib.sourceforge.net/matplotlib.texmanager.html
Hope this helps!
JDH
From: Werner F. B. <wer...@fr...> - 2005年07月07日 13:54:52
Hi David,
David Abreu Rodriguez wrote:
> Hello,
> 
> I am new in the list and new using matplotlib.
> 
> I am using matplotlib version 0.74
You might want to go with 0.82.
> 
> I want to write (in the title of a plot, for example) non ascii 
> characters like á or é, but I can't.
There were some problems when using e.g. date ticks (déc etc.), IRC they 
were fixed in 0.80.
For title and legend stuff I use decode along these lines:
title = self.selClientData[1].decode('iso-8859-1')
Hope this helps
Werner
> Other problem is writting mathtex expresions with normal text: I can't 
> put 'title(r"test $\lambda$")' because I don't see the TeX character. I 
> can write TeX characters only if I want to see the symbols.
> 
> thanks
> 
> 
> 
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_idt77&alloc_id492&op=click
> 
From: John H. <jdh...@ac...> - 2005年07月07日 13:52:22
>>>>> "Jeff" == Jeff Peery <jef...@se...> writes:
 Jeff> I added the .matplotlibrc file and that definitely
 Jeff> helps. Thanks. Regarding the symbols, I changed your file
 Jeff> to the match mine and I get symbols. Here's the change I
 Jeff> made:
 ...snip...
 Jeff> what is the difference here? Thank you very much for your
 Jeff> help.
If you are not passing a format string (eg 'r-') you need to
explicitly set the marker symbol. For no marker at all, use the
string 'None'
 pylab.plot_date(dates, y, color ='r', marker='None', 
 linestyle ='--',
 linewidth = 1)
Using the string 'None' instead of the symbol None is a bit of a wart,
because None is currently interpreted to mean "use the rc default".
JDH
From: David A. R. <dav...@ia...> - 2005年07月07日 12:15:09
Hello,
I am new in the list and new using matplotlib.
I am using matplotlib version 0.74
I want to write (in the title of a plot, for example) non ascii=20
characters like =E1 or =E9, but I can't.
Other problem is writting mathtex expresions with normal text: I can't=20
put 'title(r"test $\lambda$")' because I don't see the TeX character. I=20
can write TeX characters only if I want to see the symbols.
thanks
From: Christopher K. <chr...@gm...> - 2005年07月07日 12:04:18
Hello everyone and always, thank you for your tremendous help. I was
just wondering, I need to get matplotlib to work on a mac but
unfortunately I've been running into some problems trying to get it to
work on a mac. I tried by installing the unstable version from source
using fink and that has some parts of matplotlib working fine, but I
can't seem to import pylab. Specifically, when matplotlib tries to
import pylab (from pylab import *), it eventually gets to
""from matplotlib._nc_backend_gdk import pixbuf_get_pixels_array"
ImportError: No module named _nc_backend_gdk.". It seems like i don't
have a _nc_backend_gdk.so file that I need.
Could someone please assist me in what I need to do or let me know of
a different way to get matplotlib and gtk/gtkagg to work on my mac?=20
I'm running Tiger on the mac.
Thank you very much,
Chris
From: Brice T. <B.P...@ci...> - 2005年07月07日 11:50:02
Thank you for your help, I tried to do as you said and I got the 
following messages and then python quit: (I haven't planned to use 
PyGTK as I want to use WX.)
Many Thanks
Brice
import pylab
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py:456: UserWarning: Could not open 
font file /Library/Fonts/NISC18030.ttf
 warnings.warn("Could not open font file %s"%fpath)
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py:456: UserWarning: Could not open 
font file /Library/Fonts/fonts.cache-1
 warnings.warn("Could not open font file %s"%fpath)
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py:456: UserWarning: Could not open 
font file /System/Library/Fonts/LastResort.dfont
 warnings.warn("Could not open font file %s"%fpath)
/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site- 
packages/matplotlib/font_manager.py:456: UserWarning: Could not open 
font file /System/Library/Fonts/Keyboard.dfont
 warnings.warn("Could not open font file %s"%fpath)
No module named pygtk
PyGTK version 1.99.16 or greater is required to run the GTK Matplotlib 
backends
On 6 Jul 2005, at 15:51, John Hunter wrote:
>>>>>> "Brice" == Brice Thurin <B.P...@ci...> writes:
> Brice> packages/matplotlib/font_manager.py", line 458, in
> Brice> createFontDict prop = ttfFontProperty(font) File
> Brice> 
> "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-
> Brice> packages/matplotlib/font_manager.py", line 271, in
> Brice> ttfFontProperty sfnt = font.get_sfnt() RuntimeError: No
> Brice> SFNT name table
>
>
> Try editing matplotlib/font_manager.py on line 458 and replacing
>
>
> prop = ttfFontProperty(font)
>
> with
>
> try: prop = ttfFontProperty(font)
> except: continue
>
> Let me know if this helps...
>
> JDH
>
>
Brice Thurin
Department of Optometry and Visual Science
City University, Northampton Square
London, EC1V 0HB, UK.
http://www.city.ac.uk/optometry/Luis/myresearch/Research/ 
scatteringproper.html
http://www.sharpeye.org/
Tel: +44 (0)20 7040 4157
Fax: +44(0)20 7040 8355
e-mail: B.P...@ci...
From: Torsten B. <br...@ph...> - 2005年07月07日 10:20:17
Hallöchen!
John Hunter <jdh...@ac...> writes:
> [...]
>
>
> OK, that helps. The update of the data limits happens when you call
> plot and friends (technically plot calls ax.add_line which calls
> ax.update_datalim_numerix) . If you manually set the xdata or ydata
> on the line object, you need to manually update the Axes datalim with
>
> ax = gca()
> for i in range(2*cycles):
> voltages = number_of_values * [i % 2 + 3]
> y_values[i * number_of_values : (i+1) * number_of_values] = \
> voltages
> line.set_ydata(y_values)
> ax.update_datalim_numerix(x_values, y_values)
> ax.autoscale_view()
>
> draw()
> time.sleep(1)
However, the datalim seems so implicitly include zero. For example,
if min(y_values) is 3, I still see the point of origin. How can I
avoid this behaviour?
Tschö,
Torsten.
-- 
Torsten Bronger, aquisgrana, europa vetus
From: Torsten B. <br...@ph...> - 2005年07月07日 08:13:58
Hallöchen!
Eric Firing <ef...@ha...> writes:
> [...]
>
> This looks to me like a place where you should try using masked arrays 
> instead of NaN.
Every time when I pass a masked array to set_xdata() I get an error
"MA.MA.MAError: Mask and data are not compatible".
See http://www-users.rwth-aachen.de/torsten.bronger/hall.py for the
code that provokes this error. The "plot" command works: It
produces a plot with the desired gap (realised by the masked array).
However, the first line.set_xdata(x_values) fails, although I even
didn't change the x_values.
Tschö,
Torsten.
-- 
Torsten Bronger, aquisgrana, europa vetus

Showing 17 results of 17

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