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
|
|
From: Eugeni D. <dol...@rs...> - 2004-04-09 08:25:36
|
----- Original Message -----
From: "Perry Greenfield" <pe...@st...>
To: "John Hunter" <jdh...@ni...>; "Randy Heiland"
<he...@in...>
Cc: <mat...@li...>
Sent: Thursday, April 08, 2004 10:47 PM
Subject: RE: [Matplotlib-users] writing binary array to file
> John Hunter wrote:
> > Best is to use the binary string operations tostring and fromstring
> >
> > from Numeric import fromstring, Float
> > # write
> > file('fname.out', 'wb').write(x.tostring())
> >
> > # read
> > x = fromstring(file('fname.out', 'rb').read(), Float)
> >
> > #If data is MxN you'll need to reshape
> > x.shape = M,N
> >
> > Hope this help,
> > JDH
> >
>
> Note that numarray has a tofile method and a fromfile function
> to do this without going through the copying required by tostring
> and fromstring. Like those, it also doesn't save any shape or
Moreover tostring() and fromstring() are deprecated iirc, because you can
convert arrays from and to strings by StringIO.
> type info in the file.
>
> Perry
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Randy H. <he...@in...> - 2004-04-08 19:04:59
|
Thanks much John & Perry! Part of my confusion was the fact that I'm
using numarray on my laptop/Windows and Numeric on Linux... and I was in
a hurry... and general ignorance. Anyway, thanks again.
Randy
> -----Original Message-----
> From: Perry Greenfield [mailto:pe...@st...]
> Sent: Thursday, April 08, 2004 1:48 PM
> To: John Hunter; Randy Heiland
> Cc: mat...@li...
> Subject: RE: [Matplotlib-users] writing binary array to file
>
> John Hunter wrote:
> > Best is to use the binary string operations tostring and fromstring
> >
> > from Numeric import fromstring, Float
> > # write
> > file('fname.out', 'wb').write(x.tostring())
> >
> > # read
> > x = fromstring(file('fname.out', 'rb').read(), Float)
> >
> > #If data is MxN you'll need to reshape
> > x.shape = M,N
> >
> > Hope this help,
> > JDH
> >
>
> Note that numarray has a tofile method and a fromfile function
> to do this without going through the copying required by tostring
> and fromstring. Like those, it also doesn't save any shape or
> type info in the file.
>
> Perry
>
|
|
From: John H. <jdh...@ac...> - 2004-04-08 18:50:24
|
>>>>> "Greg" == Greg Whittier <gr...@th...> writes:
Greg> but currently there doesn't seem to be a way to discern
Greg> whether the current xaxis.viewlim was manually set or is the
Greg> result of autoscale. Should this be a feature (set_xlim
Greg> "sticks")? Does Axis need an autoscale attribute to enable
Greg> this?
OK, just added this to CVS. Thanks for the suggestion. Until the
next release, you can just put the xlim set after the plot commands.
Greg> This is version 0.52 (which btw has matplotlib.version set
Greg> to '0.51').
Fixed - thanks,
JDH
|
|
From: Perry G. <pe...@st...> - 2004-04-08 18:47:53
|
John Hunter wrote:
> Best is to use the binary string operations tostring and fromstring
>
> from Numeric import fromstring, Float
> # write
> file('fname.out', 'wb').write(x.tostring())
>
> # read
> x = fromstring(file('fname.out', 'rb').read(), Float)
>
> #If data is MxN you'll need to reshape
> x.shape = M,N
>
> Hope this help,
> JDH
>
Note that numarray has a tofile method and a fromfile function
to do this without going through the copying required by tostring
and fromstring. Like those, it also doesn't save any shape or
type info in the file.
Perry
|
|
From: John H. <jdh...@ac...> - 2004-04-08 18:41:35
|
>>>>> "Randy" == Randy Heiland <he...@in...> writes:
Randy> What's the easiest way to write a Numeric array to a file?
Easiest or best?
In the next release I've added load and save funcs for converting
arrays to and from ascii files. But this is slow and generally lossy.
Best is to use the binary string operations tostring and fromstring
from Numeric import fromstring, Float
# write
file('fname.out', 'wb').write(x.tostring())
# read
x = fromstring(file('fname.out', 'rb').read(), Float)
#If data is MxN you'll need to reshape
x.shape = M,N
Hope this help,
JDH
|
|
From: Randy H. <he...@in...> - 2004-04-08 17:38:49
|
What's the easiest way to write a Numeric array to a file? Thanks! --Randy |
|
From: Greg W. <gr...@th...> - 2004-04-07 23:02:36
|
I'm not sure if this is a bug or a feature, but limits set before plotting aren't kept >>> sp = subplot(111) >>> sp.set_xlim([-5,5]) >>> sp.plot(arange(-10,10),arange(-10,10)) displays from -10 to 9. Axes.plot calls xaxis.autoscale_view() which undoes any previously set limits. I haven't used matlab so I can't say what it does, but I'd expect it to honor them (I think most plotting packages do). I looked to alter Axis.plot to basically say if xaxis.autoscale: xaxis.autoscale_view() but currently there doesn't seem to be a way to discern whether the current xaxis.viewlim was manually set or is the result of autoscale. Should this be a feature (set_xlim "sticks")? Does Axis need an autoscale attribute to enable this? This is version 0.52 (which btw has matplotlib.version set to '0.51'). Thanks, Greg |
|
From: Flavio C. C. <fcc...@ci...> - 2004-04-07 16:59:03
|
You've got to do this: >>> from Numeric import * >>> a=3Darray([1,2]) >>> b=3Darray([2,3]) >>> a+b array([3, 5]) easy isn't it? cheers, Fl=E1vio On Wed, 2004-04-07 at 16:49, Randy Heiland wrote: > Apologies for this simplistic question - how can I add 2 arrays > elm-wise, i.e, > a=3D[1,2] > b=3D[2,3] > a+b =3D [3,5] >=20 > --Randy >=20 >=20 >=20 > ------------------------------------------------------- > This SF.Net email is sponsored by: IBM Linux Tutorials > Free Linux tutorial presented by Daniel Robbins, President and CEO of > GenToo technologies. Learn everything from fundamentals to system > administration.http://ads.osdn.com/?ad_id=3D1470&alloc_id=3D3638&op=3Dcli= ck > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Randy H. <he...@in...> - 2004-04-07 16:49:53
|
Apologies for this simplistic question - how can I add 2 arrays elm-wise, i.e, a=[1,2] b=[2,3] a+b = [3,5] --Randy |
|
From: John N S G. <jn...@eu...> - 2004-04-07 15:19:23
|
> I will - they look nice! If you add more to it, be sure to send me > the updated version. > > John Gill has written a Cell class for his Table class which is > basically a rectangular box with a text instance inside. It might be > nice to generalize that code to allow multiple lines of text to be > added > > cell.add_line(t1) > cell.add_line(t2) > > Cell already handles autosizing of the box to surround the text, and > you wouldn't have to mess with turning off the ticks, etc.... John > might be willing to do this, and it could be wrapped in a nice > interface command textbox. I will take a look at this when i get some time. It might be a week or two though -- i do this stuff commuting on the train, but unfortunately my laptop recently had a hard drive failure, so I'm out of action for a while. Looking forward to getting the latest matplotlib stuff up and running and trying out all this Agg stuff. John |
|
From: John H. <jdh...@ac...> - 2004-04-07 14:54:13
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@ci...> writes:
Flavio> Is this code already in the 0.52 release? if So, I'll take
Flavio> a look at it!
No, it doesn't exist yet; it's just an idea that John Gill may want to
pursue.
Flavio> That would be a nice idea not to move away from standard
Flavio> TeX syntax...
Agreed.
Flavio> Ok, TeX has a whole range of space commands that are
Flavio> import to tweak the layout of math expressions.
Flavio> Does mathtext support formatting multiline strings? waht
Flavio> about TeX's line break command '\\'?
None of the above, but I'll try and get some of them in when the more
pressing concerns (fixing the known layout bugs, porting to PS,
improving the parser to handle nested subscripts) are taken care of.
Flavio> Thanks again John, mathtext is a great piece of software,
Flavio> and a life saver for people like me that need to include
Flavio> math symbols in their software. I wish I could use it on
Flavio> other parts of my GUI such as menus, window titles and
Flavio> etc.
Well, if wx supports drawing to any of these from freetype fonts or
bitmapped rasters, you probably can. I can help you with this if the
basic support is in wx.
JDH
|
|
From: Flavio C. C. <fcc...@ci...> - 2004-04-07 14:26:07
|
Hi John,
On Wed, 2004-04-07 at 13:16, John Hunter wrote:
> >>>>> "Flavio" == Flavio Codeco Coelho <fcc...@ci...> writes:
>
> Hi Flavio,
>
> On an unrelated note, you will be happy to know that wxagg will be
> included in the next release, probably early next week.
That's great news! I really need to include that equation box in my wx
app.
>
> Flavio> \frac and \dfrac would be a nice addition too...
>
> Agreed. And I guess asking for &=& array layout will be coming soon
> :-)
That would be great too!!
> I will - they look nice! If you add more to it, be sure to send me
> the updated version.
I surely will since this was just a simple draft, to see if it worked.
>
> John Gill has written a Cell class for his Table class which is
> basically a rectangular box with a text instance inside. It might be
> nice to generalize that code to allow multiple lines of text to be
> added
>
> cell.add_line(t1)
> cell.add_line(t2)
>
> Cell already handles autosizing of the box to surround the text, and
> you wouldn't have to mess with turning off the ticks, etc.... John
> might be willing to do this, and it could be wrapped in a nice
> interface command textbox.
Is this code already in the 0.52 release? if So, I'll take a look at
it!
>
> Flavio> Flavio """ This script create a box with a series of
> Flavio> equations
>
> Your code revealed one bug unrelated to the sqrt problem you
> described, but you need to make the change below to have your example
> render properly. In mathtext.py, in the function math_parse_s, change
>
> maxoy = max(oys)
>
> to
> maxoy = abs(max(oys))
>
> Now on to your script. A couple of minor comments first
>
> text(1,9,r'$dx/dt = \alpha y^{2}$', fontsize=15)
>
> the brackets for superscripts are not required; eg, the following is
> ok
>
> text(1,9,r'$dx/dt = \alpha y^2$', fontsize=15)
In TeX, the curly brackets are necessary when you want more than one
character in the subscript or subscript. That's why I had them there
since I was, at first tryin to do a more complex example.
>
> Normally math functions like sin, cos, exp are in roman type, so I
> would use
>
> text(1,7,r'$dz/dt = \gamma x^2+\rm{sin}(2\pi y+\phi)$', fontsize=15)
>
>
You are right, thanks.
> As for sqrt, the mathtext syntax differs from TeX. The main reason is
> that I don't draw an overbar with the sqrt symbol group, though this
> is something I can add (probably when I get around to dealing with
> frac, etc, all of which require some additional drawing and layout).
> The point is, you can't use the curly brackets with sqrt or you get a
> (silent) parse error. I'll try and amend the parser to allow the
> group.
That would be a nice idea not to move away from standard TeX syntax...
>
> In the meantime, just do
>
> text(1,5,r'$\phi = zy + \Sqrt\alpha\beta $', fontsize=15)
>
> I noticed there is a small clipping bug with sqrt. There are still
> some hacks in the way I layout the cmex fonts which are discussed in
> the mathtext documentation - the clipping problem likely arises from
> this hack.
>
> Also, note that spaces are respected in font mode, so a hackish way to
> include them is \rm{ }. I've put adding the TeX small space command
> \/ on the (growing at an alarming rate) TODO list. So if you want a
> space after zy, you can do
Ok, TeX has a whole range of space commands that are import to tweak the
layout of math expressions.
Does mathtext support formatting multiline strings? waht about TeX's
line break command '\\'?
>
> text(1,5,r'$\phi = zy\rm{ } + \sqrt\alpha\beta $', fontsize=15)
>
> That's it; here is the modified script that looks great!
Thanks again John, mathtext is a great piece of software, and a life
saver for people like me that need to include math symbols in their
software. I wish I could use it on other parts of my GUI such as menus,
window titles and etc.
>
> from matplotlib.matlab import *
> figure(1, figsize=(5,5), dpi=100)
> subplot(111)
> plot([0])
>
> a=axis([0,10,0,10])
> title('Equation Box')
> set(gca(),'xticklabels',[])
> set(gca(),'yticklabels',[])
> set(gca(),'xticks',[])
> set(gca(),'yticks',[])
>
> text(1,9,r'$dx/dt = \alpha y^2$', fontsize=15)
> text(1,8,r'$dy/dt = \beta x^2$', fontsize=15)
> text(1,7,r'$dz/dt = \gamma x^2+\rm{sin}(2\pi y+\phi)$', fontsize=15)
> text(1,5,r'$\phi = zy\rm{ } + \sqrt\alpha\beta $', fontsize=15)
>
>
> show()
>
|
|
From: John H. <jdh...@ac...> - 2004-04-07 13:39:07
|
>>>>> "Flavio" == Flavio Codeco Coelho <fcc...@ci...> writes:
Hi Flavio,
On an unrelated note, you will be happy to know that wxagg will be
included in the next release, probably early next week. It's
currently in CVS if you want to get started right away. font support
has been thoroughly revised and improved by Paul Barrett, and these
changes are not currently documented, so be don't be surprised if you
get some unexpected font warnings in the CVS version.
Flavio> Hi john , I was doing a pure TeX plot (a bunch of
Flavio> equations inside a box) and I noticed that the
Flavio> \sqrt{}command does not work even though it listed in the
Flavio> help page for mathtext.
Flavio> \frac and \dfrac would be a nice addition too...
Agreed. And I guess asking for &=& array layout will be coming soon
:-)
Flavio> feel free to used this little script as an example of
Flavio> another use of mathtext...
I will - they look nice! If you add more to it, be sure to send me
the updated version.
John Gill has written a Cell class for his Table class which is
basically a rectangular box with a text instance inside. It might be
nice to generalize that code to allow multiple lines of text to be
added
cell.add_line(t1)
cell.add_line(t2)
Cell already handles autosizing of the box to surround the text, and
you wouldn't have to mess with turning off the ticks, etc.... John
might be willing to do this, and it could be wrapped in a nice
interface command textbox.
Flavio> Flavio """ This script create a box with a series of
Flavio> equations
Your code revealed one bug unrelated to the sqrt problem you
described, but you need to make the change below to have your example
render properly. In mathtext.py, in the function math_parse_s, change
maxoy = max(oys)
to
maxoy = abs(max(oys))
Now on to your script. A couple of minor comments first
text(1,9,r'$dx/dt = \alpha y^{2}$', fontsize=15)
the brackets for superscripts are not required; eg, the following is
ok
text(1,9,r'$dx/dt = \alpha y^2$', fontsize=15)
Normally math functions like sin, cos, exp are in roman type, so I
would use
text(1,7,r'$dz/dt = \gamma x^2+\rm{sin}(2\pi y+\phi)$', fontsize=15)
As for sqrt, the mathtext syntax differs from TeX. The main reason is
that I don't draw an overbar with the sqrt symbol group, though this
is something I can add (probably when I get around to dealing with
frac, etc, all of which require some additional drawing and layout).
The point is, you can't use the curly brackets with sqrt or you get a
(silent) parse error. I'll try and amend the parser to allow the
group.
In the meantime, just do
text(1,5,r'$\phi = zy + \Sqrt\alpha\beta $', fontsize=15)
I noticed there is a small clipping bug with sqrt. There are still
some hacks in the way I layout the cmex fonts which are discussed in
the mathtext documentation - the clipping problem likely arises from
this hack.
Also, note that spaces are respected in font mode, so a hackish way to
include them is \rm{ }. I've put adding the TeX small space command
\/ on the (growing at an alarming rate) TODO list. So if you want a
space after zy, you can do
text(1,5,r'$\phi = zy\rm{ } + \sqrt\alpha\beta $', fontsize=15)
That's it; here is the modified script that looks great!
from matplotlib.matlab import *
figure(1, figsize=(5,5), dpi=100)
subplot(111)
plot([0])
a=axis([0,10,0,10])
title('Equation Box')
set(gca(),'xticklabels',[])
set(gca(),'yticklabels',[])
set(gca(),'xticks',[])
set(gca(),'yticks',[])
text(1,9,r'$dx/dt = \alpha y^2$', fontsize=15)
text(1,8,r'$dy/dt = \beta x^2$', fontsize=15)
text(1,7,r'$dz/dt = \gamma x^2+\rm{sin}(2\pi y+\phi)$', fontsize=15)
text(1,5,r'$\phi = zy\rm{ } + \sqrt\alpha\beta $', fontsize=15)
show()
|
|
From: Greg W. <gr...@th...> - 2004-04-07 11:42:26
|
I assume that's a typo and is supposed to be "f(x)=-5 for [15,18]. Is
this what you want?
plot([0,5,5,15,15,18],
[1,1,9, 9,-5,-5])
On Wed, 2004-04-07 at 05:12, Vincent BOYER wrote:
> Hi everybody.
>
> Related to this discussion, here is something else that could be very
> useful for me :
>
> Let's say
>
> t =[0,5,15,18]
> s = [1,9,-5]
>
> I'd like to plot a curve f(x) using s and t in a way that :
> - f(x)=1 for x in [0,5]
> - f(x)=9 for x in [5,15]
> - f(x)=-51 for x in [5,18]
>
> Is there already a simple way to do that using Matplotlib, and if not, would it be possible to add it?
>
> Thanx
> Vincent
>
>
>
> John Hunter wrote:
>
> >>>>>>"Peter" == Peter Groszkowski <pgr...@ge...> writes:
> >>>>>>
> >
> > Peter> Hi everyone: I was wondering whether it is possible to tell
> > Peter> matplotlib how/when to connect data points. Consider this
> > Peter> simple script:
> >
> > Peter> from matplotlib.matlab import * figure(1) t =
> > Peter> [0,1,2,3,4,5,105,106,107] s = [1,4,5,3,9,11,-5,-8,3]
> > Peter> plot(t, s, antialiased=False) grid(True) show()
> >
> >
> > Peter> There are no data points between t=5 and t=105. By default
> > Peter> the points (5,11) and (105,-5) are connected, but I would
> > Peter> like to tell matplotlib NOT to do so. In my case I would
> > Peter> like to pass the plot function a variable telling it what
> > Peter> to do. So for example would have:
> >
> > Peter> plot(t, s, max_delta=40)
> >
> > Peter> This would mean that the points are only to be connected if
> > Peter> the difference between the adjacent t values is less than
> > Peter> 40. In my case this is relevant because sometimes there
> > Peter> are "holes" in my data, and connecting the points makes the
> > Peter> plots look very messy.
> >
> > Peter> Would anyone find something like this useful? Would it be
> > Peter> difficult to implement?
> >
> >Certainly not difficult, and probably useful enough to put in the
> >standard distro. Eg, in a stock market trading example, you would
> >have lots of quotes, minute by minute, punctuated by long intervals
> >overnight where the market is closed. If you set maxdelta
> >appropriately, you could draw connected lines only within trading
> >days.
> >
> >Here is a sample implementation
> >
> >from matplotlib.matlab import *
> >def segplot(x, y, fmt, maxdelta, **kwargs):
> > """
> > Plot x versus y, breaking the plot at any point where x[i] -
> > x[i-1] > maxdelta. kwargs are passed on to plot
> > """
> > x = asarray(x)
> > y = asarray(y)
> > d = diff(x)
> > lines = []
> > ind = nonzero(greater(d, maxdelta))
> > ind = ind+1
> > if not len(ind):
> > lines.extend( plot(x,y,fmt,**kwargs) )
> > else:
> > allind = [0]
> > allind.extend(ind)
> > allind.append(len(x))
> > for i1,i2 in zip(allind[:-1], allind[1:]):
> > lines.extend( plot(x[i1:i2], y[i1:i2], fmt, **kwargs) )
> > return lines
> >
> >t = [0,1,2,3,4,5,105,106,107,187, 200, 212, 300, 320]
> >s = [1,4,5,3,9,11,-5,-8,3,12, 15, 12, -1, 3]
> >segplot(t, s, 'b-o', 40, antialiased=False)
> >grid(True)
> >show()
> >
> >I'm inclined not to make this part of plot, since plot processes a
> >variable number of arguments it makes it a little difficult.
> >Certainly doable, but I'm hesitant to put too much on plot because it
> >might become unwieldy. But a new function, like segment plot, would
> >be easy enough to include.
> >
> >Any suggestions for a name, or additional functionality?
> >
> >JDH
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: IBM Linux Tutorials
> >Free Linux tutorial presented by Daniel Robbins, President and CEO of
> >GenToo technologies. Learn everything from fundamentals to system
> >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> >_______________________________________________
> >Matplotlib-users mailing list
> >Mat...@li...
> >https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >
> >
>
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IBM Linux Tutorials
> Free Linux tutorial presented by Daniel Robbins, President and CEO of
> GenToo technologies. Learn everything from fundamentals to system
> administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
Greg Whittier <gr...@th...>
|
|
From: Vincent B. <bo...@cl...> - 2004-04-07 09:12:17
|
Hi everybody. Related to this discussion, here is something else that could be very useful for me : Let's say t =[0,5,15,18] s = [1,9,-5] I'd like to plot a curve f(x) using s and t in a way that : - f(x)=1 for x in [0,5] - f(x)=9 for x in [5,15] - f(x)=-51 for x in [5,18] Is there already a simple way to do that using Matplotlib, and if not, would it be possible to add it? Thanx Vincent John Hunter wrote: >>>>>>"Peter" == Peter Groszkowski <pgr...@ge...> writes: >>>>>> > > Peter> Hi everyone: I was wondering whether it is possible to tell > Peter> matplotlib how/when to connect data points. Consider this > Peter> simple script: > > Peter> from matplotlib.matlab import * figure(1) t = > Peter> [0,1,2,3,4,5,105,106,107] s = [1,4,5,3,9,11,-5,-8,3] > Peter> plot(t, s, antialiased=False) grid(True) show() > > > Peter> There are no data points between t=5 and t=105. By default > Peter> the points (5,11) and (105,-5) are connected, but I would > Peter> like to tell matplotlib NOT to do so. In my case I would > Peter> like to pass the plot function a variable telling it what > Peter> to do. So for example would have: > > Peter> plot(t, s, max_delta=40) > > Peter> This would mean that the points are only to be connected if > Peter> the difference between the adjacent t values is less than > Peter> 40. In my case this is relevant because sometimes there > Peter> are "holes" in my data, and connecting the points makes the > Peter> plots look very messy. > > Peter> Would anyone find something like this useful? Would it be > Peter> difficult to implement? > >Certainly not difficult, and probably useful enough to put in the >standard distro. Eg, in a stock market trading example, you would >have lots of quotes, minute by minute, punctuated by long intervals >overnight where the market is closed. If you set maxdelta >appropriately, you could draw connected lines only within trading >days. > >Here is a sample implementation > >from matplotlib.matlab import * >def segplot(x, y, fmt, maxdelta, **kwargs): > """ > Plot x versus y, breaking the plot at any point where x[i] - > x[i-1] > maxdelta. kwargs are passed on to plot > """ > x = asarray(x) > y = asarray(y) > d = diff(x) > lines = [] > ind = nonzero(greater(d, maxdelta)) > ind = ind+1 > if not len(ind): > lines.extend( plot(x,y,fmt,**kwargs) ) > else: > allind = [0] > allind.extend(ind) > allind.append(len(x)) > for i1,i2 in zip(allind[:-1], allind[1:]): > lines.extend( plot(x[i1:i2], y[i1:i2], fmt, **kwargs) ) > return lines > >t = [0,1,2,3,4,5,105,106,107,187, 200, 212, 300, 320] >s = [1,4,5,3,9,11,-5,-8,3,12, 15, 12, -1, 3] >segplot(t, s, 'b-o', 40, antialiased=False) >grid(True) >show() > >I'm inclined not to make this part of plot, since plot processes a >variable number of arguments it makes it a little difficult. >Certainly doable, but I'm hesitant to put too much on plot because it >might become unwieldy. But a new function, like segment plot, would >be easy enough to include. > >Any suggestions for a name, or additional functionality? > >JDH > > >------------------------------------------------------- >This SF.Net email is sponsored by: IBM Linux Tutorials >Free Linux tutorial presented by Daniel Robbins, President and CEO of >GenToo technologies. Learn everything from fundamentals to system >administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click >_______________________________________________ >Matplotlib-users mailing list >Mat...@li... >https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
|
From: Gary R. <ga...@em...> - 2004-04-06 23:44:17
|
Additional functionality for segplot could be; instead of providing maxdelta, be able to supply start and stop indices, or perhaps a list of start and stop indices. Another alternative would be to supply x and y ranges which specify to only join the dots when both points are within the range. It might also be worth thinking about factoring out the segment breaking code. Then you could do things like apply regression fit lines to individual segments etc. Gary ----- Original Message ----- > Any suggestions for a name, or additional functionality? > > JDH -- ___________________________________________________________ Sign-up for Ads Free at Mail.com http://promo.mail.com/adsfreejump.htm |
|
From: John H. <jdh...@ac...> - 2004-04-06 19:57:33
|
>>>>> "Peter" == Peter Groszkowski <pgr...@ge...> writes:
Peter> Hi everyone: I was wondering whether it is possible to tell
Peter> matplotlib how/when to connect data points. Consider this
Peter> simple script:
Peter> from matplotlib.matlab import * figure(1) t =
Peter> [0,1,2,3,4,5,105,106,107] s = [1,4,5,3,9,11,-5,-8,3]
Peter> plot(t, s, antialiased=False) grid(True) show()
Peter> There are no data points between t=5 and t=105. By default
Peter> the points (5,11) and (105,-5) are connected, but I would
Peter> like to tell matplotlib NOT to do so. In my case I would
Peter> like to pass the plot function a variable telling it what
Peter> to do. So for example would have:
Peter> plot(t, s, max_delta=40)
Peter> This would mean that the points are only to be connected if
Peter> the difference between the adjacent t values is less than
Peter> 40. In my case this is relevant because sometimes there
Peter> are "holes" in my data, and connecting the points makes the
Peter> plots look very messy.
Peter> Would anyone find something like this useful? Would it be
Peter> difficult to implement?
Certainly not difficult, and probably useful enough to put in the
standard distro. Eg, in a stock market trading example, you would
have lots of quotes, minute by minute, punctuated by long intervals
overnight where the market is closed. If you set maxdelta
appropriately, you could draw connected lines only within trading
days.
Here is a sample implementation
from matplotlib.matlab import *
def segplot(x, y, fmt, maxdelta, **kwargs):
"""
Plot x versus y, breaking the plot at any point where x[i] -
x[i-1] > maxdelta. kwargs are passed on to plot
"""
x = asarray(x)
y = asarray(y)
d = diff(x)
lines = []
ind = nonzero(greater(d, maxdelta))
ind = ind+1
if not len(ind):
lines.extend( plot(x,y,fmt,**kwargs) )
else:
allind = [0]
allind.extend(ind)
allind.append(len(x))
for i1,i2 in zip(allind[:-1], allind[1:]):
lines.extend( plot(x[i1:i2], y[i1:i2], fmt, **kwargs) )
return lines
t = [0,1,2,3,4,5,105,106,107,187, 200, 212, 300, 320]
s = [1,4,5,3,9,11,-5,-8,3,12, 15, 12, -1, 3]
segplot(t, s, 'b-o', 40, antialiased=False)
grid(True)
show()
I'm inclined not to make this part of plot, since plot processes a
variable number of arguments it makes it a little difficult.
Certainly doable, but I'm hesitant to put too much on plot because it
might become unwieldy. But a new function, like segment plot, would
be easy enough to include.
Any suggestions for a name, or additional functionality?
JDH
|
|
From: John H. <jdh...@ac...> - 2004-04-06 16:12:53
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> Many thanks for your reply and suggestions. I see what
Dominique> is happening. Nearest neighbor interpolation has the
Dominique> colors right, but i was trying to get "more
Dominique> interpolation". I guess looking at the great pictures
Dominique> that imshow() produces i was hoping for a result such
Dominique> as that of
Dominique> X = rand(10) pcolor( X ) shading 'interp'
As far as I recall, matlab's pcolor also loses an edge due to
interpolation. Perhaps the main difference is that in matlab, the
axes limits are set by default so that you don't see it. I remember
being surprised by this many moons ago the first time I used pcolor in
matlab.
Dominique> in Matlab. The Matplotlib picture is just as good
Dominique> really, except for the border. Why are the other
Dominique> borders not white as well? Is the interpolation
Dominique> "directional"? Why aren't pixels on the border only
Dominique> interpolated with their neighbors inside the image, and
Dominique> not those outside (these have less neighbors than
Dominique> pixels in the middle)?
I'll have to think about this some more.
There is also something funny about how the tick labeling currently
works for images, because the X[0,0] coord is upper left but is
labeled as 0,10. Perhaps ticks should be off be default, or labeled
with the y axis descending. Those who have opinions please weigh in.
BTW, the developer of agg, Maxim, is fairly responsive, so if you want
to pursue this issue after reading some of the code I point to below
on the agg mailing list
http://lists.sourceforge.net/lists/listinfo/vector-agg-general
Maxim can probably provide some additional guidance.
Dominique> Perhaps you can point me to the part of the code (c++ i
Dominique> assume) which does the interpolation? Should i grab the
Dominique> CVS repository for that? Then maybe i can play around
Dominique> and see if i can achieve the effect i am looking for.
The code is available in the matplotlib src distribution. The module
is src/_image.cpp, which uses agg for image manipulation; see the
function Image_resize. All the agg code is also in the matplotlib src
distro, eg, agg2/include. agg2 doesn't have a lot of documentation -
hence I spend a lot of time reading src files, eg
agg_conv_transform.h
agg_span_image_filter_rgb24.h
agg_span_image_filter_rgba32.h
agg_span_interpolator_linear.h
The latest agg snapshot it http://www.antigrain.com/agg2.tar.gz which
has lots of examples in the examples dir. Agg can do a lot with
images, some of which would be nice to add to the matplotlib
interface....
JDH
|
|
From: Dominique O. <Dom...@po...> - 2004-04-06 15:25:25
|
John Hunter wrote:
>>>>>>"Dominique" == Dominique Orban <Dom...@po...> writes:
>
>
> Dominique> When using imshow(), why does there always seem to be a
> Dominique> blank zone along the southern and eastern edges of the
> Dominique> figure? For instance:
>
> Dominique> X = rand(10,10) imshow(X)
>
> Dominique> plots a luminance image of X, which seems fine, except
> Dominique> for the lower and rightmost edges, which are blank. I
> Dominique> may be misunderstanding the purpose of imshow, but
> Dominique> skimming through the code didn't give me an answer. I
> Dominique> am using matplotlib 0.52 on WinXP with either GTKAgg or
> Dominique> TkAgg.
>
> Hi Dominique,
>
> Your example did point me to a small bug in the image module, but it
> is mostly unrelated to what you are observing. In the axes.py
> function imshow, replace
>
> self.set_image_extent(0, numcols-1, 0, numrows-1)
> with
> self.set_image_extent(0, numcols, 0, numrows)
>
>
> This only affects the tick labeling (not the actual image display)
> but it was wrong before and should be changed.
>
> Now run this script
>
> from matplotlib.matlab import *
> X = rand(10,10)
>
> subplot(211)
> im = imshow(X)
> im.set_interpolation('nearest')
>
> subplot(212)
> im = imshow(X)
> show()
>
> The key thing is that the white border you are seeing arises from
> interpolation. The points on the bottom and right have no neighbors
> in those directions, and so they interpolate to the background color,
> which is white.
>
> You can set the axis limits so that these regions don't appear, or use
> nearest neighbor interpolation.
>
> Let me know if these suggestions don't work for you.
>
> JDH
John,
Many thanks for your reply and suggestions. I see what is happening.
Nearest neighbor interpolation has the colors right, but i was trying to
get "more interpolation". I guess looking at the great pictures that
imshow() produces i was hoping for a result such as that of
X = rand(10)
pcolor( X )
shading 'interp'
in Matlab. The Matplotlib picture is just as good really, except for the
border. Why are the other borders not white as well? Is the
interpolation "directional"? Why aren't pixels on the border only
interpolated with their neighbors inside the image, and not those
outside (these have less neighbors than pixels in the middle)?
Perhaps you can point me to the part of the code (c++ i assume) which
does the interpolation? Should i grab the CVS repository for that? Then
maybe i can play around and see if i can achieve the effect i am looking
for.
Thanks again !
Dominique
|
|
From: John H. <jdh...@ac...> - 2004-04-06 14:53:20
|
>>>>> "Dominique" == Dominique Orban <Dom...@po...> writes:
Dominique> When using imshow(), why does there always seem to be a
Dominique> blank zone along the southern and eastern edges of the
Dominique> figure? For instance:
Dominique> X = rand(10,10) imshow(X)
Dominique> plots a luminance image of X, which seems fine, except
Dominique> for the lower and rightmost edges, which are blank. I
Dominique> may be misunderstanding the purpose of imshow, but
Dominique> skimming through the code didn't give me an answer. I
Dominique> am using matplotlib 0.52 on WinXP with either GTKAgg or
Dominique> TkAgg.
Hi Dominique,
Your example did point me to a small bug in the image module, but it
is mostly unrelated to what you are observing. In the axes.py
function imshow, replace
self.set_image_extent(0, numcols-1, 0, numrows-1)
with
self.set_image_extent(0, numcols, 0, numrows)
This only affects the tick labeling (not the actual image display)
but it was wrong before and should be changed.
Now run this script
from matplotlib.matlab import *
X = rand(10,10)
subplot(211)
im = imshow(X)
im.set_interpolation('nearest')
subplot(212)
im = imshow(X)
show()
The key thing is that the white border you are seeing arises from
interpolation. The points on the bottom and right have no neighbors
in those directions, and so they interpolate to the background color,
which is white.
You can set the axis limits so that these regions don't appear, or use
nearest neighbor interpolation.
Let me know if these suggestions don't work for you.
JDH
|
|
From: Flavio C. C. <fcc...@ci...> - 2004-04-06 00:28:03
|
Hi john ,
I was doing a pure TeX plot (a bunch of equations inside a box) and I
noticed that the \sqrt{}command does not work even though it listed in
the help page for mathtext.
\frac and \dfrac would be a nice addition too...
feel free to used this little script as an example of another use of
mathtext...
Flavio
|
|
From: Peter G. <pgr...@ge...> - 2004-04-05 21:23:28
|
Hi everyone: I was wondering whether it is possible to tell matplotlib how/when to connect data points. Consider this simple script: from matplotlib.matlab import * figure(1) t = [0,1,2,3,4,5,105,106,107] s = [1,4,5,3,9,11,-5,-8,3] plot(t, s, antialiased=False) grid(True) show() There are no data points between t=5 and t=105. By default the points (5,11) and (105,-5) are connected, but I would like to tell matplotlib NOT to do so. In my case I would like to pass the plot function a variable telling it what to do. So for example would have: plot(t, s, max_delta=40) This would mean that the points are only to be connected if the difference between the adjacent t values is less than 40. In my case this is relevant because sometimes there are "holes" in my data, and connecting the points makes the plots look very messy. Would anyone find something like this useful? Would it be difficult to implement? Thanks. Peter |
|
From: John H. <jdh...@ac...> - 2004-04-03 14:09:19
|
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
Humufr> Hello, I have a problem to obtain a good ps file
Humufr> (with mathematical symbol) with matplotlib. That's work
Humufr> very good with a png file but not with a postscript.
Humufr> I tried to define the TTFPATH and AFMPATH but that change
Humufr> nothing. I think that I miss one configuration somewhere
Humufr> but I can't arrive to find what...
Humufr> Thank you for this soft, I just begin to use but it's
Humufr> seems very interesting
I haven't yet added mathtext to the postscript backend, though I will
as soon as I get the time. See the mathtext documentation at
http://matplotlib.sf.net/matplotlib.mathtext.html for the latest
information about mathtext, which backends it works on, etc...
mathtext is designed around the BaKoMa truetype fonts. There are also
postscript versions of these fonts. Paul Barrett has been working on
unifying the interface between AFM (postscript) and truetype fonts,
but we're not there yet. When this is done, it will be easier to
rewrite mathtext to work with either kind of font. Another
possibility is to modify the postscript backend to use postscript
level 3, which supports truetype fonts. This would be very nice
because it would improve compatibility between the postscript, image
and GUI backends.
Another thing that needs to be done is to add image support to the
postscript backend (draw_image). This shouldn't be too hard. The
matplotlib freetype module ft2font has a method to get the font raster
as a bitmap, which could be placed on the PS canvas with draw_image.
This wouldn't be an ideal solution because it's not scalable, but it
would be a fairly easy temporary solution.
Volunteers welcome!
JDH
|
|
From: Humufr <hu...@ya...> - 2004-04-03 02:00:48
|
Hello,
I have a problem to obtain a good ps file (with mathematical symbol)
with matplotlib. That's work very good with a png file but not with a
postscript.
I tried to define the TTFPATH and AFMPATH but that change nothing. I
think that I miss one configuration somewhere but I can't arrive to find
what...
Thank you for this soft, I just begin to use but it's seems very
interesting
Nicolas
|
|
From: Dominique O. <Dom...@po...> - 2004-04-02 23:22:10
|
When using imshow(), why does there always seem to be a blank zone along the southern and eastern edges of the figure? For instance: X = rand(10,10) imshow(X) plots a luminance image of X, which seems fine, except for the lower and rightmost edges, which are blank. I may be misunderstanding the purpose of imshow, but skimming through the code didn't give me an answer. I am using matplotlib 0.52 on WinXP with either GTKAgg or TkAgg. Thanks ! Dominique |