SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S
1
(2)
2
(1)
3
(6)
4
(19)
5
(11)
6
(2)
7
8
(5)
9
(13)
10
(25)
11
(28)
12
(6)
13
(10)
14
(3)
15
(4)
16
(8)
17
(16)
18
(12)
19
(16)
20
(12)
21
(11)
22
(13)
23
(11)
24
(22)
25
(28)
26
(11)
27
(8)
28
(7)
29
(19)
30
(3)
31
(20)




Showing 11 results of 11

From: Fernando P. <Fer...@co...> - 2006年01月26日 21:48:52
Christopher Barker wrote:
> Fernando Perez wrote:
> 
>>the code behind this:
>>
>>http://bayes.colorado.edu/cgi-bin/arrows/arrow_cgi.py
>>
>>(just try the mock example with the data in the page) is coming to 
>>matplotlib in a week or two.
> 
> 
> Now you tell me!
> 
> Would you be willing to send me some code sooner? I don't want to work 
> on my code more it you've already done a better job of it.
> 
> Did you make a "Collections" class. I can imagine that performance could 
> be important sometimes.
I didn't write the code, so I can't send it. I'll contact the author and let 
him know.
Cheers,
f
From: Alan G I. <ai...@am...> - 2006年01月26日 20:38:46
From: Christopher B. <Chr...@no...> - 2006年01月26日 19:47:07
Fernando Perez wrote:
> the code behind this:
> 
> http://bayes.colorado.edu/cgi-bin/arrows/arrow_cgi.py
> 
> (just try the mock example with the data in the page) is coming to 
> matplotlib in a week or two.
Now you tell me!
Would you be willing to send me some code sooner? I don't want to work 
on my code more it you've already done a better job of it.
Did you make a "Collections" class. I can imagine that performance could 
be important sometimes.
-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: Fernando P. <Fer...@co...> - 2006年01月26日 17:55:52
Christopher Barker wrote:
> Hi all,
> 
> I've written a little custom LineCollection class that draws a bunch of 
> arrows pointing in given directions, with their origins at a set of 
> (x,y) points. I use this type of plot to plot vector quantities varying 
> over time, like an ocean current at a point, for instance. The x-axis is 
> time, the y-axis is magnitude, and the arrow points in the direction.
the code behind this:
http://bayes.colorado.edu/cgi-bin/arrows/arrow_cgi.py
(just try the mock example with the data in the page) is coming to matplotlib 
in a week or two. I think it addresses some of the issues you're dealing 
with: it's an arrows-on-steroids class, with control over heads (including the 
half-heads shown) and more.
Cheers,
f
From: John H. <jdh...@ac...> - 2006年01月26日 17:46:55
>>>>> "Jack" == Jack Sankey <jac...@gm...> writes:
 Jack> Hello, Is there a global figure handler, something like
_pylab_helpers.Gcf
 Jack> pylab.get_all_figures()
 Jack> that returns an array of figure instances? Right now I'm
 Jack> just using wx.GetTopLevelWindows()[n].canvas.figure
import _pylab_helpers
figures = [manager.canvas.figure for manager in _pylab_helpers.Gcf.get_all_fig_managers()]
JDH
From: Jack S. <jac...@gm...> - 2006年01月26日 17:33:31
Hello,
Is there a global figure handler, something like
pylab.get_all_figures()
that returns an array of figure instances? Right now I'm just using
wx.GetTopLevelWindows()[n].canvas.figure
Thanks,
Jack
From: Christopher B. <Chr...@no...> - 2006年01月26日 17:26:48
Attachments: VectorPlot.png VecPlot.py
Hi all,
I've written a little custom LineCollection class that draws a bunch of 
arrows pointing in given directions, with their origins at a set of 
(x,y) points. I use this type of plot to plot vector quantities varying 
over time, like an ocean current at a point, for instance. The x-axis is 
 time, the y-axis is magnitude, and the arrow points in the direction.
