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





Showing results of 318

<< < 1 .. 6 7 8 9 10 .. 13 > >> (Page 8 of 13)
On 4/10/07, Eric Firing <ef...@ha...> wrote:
> Ideas and strategy sketches tend to get lost in the email stack; would
> it help to have a wiki page for discussion of major design questions
> like this? Or is this overkill?
My preference is for (possibly structured) text documents in the svn
repo, ala CODING_GUIDE
Ted Drain wrote:
> John,
> One of the problems we've had is trying to design an auto-scaling 
> algorithm that works well with any type date format since the date 
> strings can be so large horizontally. I believe that having the draw 
> time elements be able to query the renderer for things would help 
> this out tremendously since we could then have the tick generator 
> space out the dates along nice boundaries without overlapping the date strings.
This is only half of the solution; the other half is controlling the 
order in which things are done. In its most general form, this would 
involve some sort of dependency tree, automatically generated. I 
imagine this is how layout engines work. I know that Andrew contributed 
one quite some time ago, and so far I have done nothing with it. (Sorry, 
Andrew.) A simpler mechanism suggested by John was a set of pre- and 
post- hooks in draw functions that would enable one to manually put in 
dependencies and ensure that dependent calculations are done in the 
right order. In all of this, it is critical to avoid chicken-and-egg 
situations: e.g., label font size depends on physical room available, 
but tick spacing adjusts to accommodate the labels.
The transforms module already does part of what we are talking about 
here; dependency information is accumulated as BinOps are built from 
other BinOps, and everything is resolved at rendering time.
I think that any changes like this need to wait in line behind the 
upcoming numpyfication, and it would be nice to have some full outlines 
of alternative strategies before picking one and proceeding.
Ideas and strategy sketches tend to get lost in the email stack; would 
it help to have a wiki page for discussion of major design questions 
like this? Or is this overkill?
Eric
> 
> Ted
> 
> At 01:07 PM 4/7/2007, John Hunter wrote:
>> On 4/7/07, Eric Firing <ef...@ha...> wrote:
>>
>>> I put back get_lines() in collections and fixed a related bug in legend,
>>> so the test script now works in the sense that it makes a legend. It
>>> puts in an unlabeled line, presumably corresponding to the line
>>> collection making up the error bars. Maybe legend provides a way to
>>> avoid this. I haven't looked.
>> If I'm understanding the problem you are describing correctly, it
>> looks like _nolegend_ needs to be set here. For artists we do not want
>> to be included in the legend, the label should be set to '_nolegend_'
>> and legend will ignore it in auto-legending. Or at least it should
>> and if it is not it is a bug.
>>
>>> The larger problem, and the one that probably made me yank get_lines
>>> (without realizing the legend code was using it--my mistake--I do try to
>>> check for things like that) is that legend really wants to know the
>>> draw-time locations of all plot elements, and for collections (among
>>> other things) this cannot be determined in general. The collection
>>> get_lines and get_verts methods can give the right answer to legend only
>>> if the data and offset transforms are the same. Sometimes they are,
>>> sometimes they are not. LineCollection.get_lines() probably could be
>>> improved to do a better job than at present, but never a perfect one.
>> One approach is to make every artist provide a get window extent which
>> returns a bounding box. There is the issue of how to get the renderer
>> before draw time, but we could fix this. It would be nice for draw
>> time layout algorithms to be able to assume this method, and a few
>> objects already provide it, eg text.
>>
>>> This is an example of a more widespread problem that we have thought
>>> about and discussed (including some good ideas from John, of course),
>>> but solving it is not simple. For the time being, at least, we are
>>> stuck with some imperfections.
>>>
>>> In any case, thanks for bringing the legend/LineCollection bug to my
>>> attention. This is the sort of thing it is nice to get cleaned up
>>> before the next release, coming soon. Do you know of some other simple
>>> bugs like this we should look at ASAP?
>>
>> I added unit/legend_unit.py script to create legends using a scatter
>> and vlines, which create RegPolyCollections and LineCollections. We
>> should use more stuff like this in general, unit scripts which
>> exercise the more arcane usages.
>>
>> JDH
From: Eric F. <ef...@ha...> - 2007年04月10日 17:43:55
There seems to be a huge misunderstanding here, and I am not sure what 
it is, but what you need to do is run examples and experiment with 
variations until you have some inkling of what mpl is actually doing. 
 Start with http://matplotlib.sourceforge.net/tutorial.html.
