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
(16)
3
(9)
4
(12)
5
(14)
6
(22)
7
(17)
8
(33)
9
(26)
10
(32)
11
(47)
12
(26)
13
(7)
14
(24)
15
(44)
16
(42)
17
(22)
18
(31)
19
(8)
20
(4)
21
(15)
22
(27)
23
(41)
24
(33)
25
(31)
26
(24)
27
(10)
28
(20)






Showing results of 620

<< < 1 .. 18 19 20 21 22 .. 25 > >> (Page 20 of 25)
From: Nick S. <N.S...@du...> - 2010年02月09日 16:39:10
HI all,
I've been using matplotlip for a while now but mainly for line plots,
scatter plots and the odd dendrogram. I recently tried plotting a
histogram (of a binomial function) and encountered a problem. So I
though I'd try the extremely simple example set on the front of the
matplotlib page.... and heres what I got:
Python 2.4.3 (#1, Sep 3 2009, 15:37:12)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylab import randn, hist
>>> x = randn(10000)
>>> hist(x, 100)
Traceback (most recent call last):
 File "<stdin>", line 1, in ?
 File "/usr/lib/python2.4/site-packages/matplotlib/pyplot.py", line
1633, in hist
 ret = gca().hist(*args, **kwargs)
 File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 5060, in hist
 align=align, log=log)
 File "/usr/lib/python2.4/site-packages/matplotlib/axes.py", line 3253, in bar
 assert len(height)==nbars, "argument 'height' must be %d or scalar" % nbars
