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




Showing 13 results of 13

From: Peter S. <pet...@gm...> - 2009年03月02日 23:59:25
Is there any way to encode 2 variables in a matplotlib colormap? The idea
is to replicate this dataspora R scatterplot in matplotlib:
http://www.dataspora.com/gameday/pitcher/daisuke-matsuzaka/493137
"The bottom strip of charts encode two dimensions with color -- blue or red
hue indicates pitch velocity -- while the lightness or darkness of the hue
indicates how many pitches were thrown in a given region. "
-- 
Peter N. Skomoroch
617.285.8348
http://www.datawrangling.com
http://delicious.com/pskomoroch
http://twitter.com/peteskomoroch
From: hazelnusse <haz...@gm...> - 2009年03月02日 22:26:40
I am generating level curves numerically with a gradient method of my own
recipe. The result is a bunch of 100x2 vectors, each 'row' of which is a
point on a level curve in the plane. My goal is to label each plot line
analogously to how contour lines are labelled with clabel. Is this
possible? If so, does anybody know how or have some example code?
Thanks,
~Luke
-- 
View this message in context: http://www.nabble.com/Label-plot-lines-analogously-to-clabel-tp22295292p22295292.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Jeff W. <js...@fa...> - 2009年03月02日 21:39:28
Jose Gomez-Dans wrote:
> Hi!
>
> [I think the message didn't get through the first time I sent it. 
> Resending, and apologies if you get it twice]
>
> I have a rather complex basemap-derived plot that I want to save as 
> animation.
> In essence, it uses the blumarble() to add a nice background, plots some
> stuff on top of that, and also has an inset with a map of the world that
> shows the area of the main map.
>
> The problem is that memory usage as I iterate through the frames that will
> eventually make up my animation, rises very fast. I read a post some 
> time ago
> on how to store the background, so it didn't have to be recreated 
> everytime
> here:
> <http://www.nabble.com/Save-a-plot-background-to20519596.html#a20519596>
>
> There's an example on how to actually do this for basemaps from J 
> Whitaker,
> but I can't get this to work on my example. Ideally, I would like to store
> the inset in a function, and my main background in another function, and
> restore each axis directly. My attempt follows (which produces a blank 
> image)
> is at <http://pastebin.com/f4636fd7f>
>
> Many thanks!
> Jose
Jose: I think the key is to only create the basemap instance only once 
(for the main plot and for the inset), then re-use that basemap instance 
each time you create an animation frame. 
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Jeffrey F. <mat...@je...> - 2009年03月02日 20:56:06
I just upgraded from 0.98.3 to 0.98.5.2 on my Mac (OS X 10.4.11) because I
wanted some of the new legend features, and now have two strange errors.
1) When I run a script that creates a plot, the terminal window (either a
command prompt or ipython) is now frozen until I have closed the plot
window. Previously, this same script would create the plot, but then allow
me to access the prompt.
2) I seem to no longer be able to zoom in or out on the plots.
Additionally, with 0.98.3 I used to be able to dynamically move the plots (I
would see the figure move as I dragged it), but now the plot doesn't move
until after I've released the mouse button, making it harder to see how far
I've moved it.
I've noticed that my old backend was 'TkAgg', while 0.98.5.2 defaults to
'MacOSX'. I've tried running
matplotlib.rcParams['backend'] = 'TkAgg'
at the top of my script, but that doesn't seem to do anything (I have the
same problems). Does anyone have any idea what's happening or how I can fix
these problems? If not I may need to go back to 0.98.3 for now. Thanks.
-Jeffrey
From: Jose Gomez-D. <jgo...@gm...> - 2009年03月02日 20:12:14
Hi!
[I think the message didn't get through the first time I sent it. Resending,
and apologies if you get it twice]
I have a rather complex basemap-derived plot that I want to save as
animation.
In essence, it uses the blumarble() to add a nice background, plots some
stuff on top of that, and also has an inset with a map of the world that
shows the area of the main map.
The problem is that memory usage as I iterate through the frames that will
eventually make up my animation, rises very fast. I read a post some time
ago
on how to store the background, so it didn't have to be recreated everytime
here:
<http://www.nabble.com/Save-a-plot-background-to20519596.html#a20519596>
There's an example on how to actually do this for basemaps from J Whitaker,
but I can't get this to work on my example. Ideally, I would like to store
the inset in a function, and my main background in another function, and
restore each axis directly. My attempt follows (which produces a blank
image)
is at <http://pastebin.com/f4636fd7f>
Many thanks!
Jose
From: Jose Gómez-D. <jgo...@gm...> - 2009年03月02日 19:57:58
Hi!
I have a rather complex basemap-derived plot that I want to save as animation. 
In essence, it uses the blumarble() to add a nice background, plots some 
stuff on top of that, and also has an inset with a map of the world that 
shows the area of the main map. 
The problem is that memory usage as I iterate through the frames that will 
eventually make up my animation, rises very fast. I read a post some time ago 
on how to store the background, so it didn't have to be recreated everytime 
here: 
<http://www.nabble.com/Save-a-plot-background-to20519596.html#a20519596>
There's an example on how to actually do this for basemaps from J Whitaker, 
but I can't get this to work on my example. Ideally, I would like to store 
the inset in a function, and my main background in another function, and 
restore each axis directly. My attempt follows (which produces a blank image) 
is at <http://pastebin.com/f4636fd7f>
Many thanks!
Jose
From: Ryan M. <rm...@gm...> - 2009年03月02日 19:36:30
On Sat, Feb 28, 2009 at 1:23 PM, per freem <per...@gm...> wrote:
> hi all,
>
> two quick questions about plotting: i am trying to very simply reset the
> font family to be 'helvetica' for my figure, in particular for the
> ticklabels. i have tried using the following:
>
> def axes_square(plot_handle):
> plot_handle.axes.set_aspect(1/plot_handle.axes.get_data_ratio())
>
> rcParams['font.family'] = 'Helvetica'
> p = matplotlib.font_manager.FontProperties()
> p.set_family('Helvetica')
> x = rand(20)
> ax = plot(x, x, 'bo', markeredgecolor='blue', mfc='none')
> axes_square(p)
>
Unrelated to your original question, is there a reason you need axes_square
there and can't just use:
ax.set_aspect('equal')
?
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
Sent from: Norman Oklahoma United States.
From: Jonathan T. <jon...@ut...> - 2009年03月02日 18:50:38
Try this:
from matplotlib import pyplot as plt
from matplotlib.patches import Circle
f = plt.figure()
ax = f.gca()
rad = 1.4
c1 = Circle((-1,0),rad, alpha=.2, fc ='red')
c2 = Circle((1,0),rad, alpha=.2, fc ='blue')
c3 = Circle((0,1),rad, alpha=.2, fc ='green')
ax.add_patch(c1)
ax.add_patch(c2)
ax.add_patch(c3)
ax.set_xlim(-3,3)
ax.set_ylim(-3,3)
plt.show()
J.
On Sun, Mar 1, 2009 at 6:32 PM, per freem <per...@gm...> wrote:
> hi all,
>
> can someone advise on how to make simple venn diagrams, like the one here:
>
> http://en.wikipedia.org/wiki/File:Venn_diagram_cmyk.svg
>
> simply three (or more) intersecting circles, such that one can label every
> point of their intersection, and maybe make the circles in size proportion
> to the number of elements they are supposed to represent. i know some
> people use Sage for this but i prefer to use matplotlib directly.
>
> any help / info on how to get started on this or some example code would be
> greatly appreciated.
>
> thank you.
>
> ------------------------------------------------------------------------------
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a 600ドル discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
From: Naoli <na...@tu...> - 2009年03月02日 12:50:40
Such a shame... Anyway, I'm glad to learn horizontal bars are possible, I'll
try it.
Thanks for your answers.
Naoli
2009年3月1日 Jae-Joon Lee <lee...@gm...>
> Horizontal bar is possible, although i'm not sure it fits your need.
>
> http://matplotlib.sourceforge.net/examples/pylab_examples/barh_demo.html
>
> Anyhow, with the current mpl, I guess it is much easy to make the
> horizontal bars with rectangle patches (in case barh does not do what
> you want), rather than trying to rotate the legend.
>
> -JJ
>
>
>
> On Sun, Mar 1, 2009 at 3:34 AM, Naoli <na...@tu...> wrote:
> > Hi,
> >
> > thanks for the answer. That's what I thought.
> > I'm using a bar chart plot to do a Gantt Project planner (please see
> > example). Since it's not possible to draw horizontal bars, I plot a
> "normal"
> > bar chart (vertical bars) and rotate the whole figure (please see
> attached
> > file), this is why I need the legend to be 90°-rotated, so that it's in
> the
> > right position afterall.
> >
> > Thanks for your time.
> >
> > Regards.
> >
> > N.
> >
> >
> > 2009年3月1日 Jae-Joon Lee <lee...@gm...>
> >>
> >> I don' think these is a straight forward way to rotate the legend as a
> >> whole.
> >> As a matter of fact, it is hardly possible with the current
> >> implementation of the legend class. Could you explain why do you want
> >> to have a rotated legend? An example figure (from other plotting
> >> package) will be very helpful. If a rotated legend is desirable, I'll
> >> work on to support it.
> >>
> >> Regards,
> >>
> >> -JJ
> >>
> >>
> >> On Sat, Feb 28, 2009 at 4:10 AM, Naoli <na...@tu...> wrote:
> >> > Hi guys,
> >> >
> >> > I was wondering if it's possible to rotate a legend ?
> >> >
> >> > Thanks for your help.
> >> >
> >> > Naoli
> >> >
> >> >
> >> >
> ------------------------------------------------------------------------------
> >> > Open Source Business Conference (OSBC), March 24-25, 2009, San
> >> > Francisco, CA
> >> > -OSBC tackles the biggest issue in open source: Open Sourcing the
> >> > Enterprise
> >> > -Strategies to boost innovation and cut costs with open source
> >> > participation
> >> > -Receive a 600ドル discount off the registration fee with the source
> code:
> >> > SFAD
> >> > http://p.sf.net/sfu/XcvMzF8H
> >> > _______________________________________________
> >> > Matplotlib-users mailing list
> >> > Mat...@li...
> >> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >> >
> >> >
> >
> >
>
From: Eric F. <ef...@ha...> - 2009年03月02日 04:37:34
Simson Garfinkel wrote:
> In working on code for matplotlib, I would generally find it easier to 
> provide an array of objects than to provide an array of X values and a 
> second array of Y values. I understand that X[] and Y[] is the way 
> that matlab does it, but we would find it easier to provide an array 
> of either tuples [(x1,y1), (x2,y2), ...] or else an array of objects 
> with .x and .y properties.
> 
> Other than doing our own cover, is there any other way to do this? Any 
> thoughts of adding this functionality?
Internally, we often do end up using Nx2 ndarrays.
I don't think it makes sense to complicate the API by directly 
supporting other function signatures, however, if this is what you are 
proposing. For example, we have plot(y) and plot(x,y); to support 
either of the alternatives you mention above would require either a 
kwarg or a different function name. Personally, I would rather leave it 
to the user to take care of this as needed, and keep the additional 
complexity out of matplotlib.
Eric
> 
> -Simson
> 
From: Eric F. <ef...@ha...> - 2009年03月02日 04:28:20
Simson Garfinkel wrote:
> Greetings.
> 
> I have a colleague who I have worked hard to convert from matlab to 
> matplotlib.
> 
> One issue that has come up is clickable graphs. He would like to be 
> able to click on the graphs that matplotlib produces and actually have 
> things happen. For example:
> 
> * Display information about a histogram, like the values that went 
> into the bin.
> * Have a callback called with information about where the click took 
> place.
> 
> Is there any way to do this?
Yes. To begin, see examples/event_handling/pick_event_demo.py and 
pick_event_demo2.py.
On the web, the code is here:
http://matplotlib.sourceforge.net/examples/event_handling/index.html
Eric
From: Simson G. <si...@ac...> - 2009年03月02日 03:14:04
In working on code for matplotlib, I would generally find it easier to 
provide an array of objects than to provide an array of X values and a 
second array of Y values. I understand that X[] and Y[] is the way 
that matlab does it, but we would find it easier to provide an array 
of either tuples [(x1,y1), (x2,y2), ...] or else an array of objects 
with .x and .y properties.
Other than doing our own cover, is there any other way to do this? Any 
thoughts of adding this functionality?
-Simson
From: Simson G. <si...@ac...> - 2009年03月02日 03:12:11
Greetings.
I have a colleague who I have worked hard to convert from matlab to 
matplotlib.
One issue that has come up is clickable graphs. He would like to be 
able to click on the graphs that matplotlib produces and actually have 
things happen. For example:
* Display information about a histogram, like the values that went 
into the bin.
* Have a callback called with information about where the click took 
place.
Is there any way to do this?
1 message has been excluded from this view by a project administrator.

Showing 13 results of 13

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