Please note that the ticks are simply labeled locations--they have no 
effect on what data are plotted.
When you do ax.plot(ind*dt, y), absolutely *nothing* is lost; every 
value of y in your array is plotted. mpl is plotting (x,y) pairs--all of 
them--and labeling the axes accordingly.
To see what is being plotted, you can use plot(x,y,'ro'), for example, 
to plot each point as a red circle. Experiment with this.
Don't worry right now about avoiding the pylab interface; take advantage 
of its simplicity to get the most basic plotting concepts straightened 
out via quick experimentation. Use the gui zoom button to see how axis 
labeling works. Make your own simple examples; plot random points, plot 
sin waves.
Eric
Iyer wrote:
> It is not what I need..
> 
> http://matplotlib.sourceforge.net/matplotlib.axes.html
> 
> The plot method (plot(self, *args, **kwargs)) accepts
> only x,y pairs, in ax.plot(ind*dt, y) -- the x
> parameter is ind*dt - the sample times, but the data
> between the sample points is lost. IMHO, the likely
> way to prevent loss of sampled data points is changing
> the ticks, isn't that possible to change the ticks,
> while keeping the data as it is -- plotted as if it
> were for a number of data points.
> 
> -iyer
> 
> 
> 
> 
> --- John Hunter <jd...@gm...> wrote:
> 
>> On 4/10/07, John Hunter <jd...@gm...> wrote:
>>> On 4/10/07, Iyer <mas...@ya...> wrote:
>>>> I apologize if I haven't been sufficiently
>> clear.
>>>> While your suggestion picks out the samples from
>> the
>>>> sample set, and discards other samples - what I
>> was
>>>> looking at --
>> My suggestion does not "discard other samples", so
>> you may not be
>> understanding what I am saying. Perhaps you can try
>> the suggested
>> code and see if it does what you want. My example
>> plots all the
>> samples; it simply scales the xaxis to represent
>> time and not sample
>> number.
>>
> 
> 
> 
> 
> ____________________________________________________________________________________
> Looking for earth-friendly autos? 
> Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
> http://autos.yahoo.com/green_center/
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
John,
One of the problems we've had is trying to design an auto-scaling 
algorithm that works well with any type date format since the date 
strings can be so large horizontally. I believe that having the draw 
time elements be able to query the renderer for things would help 
this out tremendously since we could then have the tick generator 
space out the dates along nice boundaries without overlapping the date strings.
Ted
At 01:07 PM 4/7/2007, John Hunter wrote:
>On 4/7/07, Eric Firing <ef...@ha...> wrote:
>
> > I put back get_lines() in collections and fixed a related bug in legend,
> > so the test script now works in the sense that it makes a legend. It
> > puts in an unlabeled line, presumably corresponding to the line
> > collection making up the error bars. Maybe legend provides a way to
> > avoid this. I haven't looked.
>
>If I'm understanding the problem you are describing correctly, it
>looks like _nolegend_ needs to be set here. For artists we do not want
>to be included in the legend, the label should be set to '_nolegend_'
>and legend will ignore it in auto-legending. Or at least it should
>and if it is not it is a bug.
>
> > The larger problem, and the one that probably made me yank get_lines
> > (without realizing the legend code was using it--my mistake--I do try to
> > check for things like that) is that legend really wants to know the
> > draw-time locations of all plot elements, and for collections (among
> > other things) this cannot be determined in general. The collection
> > get_lines and get_verts methods can give the right answer to legend only
> > if the data and offset transforms are the same. Sometimes they are,
> > sometimes they are not. LineCollection.get_lines() probably could be
> > improved to do a better job than at present, but never a perfect one.
>
>One approach is to make every artist provide a get window extent which
>returns a bounding box. There is the issue of how to get the renderer
>before draw time, but we could fix this. It would be nice for draw
>time layout algorithms to be able to assume this method, and a few
>objects already provide it, eg text.
>
> > This is an example of a more widespread problem that we have thought
> > about and discussed (including some good ideas from John, of course),
> > but solving it is not simple. For the time being, at least, we are
> > stuck with some imperfections.
> >
> > In any case, thanks for bringing the legend/LineCollection bug to my
> > attention. This is the sort of thing it is nice to get cleaned up
> > before the next release, coming soon. Do you know of some other simple
> > bugs like this we should look at ASAP?
>
>
>I added unit/legend_unit.py script to create legends using a scatter
>and vlines, which create RegPolyCollections and LineCollections. We
>should use more stuff like this in general, unit scripts which
>exercise the more arcane usages.
>
>JDH
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys-and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Iyer <mas...@ya...> - 2007年04月10日 17:23:51
It is not what I need..
http://matplotlib.sourceforge.net/matplotlib.axes.html
The plot method (plot(self, *args, **kwargs)) accepts
only x,y pairs, in ax.plot(ind*dt, y) -- the x
parameter is ind*dt - the sample times, but the data
between the sample points is lost. IMHO, the likely
way to prevent loss of sampled data points is changing
the ticks, isn't that possible to change the ticks,
while keeping the data as it is -- plotted as if it
were for a number of data points.
-iyer
--- John Hunter <jd...@gm...> wrote:
> On 4/10/07, John Hunter <jd...@gm...> wrote:
> > On 4/10/07, Iyer <mas...@ya...> wrote:
> > > I apologize if I haven't been sufficiently
> clear.
> > >
> > > While your suggestion picks out the samples from
> the
> > > sample set, and discards other samples - what I
> was
> > > looking at --
> 
> My suggestion does not "discard other samples", so
> you may not be
> understanding what I am saying. Perhaps you can try
> the suggested
> code and see if it does what you want. My example
> plots all the
> samples; it simply scales the xaxis to represent
> time and not sample
> number.
> 
 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/