AssertionError: argument 'height' must be 101 or scalar
Any idea why this isn't working? I have matplotlib v0.91.2 - will
updating to 0.99 solve the problem?
-- 
Cheers,
Nick Schurch
From: Ben A. <BAx...@co...> - 2010年02月09日 16:20:32
Maybe instead of plot.show() you should do something like:
plot.draw()
raw_input('Press ENTER to exit')
Personally, I also use IDLE on Windows XP to edit my matplotlib files. However, I never execute in IDLE. I simply double click the file in windows explorer.
-Ben
-----Original Message-----
From: Wayne Watson [mailto:sie...@sb...] 
Sent: Tuesday, February 09, 2010 11:07 AM
To: mat...@li...
Subject: [Matplotlib-users] Verifying the Use of show()? Win XP
I'm sure not making much progress on understanding show(). When used in XP in IDLE or by file execution (click on file name), it seems to tie up the executing program. In IDLE, the shell window stops and one must exit the window.
I'd appreciate it if someone could take any examples from <http://matplotlib.sourceforge.net/index.html> and try to execute them as in the first paragraph to see if they terminate successfully.Let me know what OS used, hopefully XP, and if you used IDLE or file execution. 
I suspect you will find every example there ends with show(). Try putting a print statement after show() you've done it with the show() the last line.
--
"Crime is way down. War is declining. And that's far from the good news." -- Steven Pinker (and other sources) Why is this true, but yet the media says otherwise? The media knows very well how to manipulate us (see limbic, emotion, $$). -- WTW
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Ben A. <BAx...@co...> - 2010年02月09日 16:19:45
I see. But why would I need to set the figure manually when I am drawing with a figure? Is it ever the case where you set one figure, but draw with another? For example:
textartist.set_figure(fig1)
fig2.draw_artist(textartist)
Also, other atists don't fail in this manner if I don't use artist.set_figure().
-Ben
-----Original Message-----
From: Jae-Joon Lee [mailto:lee...@gm...] 
Sent: Monday, February 08, 2010 6:36 PM
To: Ben Axelrod
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Figure.draw_artist() bug with Text
This is not a bug.
The exception is raised simply because "textartist.figure" is None (and it is None because you never set it).
"textartist" you created is not properly set up (no figure, no axes, no transform). You may do
textartist = Text(0.5, 0.5, "Foo")
textartist.set_figure(fig)
fig.draw_artist(textartist)
fig.canvas.blit(fig.bbox)
But, this is not the recommended way of doing things.
draw_artist is mainly for doing animation.
http://matplotlib.sourceforge.net/examples/animation/index.html
Regards,
-JJ
On Mon, Feb 8, 2010 at 4:24 PM, Ben Axelrod <BAx...@co...> wrote:
> I am getting a fault when I try to use Figure.draw_artist() with a matplotlib.text.Text object. Since matplotlib.text.Text inherits from matplotlib.artist.Artist, which is what draw_artist() takes, this should probably work.
>
> Tested with latest SVN code on Linux.
>
> Here is the traceback:
>
> Traceback (most recent call last):
> File "test.py", line 10, in <module>
>  fig.draw_artist(textartist)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/figure.py", 
> line 816, in draw_artist
>  a.draw(self._cachedRenderer)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/artist.py", 
> line 55, in draw_wrapper
>  draw(artist, renderer, *kl)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", 
> line 549, in draw
>  bbox, info = self._get_layout(renderer)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", 
> line 267, in _get_layout
>  key = self.get_prop_tup()
> File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", 
> line 716, in get_prop_tup
>  self.figure.dpi, id(self._renderer),
> AttributeError: 'NoneType' object has no attribute 'dpi'
>
> And here is some simple code to trigger the bug:
>
> #!/usr/bin/env python
> # display bug in figure.draw_artist(matplotlib.text)
> import matplotlib.pyplot as plt
> from matplotlib.text import Text
>
> fig = plt.figure()
> plt.draw()
>
> textartist = Text(0.5, 0.5, "Foo")
> fig.draw_artist(textartist)
>
> plt.show()
> #end code
>
> Note that I still get the bug even when i specify figsize and dpi on the figure like so:
> fig = plt.figure(figsize=(2,2), dpi=300)
>
> -Ben
> ----------------------------------------------------------------------
> -------- The Planet: dedicated and managed hosting, cloud storage, 
> colocation Stay online with enterprise data centers and the best 
> network in the business Choose flexible plans and management services 
> without long-term contracts Personal 24x7 support from experience 
> hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: John H. <jd...@gm...> - 2010年02月09日 16:19:44
On Tue, Feb 9, 2010 at 10:06 AM, Wayne Watson
<sie...@sb...> wrote:
> I'm sure not making much progress on understanding show(). When used in
> XP in IDLE or by file execution (click on file name), it seems to tie up
> the executing program. In IDLE, the shell window stops and one must
> exit the window.
>
> I'd appreciate it if someone could take any examples from
> <http://matplotlib.sourceforge.net/index.html> and try to execute them
> as in the first paragraph to see if they terminate successfully.Let me
> know what OS used, hopefully XP, and if you used IDLE or file execution.
> I suspect you will find every example there ends with show(). Try
> putting a print statement after show() you've done it with the show()
> the last line.
"show" is meant to start the GUI mainloop, which is usually blocking,
and raise all windows, so the behavior you are reporting is the
intended behavior. When working interactively, as in Idle, you
shouldn't need to use show if you turn interactive mode on.
 http://matplotlib.sourceforge.net/users/shell.html
