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






Showing 7 results of 7

From: Michael R. <raw...@ya...> - 2012年09月27日 23:57:35
>________________________________
> From: Benjamin Root <ben...@ou...>
>To: Michael Rawlins <raw...@ya...> 
>Cc: Matplotlib Users <mat...@li...> 
>Sent: Thursday, September 27, 2012 2:29 PM
>Subject: Re: [Matplotlib-users] error reading netcdf file
> 
>
>Michael,
>
>The .missing_value attribute is not used anymore (It is ._FillValue now). Anyway, if your data had any value that matched ._FillValue, then, by default, netCDF4 will give you a masked array anyway. You will only need to set the mask if the fill value doesn't exist or if it is different from what you were expecting.
>
>Ben Root
>
>
>
Thanks Ben. I'll play around with ._FillValue and masked arrays. Glad to have everything working again with this new OS.
Mike
From: Benjamin R. <ben...@ou...> - 2012年09月27日 18:29:36
Michael,
The .missing_value attribute is not used anymore (It is ._FillValue now).
Anyway, if your data had any value that matched ._FillValue, then, by
default, netCDF4 will give you a masked array anyway. You will only need
to set the mask if the fill value doesn't exist or if it is different from
what you were expecting.
Ben Root
From: Sergio <ser...@gm...> - 2012年09月27日 16:20:15
Hi,
trying to create a velocity plot for a 2d ode and superimposing it onto
a trajectory, I am encountering some issues with quiver.
Let ns1(x,t) be a vector function defining the ode, ready to be integrated with
scipy odeint and actually invariant with t. Here, x is a 1d state array with 2
entries.
I get the velocity field by first creating vectors of interesting points on the
two axis, say xg and yg. Then I make a grid with
xxg, yyg = np.meshgrid(xg, yg)
and I finally compute the velocity components as
vel = np.asarray(map(lambda x1, x2: ns1((x1,x2),0), xxg.flat, yyg.flat))
u=vel[:,0]
v=vel[:,1]
Now, I try to superimpose a trajectory with the velocity plot.
However, after having plotted the integrated trajectory, I cannot call
plt.quiver(xxg, yyg, u, v)
because the u and v components have very different ranges.
Trying to normalize as
plt.quiver(xxg, yyg, u/xrange, v/yrange)
looks (almost) right, but it is not nice to have to precompute the ranges.
I was expecting
plt.quiver(xxg, yyg, u, v, angles='xy')
to do the job automatically, but this is not the case.
For points with null x coordinate my arrows always have null length,
while this was not the case with the previous test.
any clue?
From: Michael R. <raw...@ya...> - 2012年09月27日 14:47:01
----- Original Message -----
> From: Michael Rawlins <raw...@ya...>
> To: Jeff Whitaker <jef...@no...>; Benjamin Root <ben...@ou...>; Matplotlib Users <mat...@li...>
> Cc: 
> Sent: Wednesday, September 26, 2012 6:23 PM
> Subject: Re: [Matplotlib-users] error reading netcdf file
> 
> 
> 
>> ________________________________
>> From: Jeff Whitaker <jef...@no...>
>> To: Benjamin Root <ben...@ou...>; Michael Rawlins 
> <ra...@ge...>; Matplotlib Users 
> <mat...@li...> 
>> Sent: Wednesday, September 26, 2012 5:10 PM
>> Subject: Re: [Matplotlib-users] error reading netcdf file
>> 
>> 
>> Michael: You can't change an attribute in a read-only dataset. It 
> should never have worked.
>> 
>> -Jeff
>> 
>> 
> 
> 
> Thanks Jeff and Ben.
> 
> Below is a complete version of one such program I use. I was give the program by 
> a colleague and I do not know who wrote that code. My previous post showed only 
> as far as the missing data statement.
> 
<snip>
I've gotten my script to work by setting the missing value another way. I'm showing lines commented out as well.
#data.missing_value=-9.99
#try:
#  mval=data.missing_value
#  print " using specified missing value =",mval
#except:
  mval=-9.99