From: <jk...@ik...> - 2007年04月10日 16:03:40
David Fokkema <dfo...@il...> writes:
> I can't think of an application where you have bins of different
> widths and you want to center the values...
Actually, now that I think about it, there is not enough information
in the bin centers to know the widths of the bins if they may vary.
For example, if your bin edges are (2, 4, 8, 16, 32) or (1, 5, 7, 17,
31), you get the same bin centers (3, 6, 12, 24). Perhaps it's best to
disallow variable-width bins when align='center'.
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: John H. <jd...@gm...> - 2007年04月10日 15:43:39
On 4/10/07, John Hunter <jd...@gm...> wrote:
> On 4/10/07, Iyer <mas...@ya...> wrote:
> > I apologize if I haven't been sufficiently clear.
> >
> > While your suggestion picks out the samples from the
> > sample set, and discards other samples - what I was
> > looking at --
My suggestion does not "discard other samples", so you may not be
understanding what I am saying. Perhaps you can try the suggested
code and see if it does what you want. My example plots all the
samples; it simply scales the xaxis to represent time and not sample
number.
From: John H. <jd...@gm...> - 2007年04月10日 15:35:05
On 4/10/07, Iyer <mas...@ya...> wrote:
>
> Wouldn't it make sense to simply change the xticks to
> reflect the time instead of the number of data points
No
> Like, if we needed to display 0 t0 1000 points over a
> period of time, wouldn't it be nice to translate the
> xticks to reflect the period of time ?
No
> Would you suggest using IndexLocator in that sense ?
No
From: Christopher B. <Chr...@no...> - 2007年04月10日 15:26:06
Stephen Uhlhorn wrote:
> I have experimented with every conceivable python/numpy/mpl
> permutation on mac os and I will second Chris Barker's recommendation.
> Use the pythonmac.org packages with the wx backend. Choose whichever
> version of wx and python that is best supported my the mpl version.
> 
> I use mpl v 0.87, wx 2.6. and python 2.4 on my ppc mac.
I think mpl 9.0, python 2.5 and wx 2.6 will work OK too. I'm working 
right now on getting a version that will work well with wxPython2.8 -- 
but I'm not there yet.
-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: Stephen U. <ste...@gm...> - 2007年04月10日 15:22:46
Hello Simon-
I have experimented with every conceivable python/numpy/mpl
permutation on mac os and I will second Chris Barker's recommendation.
Use the pythonmac.org packages with the wx backend. Choose whichever
version of wx and python that is best supported my the mpl version.
I use mpl v 0.87, wx 2.6. and python 2.4 on my ppc mac.
-stephen
On 4/5/07, Christopher Barker <Chr...@no...> wrote:
> Simson Garfinkel wrote:
> > I'm embarrassed to ask that I'm having trouble building/installing
> > matplotlib on an intel Mac.
>
> Don't be embarassed -- it's really pretty hard!
>
> All the various pythons (Universal, fink, darwinports, etc) for OS-X
> confuse things a lot, but I think you'll get the best support if you
> stick with the "official" framework Universal build:
>
> http://www.python.org/download/
>
> You can also get it from:
>
> http://www.pythonmac.org/packages/py25-fat/index.html
>
> The cool thing about that site is that you can get a bunch of pr-built
> compatible packages from there also.
>
> Unfortunately, the matplotlib there right now doesn't appear to work
> with the latest wxPython. I'm not sure which wxPython version it is
> built against, but it crashed for me when used with wxPython2.8.3
>
> The good news is, as I understand it, is the Ken McIvor patched the most
> recent MPL to use wxPython 2.8b features that allow you to build MPL
> without linking to wxPython.
>
> Hopefully someone will do a build that works with wxPython2.8.3 and put
> it up on the pythonmac site soon. I may even do it, but I haven't needed
> to for a while, so I don't have it all set up at this point.
>
> If you're going to built it yourself, still use the pythonmac packages
> for everything else, you'll be glad you did.
>
> -Chris
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
From: Iyer <mas...@ya...> - 2007年04月10日 15:20:52
Wouldn't it make sense to simply change the xticks to
reflect the time instead of the number of data points
?
Like, if we needed to display 0 t0 1000 points over a
period of time, wouldn't it be nice to translate the
xticks to reflect the period of time ?
Would you suggest using IndexLocator in that sense ?
-iyer
> hence is there a good way
> to
> > "translate ticks" ?
> 
> Yes, you can certainly do this, but what we are
> suggesting is that it
> makes more sense to simply scale your data before
> plotting. Is there
> a reason you don't want to do this
> 
> ax.plot(ind*dt, y)
> 
> The index locator
> 
> JDH
> 
 