We recommend using ipython in pylab model when working interactively
because it is designed to make the correct interactive settings and
override "show" to be non-blocking. You can obtain the right results
in matplotlib using Idle if you are careful, but for "just works out
of the box" ipython in pylab mode will be easier.
JDH
From: Wayne W. <sie...@sb...> - 2010年02月09日 16:19:41
Version of Python would help too. I'm using 2.5.
On 2/9/2010 8:06 AM, Wayne Watson wrote:
> I'm sure not making much progress on understanding show(). When used in
> XP in IDLE or by file execution (click on file name), it seems to tie up
> the executing program. In IDLE, the shell window stops and one must
> exit the window.
>
> I'd appreciate it if someone could take any examples from
> <http://matplotlib.sourceforge.net/index.html> and try to execute them
> as in the first paragraph to see if they terminate successfully.Let me
> know what OS used, hopefully XP, and if you used IDLE or file execution.
> I suspect you will find every example there ends with show(). Try
> putting a print statement after show() you've done it with the show()
> the last line.
> 
-- 
"Crime is way down. War is declining. And that's far from the good 
news." -- Steven Pinker (and other sources) Why is this true, but yet 
the media says otherwise? The media knows very well how to manipulate us 
(see limbic, emotion, $$). -- WTW
From: Wayne W. <sie...@sb...> - 2010年02月09日 16:06:54
I'm sure not making much progress on understanding show(). When used in 
XP in IDLE or by file execution (click on file name), it seems to tie up 
the executing program. In IDLE, the shell window stops and one must 
exit the window.
I'd appreciate it if someone could take any examples from 
<http://matplotlib.sourceforge.net/index.html> and try to execute them 
as in the first paragraph to see if they terminate successfully.Let me 
know what OS used, hopefully XP, and if you used IDLE or file execution. 
I suspect you will find every example there ends with show(). Try 
putting a print statement after show() you've done it with the show() 
the last line.
-- 
"Crime is way down. War is declining. And that's far from the good 
news." -- Steven Pinker (and other sources) Why is this true, but yet 
the media says otherwise? The media knows very well how to manipulate us 
(see limbic, emotion, $$). -- WTW
From: Jae-Joon L. <lee...@gm...> - 2010年02月09日 15:42:37
I cannot reproduce it with Agg backend and ps backend. I tried both
svn version and 0.99 maint. version.
So, maybe this is a bug in mac os X backend?
Do you see a same problem with the ps output? If so, can you post your
ouput ps file?
Regards,
-JJ
On Mon, Feb 8, 2010 at 3:26 PM, Tomasz Koziara
<t.k...@ci...> wrote:
> Dear Users/Developers
>
> I just installed version 0.99.1.1 since in my previous version (0.98) I had
> problems with hatching. It seems though that the same problems persist in
> the current version. The attached files reproduce the problem (a data file
> and a python short script). Note that hatching is not present on all green
> 'CONUPD' fields - but only on few of them.
>
> I will appreciate some hints on how to get by,
> Regards
> Tomek
>
> ===================
>
>
>
>
>
>
> ===================
>
> dh178-192:tkp5 tomek$ python plots.py --verbose-helpful
> $HOME=/Users/tomek
> CONFIGDIR=/Users/tomek/.matplotlib
> matplotlib data path /Library/Python/2.5/site-packages/matplotlib/mpl-data
> loaded rc file
> /Library/Python/2.5/site-packages/matplotlib/mpl-data/matplotlibrc
> matplotlib version 0.99.1.1
> verbose.level helpful
> interactive is False
> units is False
> platform is darwin
> Using fontManager instance from /Users/tomek/.matplotlib/fontList.cache
> backend MacOSX version unknown
> findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=medium
> to Bitstream Vera Sans
> (/Library/Python/2.5/site-packages/matplotlib-0.98.6svn-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> with score of 0.000000
> findfont: Matching
> :family=sans-serif:style=normal:variant=normal:weight=normal:stretch=normal:size=large
> to Bitstream Vera Sans
> (/Library/Python/2.5/site-packages/matplotlib-0.98.6svn-py2.5-macosx-10.3-fat.egg/matplotlib/mpl-data/fonts/ttf/Vera.ttf)
> with score of 0.000000
>
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Stephan M. <zw...@we...> - 2010年02月09日 15:20:54
I already had my destroy() method look like this:
 def destroy(self):
 self.f.clf()
 Tix.Frame.destroy(self)
 self.toolbar.destroy()
 self.canvas._tkcanvas.destroy()
But it makes no difference.
Stephan
Am 08.02.2010 17:15, schrieb Michael Droettboom:
> Have you tried explicitly calling .clf() on the matplotlib Figure object from your Tix.Frame.destroy callback?
>
> Mike
>
> 
From: Jae-Joon L. <lee...@gm...> - 2010年02月08日 23:36:18
This is not a bug.
The exception is raised simply because "textartist.figure" is None
(and it is None because you never set it).
"textartist" you created is not properly set up (no figure, no axes,
no transform). You may do
textartist = Text(0.5, 0.5, "Foo")
textartist.set_figure(fig)
fig.draw_artist(textartist)
fig.canvas.blit(fig.bbox)
But, this is not the recommended way of doing things.
draw_artist is mainly for doing animation.
http://matplotlib.sourceforge.net/examples/animation/index.html
Regards,
-JJ
On Mon, Feb 8, 2010 at 4:24 PM, Ben Axelrod <BAx...@co...> wrote:
> I am getting a fault when I try to use Figure.draw_artist() with a matplotlib.text.Text object. Since matplotlib.text.Text inherits from matplotlib.artist.Artist, which is what draw_artist() takes, this should probably work.
>
> Tested with latest SVN code on Linux.
>
> Here is the traceback:
>
> Traceback (most recent call last):
> File "test.py", line 10, in <module>
>  fig.draw_artist(textartist)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/figure.py", line 816, in draw_artist
>  a.draw(self._cachedRenderer)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
>  draw(artist, renderer, *kl)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 549, in draw
>  bbox, info = self._get_layout(renderer)
> File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 267, in _get_layout
>  key = self.get_prop_tup()
> File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 716, in get_prop_tup
>  self.figure.dpi, id(self._renderer),
> AttributeError: 'NoneType' object has no attribute 'dpi'
>
> And here is some simple code to trigger the bug:
>
> #!/usr/bin/env python
> # display bug in figure.draw_artist(matplotlib.text)
> import matplotlib.pyplot as plt
> from matplotlib.text import Text
>
> fig = plt.figure()
> plt.draw()
>
> textartist = Text(0.5, 0.5, "Foo")
> fig.draw_artist(textartist)
>
> plt.show()
> #end code
>
> Note that I still get the bug even when i specify figsize and dpi on the figure like so:
> fig = plt.figure(figsize=(2,2), dpi=300)
>
> -Ben
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: <PH...@Ge...> - 2010年02月08日 21:41:56
Ted,
How does this example run for you?
http://matplotlib.sourceforge.net/examples/pylab_examples/griddata_demo.html
From: Ted Kord [mailto:ted...@go...]
Sent: Monday, February 08, 2010 12:00 PM
To: Paul Hobson
Cc: mat...@li...
Subject: Re: [Matplotlib-users] Surface Plot
On 8 February 2010 17:37, <PH...@ge...<mailto:PH...@ge...>> wrote:
Hey Ted,
I don't quite understand how you're getting the Z data below. But if you have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for you.
http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata
HTH,
-paul
Hi Paul
Is there a way to colour the output? For some reason, the final output is in a single colour even though I've specified cm.jet for the colour map.
Regards
Ted
From: Ben A. <BAx...@co...> - 2010年02月08日 21:24:55
I am getting a fault when I try to use Figure.draw_artist() with a matplotlib.text.Text object. Since matplotlib.text.Text inherits from matplotlib.artist.Artist, which is what draw_artist() takes, this should probably work.
Tested with latest SVN code on Linux.
Here is the traceback:
Traceback (most recent call last):
 File "test.py", line 10, in <module>
 fig.draw_artist(textartist)
 File "/usr/local/lib/python2.6/site-packages/matplotlib/figure.py", line 816, in draw_artist
 a.draw(self._cachedRenderer)
 File "/usr/local/lib/python2.6/site-packages/matplotlib/artist.py", line 55, in draw_wrapper
 draw(artist, renderer, *kl)
 File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 549, in draw
 bbox, info = self._get_layout(renderer)
 File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 267, in _get_layout
 key = self.get_prop_tup()
 File "/usr/local/lib/python2.6/site-packages/matplotlib/text.py", line 716, in get_prop_tup
 self.figure.dpi, id(self._renderer),
AttributeError: 'NoneType' object has no attribute 'dpi'
And here is some simple code to trigger the bug:
#!/usr/bin/env python
# display bug in figure.draw_artist(matplotlib.text)
import matplotlib.pyplot as plt
from matplotlib.text import Text
fig = plt.figure()
plt.draw()
textartist = Text(0.5, 0.5, "Foo")
fig.draw_artist(textartist)
plt.show()
#end code
Note that I still get the bug even when i specify figsize and dpi on the figure like so:
fig = plt.figure(figsize=(2,2), dpi=300)
-Ben
From: Tomasz K. <t.k...@ci...> - 2010年02月08日 20:50:39
Dear Users/Developers
I just installed version 0.99.1.1 since in my previous version (0.98) 
I had problems with hatching. It seems though that the same problems 
persist in the current version. The attached files reproduce the 
problem (a data file and a python short script). Note that hatching is 
not present on all green 'CONUPD' fields - but only on few of them.
I will appreciate some hints on how to get by,
Regards
Tomek
===================
From: Christopher B. <Chr...@no...> - 2010年02月08日 20:49:22
Adolfo Aguirre wrote:
> He ́s answer was that Zope awas not an straightforward stable 
> environment but a work-in-progress,
Zope has been around a long time, it' s fine environment, particularly 
when used as the core of Plone. Zope does have its own way of doing 
things that are not to everyone's taste. If your admin folks don't like 
it, there are MANY other ways to build a web app with Python.
MPL should work with any Python web application framework that allows 
arbitrary python packages, which is probably every one.
I'd take a look at Django, Pylons and Turbogears, at least.
 > and that he did not find a single
> straight way to put matyplotlib online.
He was not looking very hard.
On the other had, if you have a well established set of web services 
built on PHP, they may not want to build something new, but I'll bet you 
could still use MPL to do your plotting by calling Python as a separate 
process. You could even get fancy and build a web service that does the 
plotting, and have your web apps call that (Pylons would be good for 
that, it's very flexible)
> in case we are missing something.
I think you are -- MPL is a fine choice for putting plots on the web. 
PHPlot may be also -- I know nothing of it.
HTH,
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: <Dav...@se...> - 2010年02月08日 20:29:32
Hey folks,
my problem may be obvious, but i can't seem to copy a plot from one canvas
to another.
# I have this object where whichCanvas is an instance of MplWidget (code
shown below)
 self.whichCanvas.canvas.ax.plot(xData, yData, 'bo', linewidth=1.5,
linestyle='-')
# I want to copy the plot and axes to another MplWidget object
 self.anotherCanvas.canvas
I've tried:
self.anotherCanvas.canvas.ax = self.whichCanvas.canvas.ax
self.anotherCanvas.canvas.draw()
and
self.anotherCanvas.canvas = self.whichCanvas.canvas
self.anotherCanvas.canvas.draw()
the plot doesn't seem to copy. Does any body more familiar with matplotlib
have any suggestions?
This is the MplWidget Class
***************************** MplWidget *******************************
from PyQt4 import QtGui
from matplotlib.backends.backend_qt4agg \
 import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
class MplCanvas(FigureCanvas):
 def __init__(self):
 self.fig = Figure()
 self.ax = self.fig.add_subplot(111)
 FigureCanvas.__init__(self, self.fig)
 FigureCanvas.setSizePolicy(self,
 QtGui.QSizePolicy.Expanding,
 QtGui.QSizePolicy.Expanding)
 FigureCanvas.updateGeometry(self)
class MplWidget(QtGui.QWidget):
 def __init__(self, parent = None):
 QtGui.QWidget.__init__(self, parent)
 self.canvas = MplCanvas()
 self.vbl = QtGui.QVBoxLayout()
 self.vbl.addWidget(self.canvas)
 self.setLayout(self.vbl)
Regards,
Dave Tung
cell: 925-321-6657
office: 510-353-4770
dav...@se...
From: Ted K. <ted...@go...> - 2010年02月08日 20:00:14
On 8 February 2010 17:37, <PH...@ge...> wrote:
> Hey Ted,
>
> I don't quite understand how you're getting the Z data below. But if you
> have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for
> you.
>
> http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata
>
> HTH,
> -paul
>
>
Hi Paul
Is there a way to colour the output? For some reason, the final output is in
a single colour even though I've specified cm.jet for the colour map.
Regards
Ted
From: C M <cmp...@gm...> - 2010年02月08日 19:49:58
I'd like to set the ticks on the y axis such that they do not display
anything lower than 0, even if part of the graph below 0 is visible.
I tried to do this with
ylocator = AutoLocator()
ylocator.view_limits(0, 100)
self.subplot.yaxis.set_major_locator(ylocator)
but it is not changing anything. How can I do this?
Thank you,
Che
From: Art <gre...@gm...> - 2010年02月08日 19:06:23
On Mac OS X 10.6.2, with Sage 4.3.1, I have installed matplotlib-0.99.1 with
gui backend (to do this, I set SAGE_MATPLOTLIB_GUI=True before using sage's
spkg installer, which performs some patches on matplotlib that ).
When I use the OS X backend and do:
import matplotlib.pyplot as plt
plt.figure()
plt.plot([1,2,3,4])
I get a plot that has as evenly spaced x-labels [0.,0.,1.,1.,2.,2.,3.] and
y-labels [1.,1.,2.,2.,3.,3.,4.].
If I try,
plt.plot([10, 20, 30, 40])
I get y-labels [1,1,2,2,3,3,4]. It seems there is an issue with rendering
the last digit for the labels.
If I use the TkAgg backend, the axes are labeled correctly.
However, on the same machine, with EPD 6.0 installed and Mac OX backend, the
labels are correct.
Any tips, even temorary workaround would be appreciated. I primarily use
sage, but in the default build, it doesn't include a gui backend. Wanted to
check here before I ask the sage users list.
Art.
From: Sean A. <les...@gm...> - 2010年02月08日 18:41:57
Greetings Adolfo,
On Mon, Feb 8, 2010 at 12:18 PM, Adolfo Aguirre
<agu...@gm...> wrote:
> Hi:
>
> I do environmental research that requires almost real time online graphing
> for data originating in the field.
Can you be a little more specific regarding 'almost real time?' I
update data from a remote meteorological research sites. Data streams
to the computer every minute and is dumped to plain ascii files. I
use pyinotify to watch for the new files to arrive, then execute my
analysis/plotting routines which produce plots; The plots are then
pushed to our webserver.
Sean
> I am a fan of Phyton thus I commissioned
> a systems administrator to figure out how to put Matplotlib online. He ́s
> answer was that Zope awas not an straightforward stable environment but a
> work-in-progress, and that he did not find a single straight way to put
> matyplotlib online. He suggested PHPlot.
>
> I like the plotting I do with Mathplotlib on my computer thus I wanted to
> ask matplotlib users about it, in case we are missing something.
>
> Appreciating your help,
>
> Adolfo
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the
> business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: James C. <clo...@jh...> - 2010年02月08日 18:25:56
>>>>> "M" == Michael Droettboom <md...@st...> writes:
M> Matplotlib will output Type 42 fonts if the rcParam "ps.fonttype"
M> is set to 42.
I read the reply which stated that after sending mine....
Sorry for the noise.
-JimC
-- 
James Cloos <cl...@jh...> OpenPGP: 1024D/ED7DAEA6
From: Ted K. <ted...@go...> - 2010年02月08日 18:21:15
Hi Paul
This helped immensely. Thanks.
Ted
From: Adolfo A. <agu...@gm...> - 2010年02月08日 18:18:50
Hi:
I do environmental research that requires almost real time online graphing
for data originating in the field. I am a fan of Phyton thus I commissioned
a systems administrator to figure out how to put Matplotlib online. He ́s
answer was that Zope awas not an straightforward stable environment but a
work-in-progress, and that he did not find a single straight way to put
matyplotlib online. He suggested PHPlot.
I like the plotting I do with Mathplotlib on my computer thus I wanted to
ask matplotlib users about it, in case we are missing something.
Appreciating your help,
Adolfo
From: <PH...@Ge...> - 2010年02月08日 17:37:21
Hey Ted,
I don't quite understand how you're getting the Z data below. But if you have 3D data in X, Y, and Z 1D-arrays, the griddata function should work for you. 
http://matplotlib.sourceforge.net/api/mlab_api.html#matplotlib.mlab.griddata
HTH, 
-paul
-------------------------------------
From: Ted Kord [mailto:ted...@go...] 
Sent: Saturday, February 06, 2010 1:05 PM
To: mat...@li...
Subject: [Matplotlib-users] Surface Plot
Hi
I'd like to generate a surface plot using mplot3d. However, Z is not a function of X and/or Y. It's just a set of scalar values. So, the following doesn't work:
X = np.arange(2, 102, 2)
Y = np.arange(0, 15.15, 0.15)
X, Y = np.meshgrid(X, Y)
Z = f[2]
ax.plot_surface(X, Y, Z, rstride=1, cstride=1, cmap=cm.jet) 
Is there a way that I can do this?
Thank you.
Ted
From: Wayne W. <sie...@sb...> - 2010年02月08日 16:55:08
Thanks. That could be a very useful observation. I'm doing most of this 
on a win7 machine. When I installed MPL, I had two small dialogs appear 
that said something was missing, but I pressed on. MPL seemed to 
generally work except for the show() problem. I'm in the process of 
bringing programs from my XP to the win7 machine, and on the XP machine 
I decided to start using MPL with a 900 line Py program that I'm 
revising. I had gotten stuck with the very same problem there. However, 
last night I realized someone had added a MPL plot to it years ago, and 
it does not fail on show().
I noticed the msgs mentioned, and though I mad made a mistake in not 
installing numpy first, so tried to figure out a way to do it. Three 
posts on different forums did not provide an answer. I accidentally 
founnd the author of MPL's hidden away in one of MPL files. He said it 
didn't make a difference and asked me not to use his address. I though 
the warning msgs might be of interest to him, so wrote to him. He had 
blocked me. Perhaps I need to file a bug report to get his attention on 
that.
Anyway, I'm now stalled on the development of the big program. It's 
possible this is an IDLE problem, but I ran the big program with a click 
on the file, and the black window showed the same problem. It did show 
some other warnings, which I think I'll capture with Snagit. This is all 
on XP Pro.
I'm going to copy the two code segments here. Maybe you can see a 
difference. I'll also attach the capture of the window too. Two jpg 
files are attached for the same code below, and one for the error 
messages from the console XP.
=================OLD working code============
 def light_curve( self ):
 result = []
 test = 1
 for tup in self.subimages:
 left,top,subimage = tup
 total = 0
 avg_total = 0
 if (test == 1):
 box = (left, top, left+128, top+128)
 region = self.reference_image.crop(box)
 self.reference_image.paste(subimage, box)
 test = 2
 else:
 for x in range(left+43,left+82):
 for y in range(top+43, top+82):
 avg_total = avg_total + 
self.reference_image.getpixel((x, y))
 for x in range(43,82): #take the center 40 X 40 pixel block
 for y in range(43,82):
 v = subimage.getpixel((x, y))
 total = total + v
 #for x in range(left, left+127):
 # for y in range(top, top+127):
 # avg_total = avg_total + 
self.reference_image.getpixel((x, y))
 #for x in range(0, 127):
 # for y in range(0, 127):
 # total = total + subimage.getpixel((x, y))
 result.append(total - avg_total) #(average - background 
average) gives pixel intensity above the background)
 plotting_x = range(2, len(result)+2)
 plot(plotting_x, result)
 xlabel('Frame #')
 ylabel('Pixel count above background count')
 title('Light curve for selected subplot')
 show()