I've enclosed a PNG of a sample plot (with clearly meaningless data), 
and the code that created it.
John Hunter wrote:
> What you want to do is use a line collection,
Following John's sample code, I got it working, but I do have a few 
questions:
I'm now drawing the arrows as a LineCollection, and then drawing with 
'o' markers on top to get the circles. Is there a way to add markers 
like that to the LineCollection, so that it's a single class?
The arrow heads look a bit off. If you make them much larger, they look 
fine, but small, they're not quire right. I suspect there is some 
rounding to integers that is going on. Or maybe it's something with the 
join style? (note, I'm using GTKAgg)
The way the code is written now, I need to pass in a axes object and a 
figure object, as I need the transData attribute from the axes and the 
dpi attribute from the figure. This creates a coupling that I'm not 
happy with. It's a bit odd that I have to pass the axes into the 
constructor, then add the LineCollection to the axes again. Is there a 
way to write this so that the transOffset and transform are applied when 
the LineCollection is added to the axes, rather than ahead of time?
Also, the Figure coupling is even worse -- is there a way to discover 
what figure an axes is on from the axes itself (or get it's dpi, which 
is all I really need?)
I guess what I'm hoping exists, and suggesting if it doesn't, is that 
the scaling and all would be "lazy", like lazy Values. The transform and 
scaling wouldn't be defined until it's time to actually render the 
LineCollection. I did something like that in my FloatCanvas. Each 
DrawObject has a _Draw method that gets a "WorldToPixel" function passed 
in. This function converts world coordinates that the object is defined 
in to pixel coordinates that it needs to draw itself with. That way, the 
object can exist entirely separate from a Canvas, and need know nothing 
about how it's coordinates need to be transformed until it needs to draw 
itself. Can something like this be done in MPL?
Would this be a useful plot type to add to MPL? If so, can you suggest 
an existing class that I should imitate to define what the interface 
would look like?
thanks,
-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: John H. <jdh...@ac...> - 2006年01月26日 15:24:58
>>>>> "J" == J Brandenburg <J.B...@if...> writes:
 J> Hi,
 >> r,t = ogrid[0:pi:deltatheta, 0:2*pi:deltatheta]
 J> doesn't work for me...
 J> running
 J> ------------------------------------------------------------
 J> from scipy import * from pylab import *
Could it be that you don't have numpy as your rc setting in
matplotlib? If not, you're getting the wrong names when you do 
from pylab import *
JDH
From: Travis O. <oli...@ie...> - 2006年01月26日 14:33:39
>typecode.
> 
>
This is an error from old Numeric. I'm still not sure why you are 
getting it as this works for me using old scipy. 
-Travis
From: <J.B...@if...> - 2006年01月26日 10:02:43
Hi,
>r,t = ogrid[0:pi:deltatheta, 0:2*pi:deltatheta]
doesn't work for me...
running
------------------------------------------------------------
from scipy import *
from pylab import *
deltatheta = 2.*pi/100.
r,t=ogrid[0:pi:deltatheta, 0:2.*pi:deltatheta]
Z = sin(r)*sin(3.*t)
X = r*cos(t)
Y = r*sin(t)
figure(figsize=(8,8))
cs = contourf(X, Y, Z)
title('Simple polar contour plot')
show()
------------------------------------------------------------
Returns me the following:
Editing... done. Executing edited code...
---------------------------------------------------------------------------
exceptions.TypeError Traceback (most recent
call last)
/media/exchange/Python/bsp_polar02.py
 6 deltatheta = 2.*pi/100.
 7 r,t=ogrid[0:pi:deltatheta, 0:2.*pi:deltatheta]
----> 8 Z = sin(r)*sin(3.*t)
 9 X = r*cos(t)
 10 Y = r*sin(t)
TypeError: function not supported for the spacesaver array with the largest
typecode.
Cheers
Jens Brandenburg
From: John H. <jdh...@ac...> - 2006年01月26日 04:27:57
>>>>> "Jerry" == Jerry He <reb...@ya...> writes:
 Jerry> Hi, When I tried to save a plot from the TkAgg GUI, it
 Jerry> gave me an error message, here's the whole sesssion
 
...snip...
 >>>> show()
One should never call 'show' from the interactive shell; see
http://matplotlib.sf.net/faq.html#SHOW
But, even considering that, I cannot replicate your bug. What
version of mpl are you using?
 Jerry> self.renderer._renderer.write_png(str(filename))
 Jerry> UnicodeEncodeError: 'ascii' codec can't encode characters
 Jerry> in position 36-37: ord inal not in range(128)
Looks like something funny with unicode -- please describe as much as
possible about your (language) environment and if possible a complete
free-standing script which replicates the bug.
Thanks!
JDH

Showing 11 results of 11

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