____________________________________________________________________________________
Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/
From: John H. <jd...@gm...> - 2007年04月10日 15:11:32
On 4/10/07, Iyer <mas...@ya...> wrote:
> I apologize if I haven't been sufficiently clear.
>
> While your suggestion picks out the samples from the
> sample set, and discards other samples - what I was
> looking at --
>
> when I plot a sample set, of say - 1000 points, the
> xticks shows up as 0 to 1000 points on the plot.
>
> I was wondering if there could be a way to translate
> the xtick display to that of seconds, if the sampling
> frequency is 250 Hz, the plot would still display the
> original data set, but with different xticks -- for
> e.g. it would display xticks as 0 to 4 seconds rather
> than 0 to 1000 points.. hence is there a good way to
> "translate ticks" ?
Yes, you can certainly do this, but what we are suggesting is that it
makes more sense to simply scale your data before plotting. Is there
a reason you don't want to do this
 ax.plot(ind*dt, y)
The index locator
JDH
From: Iyer <mas...@ya...> - 2007年04月10日 15:06:59
I apologize if I haven't been sufficiently clear.
While your suggestion picks out the samples from the
sample set, and discards other samples - what I was
looking at --
when I plot a sample set, of say - 1000 points, the
xticks shows up as 0 to 1000 points on the plot.
I was wondering if there could be a way to translate
the xtick display to that of seconds, if the sampling
frequency is 250 Hz, the plot would still display the
original data set, but with different xticks -- for
e.g. it would display xticks as 0 to 4 seconds rather
than 0 to 1000 points.. hence is there a good way to
"translate ticks" ?
-iyer
--- John Hunter <jd...@gm...> wrote:
> On 4/10/07, Iyer <mas...@ya...> wrote:
> > I'd like to avoid the pylab interface...
> > linspace is good.
> 
> from matplotlib.mlab import linspace
> 
> But linspace may not be what you want. Probably
> better:
> 
> In [1]: Fs = 4. # sampling at 4Hz
> 
> In [2]: dt = 1./Fs
> 
> In [3]: import numpy
> 
> In [4]: ind = numpy.arange(1000.) # the sample
> number
> 
> In [5]: t = ind*dt # the sample times
> 
> In [6]: t[0]
> Out[6]: 0.0
> 
> In [7]: t[1]
> Out[7]: 0.25
> 
> 
> linspace gives a slightly different answer, because
> it includes the
> endpoint. Sometimes this is what you want,
> sometimes not.
> 
 
