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






Showing 6 results of 6

From: McBuell <c.s...@pa...> - 2008年11月24日 23:19:23
hi folks !
I'm working now quite a while with the matplotlib, also in the animated case
of plot_date and imshow charts.
Now I should use a vertical line (fixed to a plot_date plot, not to the
axis!) 
and I thought about using vlines as before.
But I have troubles to use the set_array method after the vlines are
created.
Does anybody know the exact array shape and content ?
After I pass any possible combination to the set_array method, the
esablished lines turn gray (from green like they were construgted). They
also don't change the location as desired (they stay fix)
It isn't a problem of canvas redrawing, also autoscale() doesn't help (as it
helped me with animated imshow).
Does anyone have experiance with animated vlines ? eg a working code example
?
Thank you in advance, 
Cheers
-- 
View this message in context: http://www.nabble.com/vlines-animation-problem-tp20672134p20672134.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2008年11月24日 13:07:15
Can you be more specific about what you would like to know? I'm happy 
to help.
Mike
Ron Brennan wrote:
> Hello,
>
> Does anyone know where I can find some histogram examples. The ones 
> with the documentation are not as self-explanatory as I would have liked.
>
> I'm not a mathematician and I am struggling to understand the math 
> behind the magic.
>
> Can anyone help?
>
> Thanks,
> Ron
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Jae-Joon L. <lee...@gm...> - 2008年11月24日 06:01:48
>
> What if I wanted one legend with both entries in it, rather than two
> separate legends with a different entry in each? Is that possible? That's
> more desirable than two separate legends.
>
Check
http://www.nabble.com/displaying-a-legend-from-a-different-subplot-td18447966.html#a18447966
The legend() function lets you explicitly set what items you want to
show, regardless which axes they are from.
-JJ
From: Alan J. <al...@aj...> - 2008年11月24日 02:46:43
On 2008年11月23日 16:48:59 -0800
Zane Selvans <za...@id...> wrote:
> Incidentally, when you do it with ax.plot() instead you can see more 
> easily that the corners where the two sinusoidal functions intersect 
> are getting kind of chopped off by the polygon filling. Don't know if 
> there's an easy way to fix that - maybe by forcing the list of polygon 
> vertices to always explicitly include the points of intersection 
> between the functions being filled_between? Or maybe just by 
> increasing the number of vertices, though I assume that would slow 
> things down.
Some time back, I wrote code to generate a fairly complex polyfill in
a plot in R, 
http://www.oplnk.net/~ajackson/weather/Temperature_2000.png
The key bit of code to find the intersections between all the curves
to fill the corners correctly is here (note that this is "R" code):
intersect <- function(a, b, c, d) {
 # test two line segments for intersection.
 # modified from segseg in "Computational Geometry in C" 
 # by Joseph O'Rourke
 p = c(0,0)
 denom = a[1] * ( d[2] - c[2] ) +
 b[1] * ( c[2] - d[2] ) +
 d[1] * ( b[2] - a[2] ) +
 c[1] * ( a[2] - b[2] );
 # If denom is zero, then segments are parallel: handle separately. 
 if (abs(denom) <= 1.0e-10) {
 return (c(p,0)) 
 }
 num = a[1] * ( d[2] - c[2] ) +
 c[1] * ( a[2] - d[2] ) +
 d[1] * ( c[2] - a[2] );
 if ( (num == 0.0) || (num == denom) ) code = 0;
 s = num / denom;
 num = -( a[1] * ( c[2] - b[2] ) +
 b[1] * ( a[2] - c[2] ) +
 c[1] * ( b[2] - a[2] ) );
 if ( (num == 0.0) || (num == denom) ) code = 0;
 t = num / denom;
 if ( (0.0 < s) && (s < 1.0) &&
 (0.0 < t) && (t < 1.0) ) {
 code = 1;
 }
 else if ( (0.0 > s) || (s > 1.0) ||
 (0.0 > t) || (t > 1.0) ) {
 code = 0;
 }
 p[1] = a[1] + s * ( b[1] - a[1] );
 p[2] = a[2] + s * ( b[2] - a[2] );
 c(p,code);
}
# Intersect two lines defined by a series of segments. Assume the
# lines have common x-values and differ only in y
# intersect is array of (x,y) values
intersect.lines <- function (y1,y2,x) {
 intersect = array(data = NA, dim = c(2,0), dimnames = NULL)
 for (i in 2:length(x)) {
 a = c(x[i-1], y1[i-1])
 b = c(x[i], y1[i])
 c = c(x[i-1], y2[i-1])
 d = c(x[i], y2[i])
 foo = intersect(a,b,c,d)
 if (foo[3]) {
 intersect = cbind(intersect, foo[1:2])
 }
 }
 intersect
}
-- 
-----------------------------------------------------------------------
| Alan K. Jackson | To see a World in a Grain of Sand |
| al...@aj... | And a Heaven in a Wild Flower, |
| www.ajackson.org | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake |
-----------------------------------------------------------------------
From: John O. <joh...@ya...> - 2008年11月24日 02:46:05
Jeff Whitaker wrote:
> 
> Jeremy Conlin wrote:
>>
>>
>> Thanks for that information, that is what I needed. But now I come up 
>> with a separate problem. I have the following in my code:
>>
>> pylab.plot(n, S, 'b.', label='x')
>> pylab.legend()
>> ax2 = pylab.twinx()
>> pylab.plot(n, mean, 'r',label="mean")
>> ax2.yaxis.tick_right()
>> pylab.legend()
>>
>> Both plots are shown with the appropriate axes, but only the second 
>> plot is listed in the legend. If I only have the first, then only the 
>> first plot will be listed. Please help.
>>
>> Jeremy 
> Jeremy: The problem is that the legends are plotting on top of each 
> other. Try using 'loc=1' for the first one and 'loc=2' for the second
> one.
> 
What if I wanted one legend with both entries in it, rather than two
separate legends with a different entry in each? Is that possible? That's
more desirable than two separate legends.
JDO
-- 
View this message in context: http://www.nabble.com/Two-questions-regarding-axis-scaling-tp19463338p20654006.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Zane S. <za...@id...> - 2008年11月24日 00:49:30
> Either way, it's
> pretty straightforward; just change one line in the Python Makefile
> and matplotlib will install with a simple "sudo python setup.py
> install"
Huh, well there was a make target for Leopard that had that fixed 
CFLAGS that you suggested, and it seemed to build and install without 
any major complaints. If I rename the Matplotlib directory that was 
installed by the SciPy superpack, and try to fire up ipython -pylab, 
it seems to work! Woo hoo!
It looks like there's a tiny doc bug here: http://matplotlib.sourceforge.net/examples/pylab_examples/fill_between.html
ax = fig.add_subplot(111)
ax1.plot(x, y1, x, y2, color='black')
ax.fill_between(x, y1, y2, where=y2>y1, facecolor='green')
ax.fill_between(x, y1, y2, where=y2<=y1, facecolor='red')
ax.set_title('fill between where')
It should be calling ax.plot() not ax1.plot()
Incidentally, when you do it with ax.plot() instead you can see more 
easily that the corners where the two sinusoidal functions intersect 
are getting kind of chopped off by the polygon filling. Don't know if 
there's an easy way to fix that - maybe by forcing the list of polygon 
vertices to always explicitly include the points of intersection 
between the functions being filled_between? Or maybe just by 
increasing the number of vertices, though I assume that would slow 
things down.
--
Zane Selvans
Amateur Earthling
za...@id...
303/815-6866
http://zaneselvans.org
PGP Key: 55E0815F

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