===========New Code with show problem
 def get_point_trail_stats(self): # Simple track statistics
 xy = array(self.xya)[:,0:2] # creates a two column array for x,y
 pt2pt_dist = []
 pt_dist = []
 for k in arange(0,len(xy)-1):
 distance = sqrt((xy[k+1,0]-xy[k,0])**2 + 
(xy[k+1,1]-xy[k,1])**2)
 pt_dist.append(distance)
 # wtw print "k ",k, (xy[k,0], xy[k,1]), " distance: ", distance
 # wtwfor k in arange(0, len(xy)-50):
 # wtw print "k: %3i dist: %6.2f (x,y) (%4.1f,%4.1f)" % (k, 
pt_dist[k], xy[k,0], xy[k,1])
 per_tile25 = stats.scoreatpercentile(pt_dist,25.0)
 per_tile50 = stats.scoreatpercentile(pt_dist,50.0)
 per_tile75 = stats.scoreatpercentile(pt_dist,75.0)
 mean = stats.mean(pt_dist)
 std = stats.std(pt_dist)
 #sys.exit()
 amin = min(pt_dist)
 amax = max(pt_dist)
 print " mean: %7.2f std: %7.2f min: %7.2f max: %7.2f" % 
(mean, std, amin, amax)
 print " quartiles (25-per: %7.2f, 50-per: %7.2f, 75-per: 