____________________________________________________________________________________
The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
From: John H. <jd...@gm...> - 2007年04月10日 14:48:03
On 4/10/07, Iyer <mas...@ya...> wrote:
> I'd like to avoid the pylab interface...
> linspace is good.
from matplotlib.mlab import linspace
But linspace may not be what you want. Probably better:
In [1]: Fs = 4. # sampling at 4Hz
In [2]: dt = 1./Fs
In [3]: import numpy
In [4]: ind = numpy.arange(1000.) # the sample number
In [5]: t = ind*dt # the sample times
In [6]: t[0]
Out[6]: 0.0
In [7]: t[1]
Out[7]: 0.25
linspace gives a slightly different answer, because it includes the
endpoint. Sometimes this is what you want, sometimes not.
From: David F. <dfo...@il...> - 2007年04月10日 13:51:51
On Tue, 2007年04月10日 at 16:13 +0300, Jouni K. Sepp=C3=A4nen wrote:
> David Fokkema <dfo...@il...> writes:
>=20
> > I fixed the bug, I think. At least it's working on my system and I thin=
k
> > it is not invasive. Comments please? I'll send it upstream otherwise...
>=20
> Does this handle the case where the user has specified bins of
> different widths? It looks like you are only using the width of the
> first bin:
>=20
> > + if align =3D=3D 'center':
> > + hw =3D .5*(bins[1]-bins[0])
> > + nbins =3D [x-hw for x in bins]
> > + else:
> > + nbins =3D bins
I am only using the first width, indeed. If different widths are allowed
(and why not?) some more coding has to be done. On the other hand, I use
align =3D 'center' because I have a detector which samples timing
information at 20 ns intervals. So, when binning timing information, I
only have 0, 20 ns, 40 ns, 60 ns and so forth. Being able to specify
those values as the center of my bin instead of calculating edges myself
(-10, 10, 30, 50, etc.) is very useful. I can't think of an application
where you have bins of different widths and you want to center the
values... Furthermore, when plotting the histogram, the function
calculates the width of the bars only for the first bin and uses that
for all bars. So I think this function is highly unstable when you use
variable sized bins. Matplotlib.mlab.hist only calculates the histogram
and can only use variable sized bins when you want a simple histogram.
Maybe add something to this effect in the docstring?
>=20
> At least, I've always thought that unequal bins are allowed, but from
> the following it seems that the probability density support also makes
> an incompatible assumption:
>=20
> > if normed:
> > - db =3D bins[1]-bins[0]
> > + db =3D nbins[1]-nbins[0]
> > return 1/(len(y)*db)*n, bins
>=20
It does...
David
From: Mark B. <ma...@gm...> - 2007年04月10日 13:46:10
Hello List -
I have been using IDLE with the -n option to run matplotlib interactively.
Now today I decided to install Python 2.4.4, using the win32 installer on
the python webpage.
Normally I use the Enthought edition (which I like a lot), but they haven't
released a new version with numpy 1.0.x yet, so I cannot use that.
OK, so I install Python 2.4.4 and try to edit the IDLE shortcut as usual
(right click and go to properties), but now I cannot anymore edit the
'target' and add the '-n' option!
Why oh why did somebody (at MS?) think it was a good idea to mess with this
so we cannot anymore change this.
Does anybody have a good idea of how to add the '-n' option to the shortcut?
Thanks for any help,
Mark
From: Iyer <mas...@ya...> - 2007年04月10日 13:40:48
Thanx for the response..
I'd like to avoid the pylab interface... 
linspace is good.
assume you have 1000 points of data and you'd like the
ticks to display from 0 to 4, since the 1000 points of
data were sampled at 250 Hz. 
any "non-pylab" ideas ? Indexlocator?
-iyer
--- Antonio Gonzalez <Ant...@ki...> wrote:
> Not sure if I understand, but I think this is what
> you want to do:
> 
> y = rand(1000) # your 1000 random points
> x = linspace(0, 250, y.size)
> plot(x,y)
> 
> /A
> 
> 
> Iyer wrote:
> > I think this is a trivial question..
> > 
> > If there are a set of data points being plotted in
> a
> > subplot, say 0 to 1000 points; the subplot
> displays
> > the ticks as 0 to 1000 points and it is desired to
> > "translate" those points to 0 t0 250 points on the
> > subplot display - with point 0 mapping to point 0,
> > point 250 mapping to point 2 and so on, what could
> be
> > the best way to do this ? 
> > 
> > Just curious,
> > thanks,
> > iyer
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> >
>
____________________________________________________________________________________
> > Never miss an email again!
> > Yahoo! Toolbar alerts you the instant new Mail
> arrives.
> >
> http://tools.search.yahoo.com/toolbar/features/mail/
> > 
> >
>
-------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of
> IT
> > Join SourceForge.net's Techsay panel and you'll
> get the chance to share your
> > opinions on IT & business topics through brief
> surveys-and earn cash
> >
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Matplotlib-users mailing list
> > Mat...@li...
> >
>
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
 