#  print " faking missing value=",mval
# make a masked array: using missing value(s) in mval
maskdat=ma.masked_values(slice,mval)
If I understand correctly, in previous versions the value of -9.99 was passed through the data.missing_value into mval. A mistake in coding that did not result in an error. I will implement the change. Tomorrow I'll check that this solution is backward compatible.
Mike
From: Damon M. <dam...@gm...> - 2012年09月27日 13:30:31
On Thu, Sep 27, 2012 at 1:07 PM, Benjamin Root <ben...@ou...> wrote:
>
>
> On Thursday, September 27, 2012, Pierre Haessig wrote:
>>
>> Hi Paul,
>>
>> Le 26/09/2012 18:14, Paul Tremblay a écrit :
>> > I noticed today that when I create a bar graph with zero values that
>> > the labels don't align correctly:
>>
>> When I run your code with defects = [0, 0, 0, 5, 6, 7], I don't notice a
>> misalignment of xlabels, but rather a issue with xaxis scaling being
>> different (and not very good). So it would be more an issue of xaxis
>> autoscaling.
>>
>> Maybe you can send a link to your saved figure to check we are talking
>> of the same thing. I've attached my figures (manual 3 panels composition).
>>
>> Also, I've noticed that the xscaling issue doesn't come from zero values
>> in general, but from defects[0] being zero.
>>
>> Best,
>> Pierre
>
>
> This issue has been mentioned before. The problem happens for a zero bar on
> either end. Particularly, a bar with zero height does not register a bbox
> for determining the axis limits. We will likely need a slightly different
> way of autoscaling for bar()
>
> Ben Root
>
As an epic hack/workaround. Could you set bars of zero height to
instead be of height, 10e-5. Or something small compared to whatever
the current scale on the y-axis is. Or call ax.set_xlim yourself after
plotting? It's not ideal, but does it help?
Like Ben said, the bbox should account for all possible bar locations,
regardless of height, for this to behave as expected.
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Benjamin R. <ben...@ou...> - 2012年09月27日 12:07:29
On Thursday, September 27, 2012, Pierre Haessig wrote:
> Hi Paul,
>
> Le 26/09/2012 18:14, Paul Tremblay a écrit :
> > I noticed today that when I create a bar graph with zero values that
> > the labels don't align correctly:
>
> When I run your code with defects = [0, 0, 0, 5, 6, 7], I don't notice a
> misalignment of xlabels, but rather a issue with xaxis scaling being
> different (and not very good). So it would be more an issue of xaxis
> autoscaling.
>
> Maybe you can send a link to your saved figure to check we are talking
> of the same thing. I've attached my figures (manual 3 panels composition).
>
> Also, I've noticed that the xscaling issue doesn't come from zero values
> in general, but from defects[0] being zero.
>
> Best,
> Pierre
>
This issue has been mentioned before. The problem happens for a zero bar
on either end. Particularly, a bar with zero height does not register a
bbox for determining the axis limits. We will likely need a slightly
different way of autoscaling for bar()
Ben Root
From: Pierre H. <pie...@cr...> - 2012年09月27日 07:50:58
Hi Paul,
Le 26/09/2012 18:14, Paul Tremblay a écrit :
> I noticed today that when I create a bar graph with zero values that
> the labels don't align correctly:
When I run your code with defects = [0, 0, 0, 5, 6, 7], I don't notice a
misalignment of xlabels, but rather a issue with xaxis scaling being
different (and not very good). So it would be more an issue of xaxis
autoscaling.
Maybe you can send a link to your saved figure to check we are talking
of the same thing. I've attached my figures (manual 3 panels composition).
Also, I've noticed that the xscaling issue doesn't come from zero values
in general, but from defects[0] being zero.
Best,
Pierre

Showing 7 results of 7

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