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
(6) |
2
(29) |
3
(19) |
4
(6) |
5
(5) |
|
6
(9) |
7
(9) |
8
(19) |
9
(14) |
10
(19) |
11
(26) |
12
(10) |
|
13
(26) |
14
(22) |
15
(19) |
16
(17) |
17
(16) |
18
(2) |
19
|
|
20
(1) |
21
(1) |
22
(10) |
23
(11) |
24
(17) |
25
(6) |
26
(1) |
|
27
|
28
(9) |
29
(9) |
30
(9) |
|
|
|
|
From: yelena <som...@in...> - 2011-11-02 12:48:36
|
It works! Thank you very much! :) Dale Chayes wrote: > > Attached is a very simple version. > It assumes your sample data is in a file. > > The first line is "magic" and makes significant assumptions about where > python is installed on your system. This may or may not be the right > answer for your system. > > Plotting requires matplotlib which you may need to install. > > > ------------ > #!/sw/bin/python > > import numpy > import matplotlib.pyplot as plt > > dataset = numpy.genfromtxt(fname='readata.txt',skip_header=1) > > print dataset > > x=dataset[:,0] > y=dataset[:,1] > > plt.figure(1) > plt.plot(x,y) > plt.plot(x,y,'ro') > plt.show() > -------------- > > > On Nov 1, 2011, at 9:29 , yelena wrote: > >> >> I have numpy. >> I need the body of a program, which plots y dependence of x. >> >> Maybe than I'll figure out how does it works... >> >> >> Daniel Hyams wrote: >>> >>> One quick way of doing this is to use numpy: >>> >>> import numpy >>> >>> dataset = numpy.genfromtxt(fname='yourfilename',skip_header=1) >>> >>> http://docs.scipy.org/doc/numpy/reference/generated/numpy.genfromtxt.html >>> >>> On Tue, Nov 1, 2011 at 8:50 AM, yelena <som...@in...> wrote: >>>> >>>> Hi! >>>> I'm new at Matplotlib, so I need a little help. >>>> I was trying to load data from txt files with no luck. >>>> I have 2 collumns in txt files and I need to plot a XY graph. Should I >>>> modify txt file to other format? >>>> >>>> Can someone give me a simple example for doing this? >>>> >>>> In txt file could be such information: >>>> Meters Seconds >>>> 1 4 >>>> 2 8 >>>> 3 12 >>>> 4 16 >>>> 5 20 >>>> >>>> Thanks in advance! >>>> >>>> -- >>>> View this message in context: >>>> http://old.nabble.com/Loading-txt-files-tp32758393p32758393.html >>>> Sent from the matplotlib - users mailing list archive at Nabble.com. >>>> >>>> >>>> ------------------------------------------------------------------------------ >>>> RSA® Conference 2012 >>>> Save $700 by Nov 18 >>>> Register now >>>> http://p.sf.net/sfu/rsa-sfdev2dev1 >>>> _______________________________________________ >>>> Matplotlib-users mailing list >>>> Mat...@li... >>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>>> >>> >>> >>> >>> -- >>> Daniel Hyams >>> dh...@gm... >>> >>> ------------------------------------------------------------------------------ >>> RSA® Conference 2012 >>> Save $700 by Nov 18 >>> Register now >>> http://p.sf.net/sfu/rsa-sfdev2dev1 >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> >> >> -- >> View this message in context: >> http://old.nabble.com/Loading-txt-files-tp32758393p32758620.html >> Sent from the matplotlib - users mailing list archive at Nabble.com. >> >> >> ------------------------------------------------------------------------------ >> RSA® Conference 2012 >> Save $700 by Nov 18 >> Register now >> http://p.sf.net/sfu/rsa-sfdev2dev1 >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > RSA® Conference 2012 > Save $700 by Nov 18 > Register now > http://p.sf.net/sfu/rsa-sfdev2dev1 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > -- View this message in context: http://old.nabble.com/Loading-txt-files-tp32758393p32765442.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Benjamin R. <ben...@ou...> - 2011-11-02 05:58:49
|
On Wednesday, November 2, 2011, John Jameson <jw...@gm...> wrote:
> Hi,
> I am trying to do an animation in two axes (subplots) and I can get it to
work so-so if I do it the "wrong way" but when I do it the "right way" I
don't see anything in my second subplot.
> The first subplot (ax1) shows a bunch of moving line segments ("sticks")
and the second one (ax2) shows a low resolution (pixellated) view of the
first subplot. The latter (ax2) uses imshow() but when I update it through
setarray() and blit it onto the canvas it doesn't show up (although the
sticks in the ax1 show up fine). However, if I insert the line
canvas.draw() after the ax2 blit it works but it makes the ax1 animation
very jittery.
> Can someone tell me the correct way to do this? I'm still a tenderfoot
in Matplotlib ;-(
> thanks!
> John
>
>
>
>
>
>
> class Sticks_animator():
>
> x_offset = 0.0
>
> def __init__(self, n_sticks_tot, n_pixels_horizontal=0,
>
> n_pixels_vertical=0 ):
>
> .
> .
> .
> .
> .
>
> def reset(self):
>
> self.background1 = None
>
> self.background2 = None
>
> self.start = 1
>
> def draw_sticks(self):
>
> if self.start:
>
> self.poly = []
>
> for i in range( self.n_sticks_tot):
>
> x_stick = array([ [self.x1[i], self.y1[i]],
>
> [self.x2[i], self.y2[i]] ] )
>
>
>
> self.poly.append( Polygon( x_stick, animated=True,
>
> lw=2, fill=False) )
>
> self.ax1.add_patch(self.poly[i])
>
> self.ax1.draw_artist(self.poly[i])
>
>
>
> else:
>
> for i in range( self.n_sticks_tot):
>
> x_stick = array([ [self.x1[i], self.y1[i]],
>
> [self.x2[i], self.y2[i]] ] )
>
> self.poly[i].set_xy(x_stick)
>
> self.ax1.draw_artist(self.poly[i])
>
> def draw_retina(self):
>
> if self.start:
>
> self.img = self.ax2.imshow(self.inten,
interpolation='nearest')
>
> else:
>
> self.img.set_array(self.inten)
>
>
>
> def step_it(self):
>
> self.inten, self.n_sticks_tot, self.x1, self.y1, \
>
> self.x2, self.y2, done = self.stks.Step_it()
>
>
> # self.stks.Step_it() is finds all the stick coordinates
>
> # and inten is a NXN array of a pixellated (low res) view
>
> # of all the sticks
>
>
>
> if self.background1 is None:
>
> self.background1 = self.canvas.copy_from_bbox(self.ax1.bbox)
>
> self.canvas.restore_region(self.background1)
>
> self.draw_sticks()
>
> self.canvas.blit(self.ax1.bbox)
>
> if self.add_retina_view:
>
> self.draw_retina()
>
> self.canvas.blit(self.ax2.bbox)
>
> # self.canvas.draw() IF I UNCOMMENT THIS IT "WORKS"
>
> self.start = 0
>
>
>
> if done:
>
> gtk.main_quit()
>
> raise SystemExit
>
> return True
>
> def mainer( self, stks ):
>
> self.stks = stks
>
> if isinteractive():
>
> ioff()
>
> def start_anim(event):
>
> gobject.idle_add( self.step_it )
>
> self.canvas.mpl_disconnect(start_anim.cid)
>
>
>
> start_anim.cid = self.canvas.mpl_connect('draw_event', start_anim)
>
> plt.show()
>
Which version of mpl are you using? v1.1.0 comes with an animation module
to handle most of this for you. Check out the animation examples on the
website.
Note, very often, when blitting, the issue can be that the individual
artists were not sett as animated. Note that (counter-intuitively) the new
animation module does not fully work if animate=True, so I'd using
animate.py, don't set animate=True.
Hopefully, that wasn't too confusing...
Ben Root
|
|
From: John J. <jw...@gm...> - 2011-11-02 05:34:43
|
Hi,
I am trying to do an animation in two axes (subplots) and I can get it to
work so-so if I do it the "wrong way" but when I do it the "right way" I
don't see anything in my second subplot.
The first subplot (ax1) shows a bunch of moving line segments ("sticks") and
the second one (ax2) shows a low resolution (pixellated) view of the first
subplot. The latter (ax2) uses imshow() but when I update it through
setarray() and blit it onto the canvas it doesn't show up (although the
sticks in the ax1 show up fine). However, if I insert the line canvas.draw()
after the ax2 blit it works but it makes the ax1 animation very jittery.
Can someone tell me the correct way to do this? I'm still a tenderfoot in
Matplotlib ;-(
thanks!
John
class Sticks_animator():
x_offset = 0.0
def __init__(self, n_sticks_tot, n_pixels_horizontal=0,
n_pixels_vertical=0 ):
.
.
.
.
.
def reset(self):
self.background1 = None
self.background2 = None
self.start = 1
def draw_sticks(self):
if self.start:
self.poly = []
for i in range( self.n_sticks_tot):
x_stick = array([ [self.x1[i], self.y1[i]],
[self.x2[i], self.y2[i]] ] )
self.poly.append( Polygon( x_stick, animated=True,
lw=2, fill=False) )
self.ax1.add_patch(self.poly[i])
self.ax1.draw_artist(self.poly[i])
else:
for i in range( self.n_sticks_tot):
x_stick = array([ [self.x1[i], self.y1[i]],
[self.x2[i], self.y2[i]] ] )
self.poly[i].set_xy(x_stick)
self.ax1.draw_artist(self.poly[i])
def draw_retina(self):
if self.start:
self.img = self.ax2.imshow(self.inten, interpolation='nearest')
else:
self.img.set_array(self.inten)
def step_it(self):
self.inten, self.n_sticks_tot, self.x1, self.y1, \
self.x2, self.y2, done = self.stks.Step_it()
# self.stks.Step_it() is finds all the stick coordinates
# and inten is a NXN array of a pixellated (low res) view
# of all the sticks
if self.background1 is None:
self.background1 = self.canvas.copy_from_bbox(self.ax1.bbox)
self.canvas.restore_region(self.background1)
self.draw_sticks()
self.canvas.blit(self.ax1.bbox)
if self.add_retina_view:
self.draw_retina()
self.canvas.blit(self.ax2.bbox)
# self.canvas.draw() IF I UNCOMMENT THIS IT "WORKS"
self.start = 0
if done:
gtk.main_quit()
raise SystemExit
return True
def mainer( self, stks ):
self.stks = stks
if isinteractive():
ioff()
def start_anim(event):
gobject.idle_add( self.step_it )
self.canvas.mpl_disconnect(start_anim.cid)
start_anim.cid = self.canvas.mpl_connect('draw_event', start_anim)
plt.show()
|