____________________________________________________________________________________
Sucker-punch spam with award-winning protection. 
Try the free Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/features_spam.html
From: <jk...@ik...> - 2007年04月10日 13:37:54
David Fokkema <dfo...@il...> writes:
> I fixed the bug, I think. At least it's working on my system and I think
> it is not invasive. Comments please? I'll send it upstream otherwise...
Does this handle the case where the user has specified bins of
different widths? It looks like you are only using the width of the
first bin:
> + if align == 'center':
> + hw = .5*(bins[1]-bins[0])
> + nbins = [x-hw for x in bins]
> + else:
> + nbins = bins
At least, I've always thought that unequal bins are allowed, but from
the following it seems that the probability density support also makes
an incompatible assumption:
> if normed:
> - db = bins[1]-bins[0]
> + db = nbins[1]-nbins[0]
> return 1/(len(y)*db)*n, bins
-- 
Jouni K. Seppänen
http://www.iki.fi/jks
From: Antonio G. <Ant...@ki...> - 2007年04月10日 13:23:31
Not sure if I understand, but I think this is what you want to do:
y = rand(1000) # your 1000 random points
x = linspace(0, 250, y.size)
plot(x,y)
/A
Iyer wrote:
> I think this is a trivial question..
> 
> If there are a set of data points being plotted in a
> subplot, say 0 to 1000 points; the subplot displays
> the ticks as 0 to 1000 points and it is desired to
> "translate" those points to 0 t0 250 points on the
> subplot display - with point 0 mapping to point 0,
> point 250 mapping to point 2 and so on, what could be
> the best way to do this ? 
> 
> Just curious,
> thanks,
> iyer
> 
> 
> 
> 
> 
> 
> 
> ____________________________________________________________________________________
> Never miss an email again!
> Yahoo! Toolbar alerts you the instant new Mail arrives.
> http://tools.search.yahoo.com/toolbar/features/mail/
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Iyer <mas...@ya...> - 2007年04月10日 13:06:44
I think this is a trivial question..
If there are a set of data points being plotted in a
subplot, say 0 to 1000 points; the subplot displays
the ticks as 0 to 1000 points and it is desired to
"translate" those points to 0 t0 250 points on the
subplot display - with point 0 mapping to point 0,
point 250 mapping to point 2 and so on, what could be
the best way to do this ? 
Just curious,
thanks,
iyer
 