%7.2f): " % (per_tile25, per_tile50, per_tile75)
 #print " Extended stats"
 #print " min: %7.2f max: %7.2f mean: %7.2f std: %7.2f" % \
 # (min, max, mean, std)
 #print " p25: %7.2f p50: %7.2f p75: %7.2f" % (per_tile25, 
per_tile50, per_tile75)
 trk_stats = (amin, amax, mean, std, per_tile25, per_tile50, 
per_tile75)
 fig = figure()
 ax1 = fig.add_subplot(111)
 v = (0, 640, 0, 480)
 print "shapes: ", xy[:,0].shape, xy[:,1].shape
 fig.close()
 ax1.plot(xy[:,0], xy[:,1]) #,100*s, c , picker=True)
 ax1.axis(v)
 #x = (0,1,3,20,20);y=(5,7, 9, 22,90)
 #col = ax1.plot(x,y)
 show()
 print "something for wtw plot"
 print
 return trk_stats
On 2/7/2010 10:53 PM, Philipp Bender wrote:
> I'm pretty sure your problem is not generally related to matplotlib, all the
> examples you mentioned and the one you sent me by e-mail worked for me. Maybe
> you try a different version or a different operating system for your scripts.
>
> ------------------------------------------------------------------------------
> The Planet: dedicated and managed hosting, cloud storage, colocation
> Stay online with enterprise data centers and the best network in the business
> Choose flexible plans and management services without long-term contracts
> Personal 24x7 support from experience hosting pros just a phone call away.
> http://p.sf.net/sfu/theplanet-com
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> 
-- 
"Crime is way down. War is declining. And that's far from the good 
news." -- Steven Pinker (and other sources) Why is this true, but yet 
the media says otherwise? The media knows very well how to manipulate us 
(see limbic, emotion). -- WTW
From: Michael D. <md...@st...> - 2010年02月08日 16:22:47
Matplotlib will output Type 42 fonts if the rcParam "ps.fonttype" is set to 42. Type 3 is the default because it greatly reduces filesize (it embeds only a subset of the font), particularly with large Unicode fonts like Vera Sans.
Mike
From: Michael D. <md...@st...> - 2010年02月08日 16:14:56
Have you tried explicitly calling .clf() on the matplotlib Figure object from your Tix.Frame.destroy callback?
Mike
37 messages has been excluded from this view by a project administrator.

Showing results of 620

<< < 1 .. 18 19 20 21 22 .. 25 > >> (Page 20 of 25)
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 によって変換されたページ (->オリジナル) /