____________________________________________________________________________________
Never miss an email again!
Yahoo! Toolbar alerts you the instant new Mail arrives.
http://tools.search.yahoo.com/toolbar/features/mail/
From: Simon K. <sim...@we...> - 2007年04月10日 11:05:59
John Hunter schrieb:
> On 4/4/07, Simon Kammerer <sim...@we...> wrote:
>> Hi list,
>>
>> I guess it's not limited to the basemap toolkit, but it fits to explain
>> my problem:
>>
>> I'd like to produce time series with basemap. As drawing coastlines,
>> countrys etc. is expensive, but stays the same for every time step, I'd
>> like to draw the basemap "background" only once and the reuse I.
> 
> This can probably be solved with the copy/blit/animate stuff described
> at the end of
> http://www.scipy.org/Cookbook/Matplotlib/Animations
Doesn't work for me, as I don't want to use a GUI but save my plots as 
images.
blit() raises an error:
AttributeError: 'FigureCanvasGTKAgg' object has no attribute '_pixmap'
Probably because the FigureCanvasGTK part of FigureCanvasGTKAgg is not 
initialized?!
I guess I need blit() implemented in FigureCanvasAgg, but to my 
understanding of the animation/blitting stuff, this is probably not how 
 "lowlevel" figurecanvas like FigureCanvasAgg work, as they are vector 
based.
I solved my initial problem with a kind of very simple coastlines-cache 
in the basemap toolkit. I will discuss my changes with Jeff Whitaker, 
maybe they will find their way into basemap eventually...
Simon
From: David F. <dfo...@il...> - 2007年04月10日 09:43:33
On Sun, 2007年04月08日 at 19:25 +0200, David Fokkema wrote:
> On Fri, 2007年04月06日 at 18:32 +0300, Jouni K. Sepp=C3=A4nen wrote:
> > David Fokkema <dfo...@il...> writes:
> >=20
> > > If I choose center, the result is that my histogram is calculated
> > > for edge values but the bars are placed at center values which is
> > > completely misleading and wrong! I'd say this is a bug, but I may be
> > > overlooking something here...
> >=20
> > Looks like a bug to me. Could you file it at
> > http://sf.net/tracker/?group_id=3D80706&atid=3D560720
> > so it isn't forgotten?
>=20
> Well... It couldn't be too hard to fix, I guess... I know python, I
> tracked down the source, I could try and fix it, right? I think I'll
> have the time next Tuesday, so hopefully I'll file a bug report with an
> attached patch, ;-)
I fixed the bug, I think. At least it's working on my system and I think
it is not invasive. Comments please? I'll send it upstream otherwise...
--- matplotlib/axes.py.orig 2007年04月10日 10:58:30.000000000 +0200
+++ matplotlib/axes.py 2007年04月10日 11:14:56.000000000 +0200
@@ -4149,7 +4149,7 @@
 hist bars
 """
 if not self._hold: self.cla()
- n, bins =3D matplotlib.mlab.hist(x, bins, normed)
+ n, bins =3D matplotlib.mlab.hist(x, bins, normed, align)
 if width is None: width =3D 0.9*(bins[1]-bins[0])
 if orientation =3D=3D 'horizontal':
 patches =3D self.barh(bins, n, height=3Dwidth, left=3Dbottom,
align=3Dalign)
--- matplotlib/mlab.py.orig 2007年04月10日 11:16:23.000000000 +0200
+++ matplotlib/mlab.py 2007年04月10日 11:24:48.000000000 +0200
@@ -597,7 +597,7 @@
 #S =3D -1.0*asum(p*log(p))
 return S
=20
-def hist(y, bins=3D10, normed=3D0):
+def hist(y, bins=3D10, normed=3D0, align=3D'edge'):
 """
 Return the histogram of y with bins equally sized bins. If bins
 is an array, use the bins. Return value is
@@ -626,11 +626,16 @@
 dy =3D (ymax-ymin)/bins=20
 bins =3D ymin + dy*arange(bins)
=20
+ if align =3D=3D 'center':
+ hw =3D .5*(bins[1]-bins[0])
+ nbins =3D [x-hw for x in bins]
+ else:
+ nbins =3D bins
=20
- n =3D searchsorted(sort(y), bins)
+ n =3D searchsorted(sort(y), nbins)
 n =3D diff(concatenate([n, [len(y)]]))
 if normed:
- db =3D bins[1]-bins[0]
+ db =3D nbins[1]-nbins[0]
 return 1/(len(y)*db)*n, bins
 else:
 return n, bins
Thanks,
David
From: Grant E. <gr...@vi...> - 2007年04月09日 21:53:05
On 2007年04月09日, Grant Edwards <gr...@vi...> wrote:
> On 2007年04月09日, Lou Pecora <lou...@ya...> wrote:
>
>> I assume you mean the first example, the wire frame (see
>> below). It works for me.
>
> I've tried that code as well, and p.show() doesn't return until
> the window is closed. If I use code like that in a python
> program, the program becomes non-responsive until the plot
> window is closed.
>
> I've switched to using wxmpl to embed figure in a wxWidgets
> panel. That almost works -- except I loose the ability for the
> user to rotate/zoom using the mouse.
I think I'm going to have to switch to using gnuplot for the 3D
window. Matplotlib is just too slow. The 3D window takes about
2 seconds to plot, and whan the user rotates the image, it only
updates at about 1fps. Gnuplot does the plot pretty much
instantaneously and rotates and zooms smoothly, so that's
probably going to be the deciding factor...
-- 
Grant Edwards grante Yow! Is it 1974? What's
 at for SUPPER? Can I spend my
 visi.com COLLEGE FUND in one wild
 afternoon??
From: Ken M. <mc...@ii...> - 2007年04月09日 20:09:12
On Apr 9, 2007, at 1:16 PM, Grant Edwards wrote:
>
> I've switched to using wxmpl to embed figure in a wxWidgets
> panel. That almost works -- except I loose the ability for the
> user to rotate/zoom using the mouse.
I'm afraid that the current version of WxMpl doesn't play nicely with 
matplotlib's event system. I hope to integrate the two event models 
so stuff like 3D rotations work. Unfortunately that probably won't 
be happening for some time yet.
Ken
From: Lou P. <lou...@ya...> - 2007年04月09日 18:51:32
Some answers:
--- Grant Edwards <gr...@vi...> wrote:
> On 2007年04月09日, Lou Pecora <lou...@ya...>
> wrote:
> 
> > I assume you mean the first example, the wire
> frame (see
> > below). It works for me.
> 
> I've tried that code as well, and p.show() doesn't
> return until
> the window is closed. If I use code like that in a
> python
> program, the program becomes non-responsive until
> the plot
> window is closed.
That is how pylab works. The program has to respond
to events in the plot window and cannot respond to the
command line.
> I've switched to using wxmpl to embed figure in a
> wxWidgets
> panel. That almost works -- except I loose the
> ability for the
> user to rotate/zoom using the mouse.
I have not tried this approach very much. I'm sorry,
but I can't think of a way to retain the rotate/zoom. 
Perhaps others can offer help.
> > No problems. When pylab (matplotlib) plots it
> does so in a
> > window associated with a Python process that is
> separate from
> > the terminal (I assume you are using a terminal).
> 
> I'm not sure what you mean by "using a terminal". 
> I'm running
> my python app from the command line in a terminal
> emulator
> window.
Yes, that is what I meant by using a terminal.
-- Lou Pecora, my views are my own.
---------------
"I knew I was going to take the wrong train, so I left early." 
--Yogi Berra
 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091
1 message has been excluded from this view by a project administrator.

Showing results of 318

<< < 1 .. 6 7 8 9 10 .. 13 > >> (Page 8 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 によって変換されたページ (->オリジナル) /