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
|
2
(13) |
3
(5) |
4
(5) |
5
(21) |
6
(10) |
7
(9) |
|
8
(4) |
9
(11) |
10
(9) |
11
(11) |
12
(25) |
13
(5) |
14
(2) |
|
15
(5) |
16
(8) |
17
(16) |
18
(11) |
19
(15) |
20
(5) |
21
(8) |
|
22
(4) |
23
(24) |
24
(9) |
25
(14) |
26
(5) |
27
(28) |
28
(2) |
|
29
(13) |
30
(14) |
31
(11) |
|
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2012-01-27 22:13:20
|
On Fri, Jan 27, 2012 at 10:06 AM, Howard <ho...@re...> wrote: > On 1/27/12 3:39 AM, Ian Thomas wrote: > > On 26 January 2012 19:36, Howard <ho...@re...> wrote: > >> I'm rendering some images with about 3.5 million triangles into a >> 512x512 png file using tricontourf. I'm running this in a virtual machine, >> and I'm pretty sure that there is no graphics rendering hardware being >> used. Is it possible, assuming the hardware was available, to make >> tricontourf use the rendering hardware? Will that happen by default? >> > > You are correct, there is no graphics hardware rendering. Rendering is > controlled by the various matplotlib backends, and to my knowledge there > are no backends currently available that use hardware rendering. > > There has been some work done on an OpenGL backend, but I am not sure of > the status of this. The last time I checked it was pretty experimental. > Perhaps someone involved with it can comment on its current status. > > Ian Thomas > > Ian > > Thanks very much for the reply. If it helps whoever is doing the OpenGL > backend, I may be able to play with it a bit. > > > Howard > > That would be the Glumpy project. http://code.google.com/p/glumpy/ As stated in an email response a while back, glumpy is intended to be a testbed for developing the OpenGL backend for future inclusion into matplotlib. Cheers! Ben Root |
|
From: Benjamin R. <ben...@ou...> - 2012-01-27 21:56:03
|
On Fri, Jan 27, 2012 at 4:54 AM, Jerzy Karczmarczuk < jer...@un...> wrote: > Benjamin Root answers my query concerning user-generated events : > > To answer your question, take a look at how pick_event() is declared > > in backend_bases.py: > > > > def pick_event(self, mouseevent, artist, **kwargs): > > ... > > self.callbacks.process(s, event) > > > > The function that "fires" the event is "self.callbacks.process(s, > > event)", where "self" is the figure canvas. > Dear Ben, thank you, but this is not exactly my problem. I don't want to > call the callback myself, since the event should be "fired" from within > a callback. I should have been more precise. Let's distil the problem. > [This is a part of my current teaching...] I did already what you > suggest here... > > Imagine an animation, which consists in generating a trajectory, segment > after segment (say, of a planet). Classically this is a loop, but when > it runs, the rest of the program is blocked. So, instead, the code > behaves as a Python generator, generates just one segment, and that's > all. But it "yields" something, it posts an event, put it in a queue, > and somebody else, the mainloop() or similar, pops it off the queue and > re-launches the callback. (With generators, it calls the .next()). No > timers, as in Timer or Funct animations... > > It must be "decentralized", no recursive calls. My callback from time to > time creates another planet, or destroys an existent, and there are > simultaneous trajectories on the screen, several concurrent events in > the queue. And the system should remain reactive, interpret buttons, > sliders, etc. > > I know how to do this by hand, how to write my own event loop, declare a > queue, and how to add to my private "virtual" event handling also the > callbacks of mouse events. But this is an overkill, I repeat the > functionalities which are already there, the event queue in particular. > > I did it with wx. But Matplotlib protects the user from the concrete > back-end, and I want to protect my students as well, so I look for a > "GUI-neutral" solution. > > Thanks. > > Jerzy > > Still not sure why my suggestion would not work: http://matplotlib.sourceforge.net/api/cbook_api.html#matplotlib.cbook.CallbackRegistry You can have things set up such that event being triggered can subsequently trigger other events as well. An event can even connect a new event as well. An example where I do this is when I want to hide a line while it is clicked. In the function that I connect to a "button_press_event", I make the artist invisible, and I also create a lambda function that sets the visibility of that artist to True (and subsequently disconnects itself) and connect that lambda to a "button_release_event". Keep in mind that these "events" are merely key'ed by strings like "button_press_event", there is nothing magical about them. So, when you call the .process() function with a string value and an Event object, it passes that object to every connection that was made with that same string value. You can call the process() function from anywhere, even within an event. Now, I haven't tried connecting a generator function with a yield statement before, so I don't know how well that would work, but I don't know why it wouldn't. Why exactly would the callback registry not work for you? Ben Root |
|
From: Jerzy K. <jer...@un...> - 2012-01-27 21:12:31
|
Tony Yu suggests that my multiple and changing animation problems could be solved using coroutining. > have you looked into using a coroutine. /... /I've attached a simple > example below. > > import matplotlib.pyplot as plt > import numpy as np > def datalistener(): > ... > while True: > y0 = yield > x = np.hstack((line.get_xdata(), i)) > ... > plt.ion() > ... Thank you Tony. No, unfortunately this is again a "side solution". Of course, coroutines, or just a simple event loop using Python generators without .send(), are perfectly decent tools to simulate parallel "movements". But, coroutines as such, are better adapted to situations where the actors transfer the control among themselves, where there is a network of direct communications, a "multi-ping-pong". In my case this is redundant, my "planets" which move concurrently are independent, and they, after having updated their properties, need only to yield the control to the interface, to draw them. The interface resumes (by calling, no .send() is needed) all the actors in sequence. I repeat again : I COULD have written my own event loop (under ion()). But I don't want to do this, since show() which calls some lower level mainloop() does all this already! In particular, it handles the physical events, all mousing, which need anyway some lower-level mechanisms, and my own coroutines won't help. I MUST use the built-in tools in order to handle the mouse. So, I repeat, my only [as I see it] rational choice is to plug-in my events into the standard loop. Under, say, plain wxPython, I can write my own, and call ProcessPendingEvents(), but with Matplotlib, no idea. Ben Root suggested to look some existing codes, say the Picker. But this is called upon a physical event, which is "fired" under the hood. My events are "virtual", I have to post them myself from a callback, so it canot call recursively another callback, or I am dead. Best regards. Jerzy |
|
From: Tony Yu <ts...@gm...> - 2012-01-27 21:06:07
|
On Fri, Jan 27, 2012 at 4:01 PM, <jos...@gm...> wrote: > On Fri, Jan 27, 2012 at 12:18 PM, Tony Yu <ts...@gm...> wrote: > > > > > > On Fri, Jan 27, 2012 at 11:27 AM, nahren manuel <mee...@ya...> > > wrote: > >> > >> Hello , > >> I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows > >> themselves hold values of the bins of a distribution (which is not > always > >> normal, can expect a bimodal curve as well) > >> It is little difficult to explain to I actually created a sample figure: > >> > http://www.flickr.com/photos/nahrenmascarenhas/6771369071/in/photostream > >> > >> Any help or trick will be very useful > >> > >> loads of thanks > >> > >> nahren > > > > > > This plot seems similar to something I wanted to do (and asked the list > > about). I ended up getting something to work, but the code is a bit ugly. > > I've attached my most recent version (which probably needs some cleaning > up, > > but it works). > > > > If you want a continuous field instead of distinct bars (like you have in > > your sample image), you may be able to write up something that's a little > > simpler by sectioning out the columns an array into strips of equal width > > and repeating histogram values across those columns (sorry, this is a bit > > vague). Then use `imshow` to plot the array. > > Looks nice. > > Given that it is too specialized for matplotlib, it would be an > interesting addition to violin and bean plots in scikits.statsmodels > if you don't mind that we borrow it (scikits.statsmodels is BSD > licensed). > > Thanks, > > Josef > > Sure thing---I'm happy to contribute. The code probably needs to be cleaned up, but unfortunately, I have little motivation since I don't use it anymore. Feel free to do whatever you like with it. Cheers, -Tony |
|
From: <jos...@gm...> - 2012-01-27 21:02:05
|
On Fri, Jan 27, 2012 at 12:18 PM, Tony Yu <ts...@gm...> wrote: > > > On Fri, Jan 27, 2012 at 11:27 AM, nahren manuel <mee...@ya...> > wrote: >> >> Hello , >> I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows >> themselves hold values of the bins of a distribution (which is not always >> normal, can expect a bimodal curve as well) >> It is little difficult to explain to I actually created a sample figure: >> http://www.flickr.com/photos/nahrenmascarenhas/6771369071/in/photostream >> >> Any help or trick will be very useful >> >> loads of thanks >> >> nahren > > > This plot seems similar to something I wanted to do (and asked the list > about). I ended up getting something to work, but the code is a bit ugly. > I've attached my most recent version (which probably needs some cleaning up, > but it works). > > If you want a continuous field instead of distinct bars (like you have in > your sample image), you may be able to write up something that's a little > simpler by sectioning out the columns an array into strips of equal width > and repeating histogram values across those columns (sorry, this is a bit > vague). Then use `imshow` to plot the array. Looks nice. Given that it is too specialized for matplotlib, it would be an interesting addition to violin and bean plots in scikits.statsmodels if you don't mind that we borrow it (scikits.statsmodels is BSD licensed). Thanks, Josef > > -Tony > > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Tony Yu <ts...@gm...> - 2012-01-27 16:54:34
|
On Fri, Jan 27, 2012 at 5:54 AM, Jerzy Karczmarczuk < jer...@un...> wrote: > Benjamin Root answers my query concerning user-generated events : > > To answer your question, take a look at how pick_event() is declared > > in backend_bases.py: > > > > def pick_event(self, mouseevent, artist, **kwargs): > > ... > > self.callbacks.process(s, event) > > > > The function that "fires" the event is "self.callbacks.process(s, > > event)", where "self" is the figure canvas. > Dear Ben, thank you, but this is not exactly my problem. I don't want to > call the callback myself, since the event should be "fired" from within > a callback. I should have been more precise. Let's distil the problem. > [This is a part of my current teaching...] I did already what you > suggest here... > > Imagine an animation, which consists in generating a trajectory, segment > after segment (say, of a planet). Classically this is a loop, but when > it runs, the rest of the program is blocked. So, instead, the code > behaves as a Python generator, generates just one segment, and that's > all. But it "yields" something, it posts an event, put it in a queue, > and somebody else, the mainloop() or similar, pops it off the queue and > re-launches the callback. (With generators, it calls the .next()). No > timers, as in Timer or Funct animations... > > It must be "decentralized", no recursive calls. My callback from time to > time creates another planet, or destroys an existent, and there are > simultaneous trajectories on the screen, several concurrent events in > the queue. And the system should remain reactive, interpret buttons, > sliders, etc. > > I know how to do this by hand, how to write my own event loop, declare a > queue, and how to add to my private "virtual" event handling also the > callbacks of mouse events. But this is an overkill, I repeat the > functionalities which are already there, the event queue in particular. > > I did it with wx. But Matplotlib protects the user from the concrete > back-end, and I want to protect my students as well, so I look for a > "GUI-neutral" solution. > > Thanks. > > Jerzy > I'm not sure if this matches your use case, but have you looked into using a coroutine. (I only recently learned about them---see presentation slides linked on this page <http://www.dabeaz.com/coroutines/>. So obviously I'm going out of my way to find a use case :) I've attached a simple example below. -Tony #~~~ import matplotlib.pyplot as plt import numpy as np def datalistener(): fig, ax = plt.subplots() line, = ax.plot(0, 0, 'o-') i = 1 while True: y0 = yield x = np.hstack((line.get_xdata(), i)) y = np.hstack((line.get_ydata(), y0)) line.set_data((x, y)) ax.update_datalim(np.transpose((x, y))) ax.autoscale_view() plt.draw() i += 1 plt.ion() plotdata = datalistener() # initialize the coroutine plotdata.next() while True: y = raw_input('enter data point: ') try: plotdata.send(float(y)) except: break |
|
From: Ethan G. <eth...@gm...> - 2012-01-27 16:53:19
|
On Jan 27, 2012, at 9:11 AM, Fabien Lafont wrote:
> Ive tried:
>
> for i in range(0,NbPts):
> if column1[i] == nan:
> column1[i].remove(nan)
> column2[i].remove(nan)
>
> to remove these points but it doesn't work
>
you are close, I think what you want is:
# assuming column1 and 2 are numpy arrays
import numpy as np
for i in range(0,NbPts):
if np.isnan(column1[i]):
column1=np.remove(column1,i,0)
column1=np.remove(column2,i,0)
>
> 2012/1/27 Benjamin Root <ben...@ou...>:
>> On Fri, Jan 27, 2012 at 9:52 AM, Fabien Lafont <laf...@gm...>
>> wrote:
>>>
>>> Sorry, It's an awkward manipulation. I finish the mail
>>>
>>> 2012/1/27 Fabien Lafont <laf...@gm...>:
>>>> I want to plot something like:
>>>>
>>>>
>>>> X(time) Ypoints
>>>> 0 8
>>>> 1
>>>> 2 7
>>>> 3 6
>>>> 4 4
>>>> 5
>>>> 6
>>>> 7 7
>>>> 8 2
>>>> 9 10
>>>
>>> In fact I've recorded some live datas and when I use genfromtxt() the
>>> blank parts are "translated" as 'nan' and I can't for example fit it
>>> with polynomials.
>>>
>>
>> If you plot the data, it should skip data points that are NaNs and you
>> should see a break in the line IIRC. Is that not what you want?
>>
>> Ben Root
>>
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Fabien L. <laf...@gm...> - 2012-01-27 16:41:29
|
Thanks a lot, I'll try to remove the points using isnan() 2012/1/27 Fabrice Silva <si...@lm...>: > What about masked arrays ? > http://docs.scipy.org/doc/numpy/reference/maskedarray.html > > > -- > Fabrice Silva > > > ------------------------------------------------------------------------------ > Try before you buy = See our experts in action! > The most comprehensive online learning library for Microsoft developers > is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3, > Metro Style Apps, more. Free future releases when you subscribe now! > http://p.sf.net/sfu/learndevnow-dev2 > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: nahren m. <mee...@ya...> - 2012-01-27 16:27:12
|
Hello , I have a two dimensional array, 40X20(rowsXcolumns). Each of the 40 rows themselves hold values of the bins of a distribution (which is not always normal, can expect a bimodal curve as well) It is little difficult to explain to I actually created a sample figure: http://www.flickr.com/photos/nahrenmascarenhas/6771369071/in/photostream Any help or trick will be very useful loads of thanks nahren |
|
From: Fabrice S. <si...@lm...> - 2012-01-27 16:24:43
|
What about masked arrays ? http://docs.scipy.org/doc/numpy/reference/maskedarray.html -- Fabrice Silva |
|
From: Benjamin R. <ben...@ou...> - 2012-01-27 16:17:18
|
On Fri, Jan 27, 2012 at 10:11 AM, Fabien Lafont <laf...@gm...>wrote: > Yes in fact it plot it well, but then I have a vector like: > [3702.1399999999999, nan, nan, nan, 3703.79, nan, nan, nan, > 3704.6900000000001, 3704.8400000000001] > and it's impossible to fit it. It return 'nan'. > > Ive tried: > > for i in range(0,NbPts): > if column1[i] == nan: > column1[i].remove(nan) > column2[i].remove(nan) > > to remove these points but it doesn't work > > You can't do equality tests with NaNs (us np.isnan(), instead). This question is more suited for the Numpy list. Ben Root |
|
From: Jérôme <je...@jo...> - 2012-01-27 16:17:12
|
Fri, 27 Jan 2012 16:48:25 +0100 Fabien Lafont a écrit: > I want to plot something like: > > > X(time) Ypoints > 0 8 > 1 > 2 7 > 3 > 4 > 5 > 6 > 7 > 8 > 9 Sorry if I'm missing something, but can't you plot Y [8,7] against X [0,2] ? -- Jérôme |
|
From: nahren m. <mee...@ya...> - 2012-01-27 16:13:06
|
Dear Users, I want to plot a XY, the X-value is constant, but let assume Y varees from 1-10, so I want o have different colors accordingly for the range 0-2,2-4,4-6,6-8,8-10. thanks a lot najren |
|
From: Fabien L. <laf...@gm...> - 2012-01-27 16:11:20
|
Yes in fact it plot it well, but then I have a vector like:
[3702.1399999999999, nan, nan, nan, 3703.79, nan, nan, nan,
3704.6900000000001, 3704.8400000000001]
and it's impossible to fit it. It return 'nan'.
Ive tried:
for i in range(0,NbPts):
if column1[i] == nan:
column1[i].remove(nan)
column2[i].remove(nan)
to remove these points but it doesn't work
2012/1/27 Benjamin Root <ben...@ou...>:
> On Fri, Jan 27, 2012 at 9:52 AM, Fabien Lafont <laf...@gm...>
> wrote:
>>
>> Sorry, It's an awkward manipulation. I finish the mail
>>
>> 2012/1/27 Fabien Lafont <laf...@gm...>:
>> > I want to plot something like:
>> >
>> >
>> > X(time) Ypoints
>> > 0 8
>> > 1
>> > 2 7
>> > 3 6
>> > 4 4
>> > 5
>> > 6
>> > 7 7
>> > 8 2
>> > 9 10
>>
>> In fact I've recorded some live datas and when I use genfromtxt() the
>> blank parts are "translated" as 'nan' and I can't for example fit it
>> with polynomials.
>>
>
> If you plot the data, it should skip data points that are NaNs and you
> should see a break in the line IIRC. Is that not what you want?
>
> Ben Root
>
|
|
From: Howard <ho...@re...> - 2012-01-27 16:06:30
|
On 1/27/12 3:39 AM, Ian Thomas wrote: > On 26 January 2012 19:36, Howard <ho...@re... > <mailto:ho...@re...>> wrote: > > I'm rendering some images with about 3.5 million triangles into a > 512x512 png file using tricontourf. I'm running this in a virtual > machine, and I'm pretty sure that there is no graphics rendering > hardware being used. Is it possible, assuming the hardware was > available, to make tricontourf use the rendering hardware? Will > that happen by default? > > > You are correct, there is no graphics hardware rendering. Rendering > is controlled by the various matplotlib backends, and to my knowledge > there are no backends currently available that use hardware rendering. > > There has been some work done on an OpenGL backend, but I am not sure > of the status of this. The last time I checked it was pretty > experimental. Perhaps someone involved with it can comment on its > current status. > > Ian Thomas Ian Thanks very much for the reply. If it helps whoever is doing the OpenGL backend, I may be able to play with it a bit. Howard -- Howard Lander <mailto:ho...@re...> Senior Research Software Developer Renaissance Computing Institute (RENCI) <http://www.renci.org> The University of North Carolina at Chapel Hill Duke University North Carolina State University 100 Europa Drive Suite 540 Chapel Hill, NC 27517 919-445-9651 |
|
From: Benjamin R. <ben...@ou...> - 2012-01-27 16:03:52
|
On Fri, Jan 27, 2012 at 9:52 AM, Fabien Lafont <laf...@gm...>wrote: > Sorry, It's an awkward manipulation. I finish the mail > > 2012/1/27 Fabien Lafont <laf...@gm...>: > > I want to plot something like: > > > > > > X(time) Ypoints > > 0 8 > > 1 > > 2 7 > > 3 6 > > 4 4 > > 5 > > 6 > > 7 7 > > 8 2 > > 9 10 > > In fact I've recorded some live datas and when I use genfromtxt() the > blank parts are "translated" as 'nan' and I can't for example fit it > with polynomials. > > If you plot the data, it should skip data points that are NaNs and you should see a break in the line IIRC. Is that not what you want? Ben Root |
|
From: Fabien L. <laf...@gm...> - 2012-01-27 15:52:45
|
Sorry, It's an awkward manipulation. I finish the mail 2012/1/27 Fabien Lafont <laf...@gm...>: > I want to plot something like: > > > X(time) Ypoints > 0 8 > 1 > 2 7 > 3 6 > 4 4 > 5 > 6 > 7 7 > 8 2 > 9 10 In fact I've recorded some live datas and when I use genfromtxt() the blank parts are "translated" as 'nan' and I can't for example fit it with polynomials. |
|
From: Fabien L. <laf...@gm...> - 2012-01-27 15:48:34
|
I want to plot something like: X(time) Ypoints 0 8 1 2 7 3 4 5 6 7 8 9 |
|
From: Benjamin R. <ben...@ou...> - 2012-01-27 15:00:14
|
On Friday, January 27, 2012, Eric Emsellem <eem...@es...> wrote: > Dear all, > > I have a set of Voronoi bins, defined by nodes (x,y) and an underlying > mesh of squared bins. > See an example here of such Voronoi bins. > > http://www.google.fr/imgres?q=voronoi+binning&hl=fr&sa=X&biw=1280&bih=665&tbm=isch&prmd=imvnsb&tbnid=zp0RRIktKlF9pM:&imgrefurl=http://www.aanda.org/articles/aa/full/2007/09/aa4621-05/aa4621-05.right.html&docid=CeAk6FN_pZDa5M&imgurl=http://www.aanda.org/articles/aa/full/2007/09/aa4621-05/img26.gif&w=532&h=1087&ei=ZmYiT-Z7xYDyA9ew0acM&zoom=1&iact=rc&dur=164&sig=112304340793152029504&page=4&tbnh=151&tbnw=74&start=63&ndsp=25&ved=1t:429,r:1,s:63&tx=58&ty=65 > > So basically each node, (x,y) would define a Voronoi bin made of a set > of squared pixels. So one node would correspond to for example N squared > pixels: > > node[i] = [(x1,y1),(x2,y2),...(xN,yN)] > > I want now to create an imshow like plot of these bins by using the four > colour theorem, meaning that I would use 4 colours and want adjacent > Voronoi bins not to have the same colour. > > Is there a simple way to do this in matplotlib? I couldn't find much on > the web so far. > > thanks! > Eric > None that I am aware of, but if one existed, it would likely be found within the basemap module. If it isn't in the Basemap module, it would be an awesome feature to add. Maybe something that would work with my style-cycling mechanism that I have been tinkering with to allow for users to specify 4 different hatchings for b&w publications? Cheers! Ben Root |
|
From: Tony Yu <ts...@gm...> - 2012-01-27 14:30:02
|
On Fri, Jan 27, 2012 at 9:13 AM, Pål Gunnar Ellingsen <pa...@gm...>wrote:
> Hi
>
> I have a array, M, which is (4Nx4M), and an array (image), im, which is
> NxM.
> I can currently plot the matrix as a 2d image using imshow using:
>
> import matplotlib.pyplot as plt
> from matplotlib import cm
>
> # some code for reading in the matrix
>
> cmap = cm.get_cmap('jet', 256)
> imM = plt.imshow(M, cmap=cmap, vmin= -1, vmax=1)
>
> But now i would like to plot im on top of M, such that it covers the firs
> element of M.
> If I do
>
> plt.hold()
> plt.imshow(im)
>
> I only see im, and not M. I'm used to doing this in Matlab, where this
> would work.
>
> Can anyone explain me what I'm doing wrong?
>
>
> Kind Regards
>
A call to `plt.autoscale` should fix your problem. It looks like `imshow`
rescales the axes limits to the current image limits, instead of the limits
for all the data in the axes. (Executable example below; note, axes "hold"
by default, so it's not necessary to call hold).
-Tony
import numpy as np
import matplotlib.pyplot as plt
background = np.random.uniform(0, 255, size=(20, 20))
overlay = np.arange(25).reshape((5, 5))
plt.imshow(background, interpolation='nearest', cmap=plt.cm.gray)
plt.imshow(overlay, cmap=plt.cm.jet, alpha=0.5)
# You could also replace this with `plt.axis([0, 20, 0, 20])
plt.autoscale()
plt.show()
|
|
From: Pål G. E. <pa...@gm...> - 2012-01-27 14:13:46
|
Hi
I have a array, M, which is (4Nx4M), and an array (image), im, which is NxM.
I can currently plot the matrix as a 2d image using imshow using:
import matplotlib.pyplot as plt
from matplotlib import cm
# some code for reading in the matrix
cmap = cm.get_cmap('jet', 256)
imM = plt.imshow(M, cmap=cmap, vmin= -1, vmax=1)
But now i would like to plot im on top of M, such that it covers the firs
element of M.
If I do
plt.hold()
plt.imshow(im)
I only see im, and not M. I'm used to doing this in Matlab, where this
would work.
Can anyone explain me what I'm doing wrong?
Kind Regards
|
|
From: Jerzy K. <jer...@un...> - 2012-01-27 10:54:43
|
Benjamin Root answers my query concerning user-generated events : > To answer your question, take a look at how pick_event() is declared > in backend_bases.py: > > def pick_event(self, mouseevent, artist, **kwargs): > ... > self.callbacks.process(s, event) > > The function that "fires" the event is "self.callbacks.process(s, > event)", where "self" is the figure canvas. Dear Ben, thank you, but this is not exactly my problem. I don't want to call the callback myself, since the event should be "fired" from within a callback. I should have been more precise. Let's distil the problem. [This is a part of my current teaching...] I did already what you suggest here... Imagine an animation, which consists in generating a trajectory, segment after segment (say, of a planet). Classically this is a loop, but when it runs, the rest of the program is blocked. So, instead, the code behaves as a Python generator, generates just one segment, and that's all. But it "yields" something, it posts an event, put it in a queue, and somebody else, the mainloop() or similar, pops it off the queue and re-launches the callback. (With generators, it calls the .next()). No timers, as in Timer or Funct animations... It must be "decentralized", no recursive calls. My callback from time to time creates another planet, or destroys an existent, and there are simultaneous trajectories on the screen, several concurrent events in the queue. And the system should remain reactive, interpret buttons, sliders, etc. I know how to do this by hand, how to write my own event loop, declare a queue, and how to add to my private "virtual" event handling also the callbacks of mouse events. But this is an overkill, I repeat the functionalities which are already there, the event queue in particular. I did it with wx. But Matplotlib protects the user from the concrete back-end, and I want to protect my students as well, so I look for a "GUI-neutral" solution. Thanks. Jerzy |
|
From: Eric E. <eem...@es...> - 2012-01-27 09:27:16
|
Dear all, I have a set of Voronoi bins, defined by nodes (x,y) and an underlying mesh of squared bins. See an example here of such Voronoi bins. http://www.google.fr/imgres?q=voronoi+binning&hl=fr&sa=X&biw=1280&bih=665&tbm=isch&prmd=imvnsb&tbnid=zp0RRIktKlF9pM:&imgrefurl=http://www.aanda.org/articles/aa/full/2007/09/aa4621-05/aa4621-05.right.html&docid=CeAk6FN_pZDa5M&imgurl=http://www.aanda.org/articles/aa/full/2007/09/aa4621-05/img26.gif&w=532&h=1087&ei=ZmYiT-Z7xYDyA9ew0acM&zoom=1&iact=rc&dur=164&sig=112304340793152029504&page=4&tbnh=151&tbnw=74&start=63&ndsp=25&ved=1t:429,r:1,s:63&tx=58&ty=65 So basically each node, (x,y) would define a Voronoi bin made of a set of squared pixels. So one node would correspond to for example N squared pixels: node[i] = [(x1,y1),(x2,y2),...(xN,yN)] I want now to create an imshow like plot of these bins by using the four colour theorem, meaning that I would use 4 colours and want adjacent Voronoi bins not to have the same colour. Is there a simple way to do this in matplotlib? I couldn't find much on the web so far. thanks! Eric |
|
From: Ian T. <ian...@gm...> - 2012-01-27 08:39:47
|
On 26 January 2012 19:36, Howard <ho...@re...> wrote: > I'm rendering some images with about 3.5 million triangles into a 512x512 > png file using tricontourf. I'm running this in a virtual machine, and I'm > pretty sure that there is no graphics rendering hardware being used. Is it > possible, assuming the hardware was available, to make tricontourf use the > rendering hardware? Will that happen by default? > You are correct, there is no graphics hardware rendering. Rendering is controlled by the various matplotlib backends, and to my knowledge there are no backends currently available that use hardware rendering. There has been some work done on an OpenGL backend, but I am not sure of the status of this. The last time I checked it was pretty experimental. Perhaps someone involved with it can comment on its current status. Ian Thomas |
|
From: Paul I. <piv...@gm...> - 2012-01-27 02:44:03
|
Hi Shankar, Shankararaman Ramakrishnan, on 2012-01-26 18:24, wrote: > I have been trying to leverage plot_date() to generate time trends. I > seem to run into the following runtime error and don't have much > insight as to why this is happening. Specifically, I don't quite see why > the function is attempting to set the lower bound to 0001-01-01 UTC when > my x-axis starts only from day number 729390. I suspect this may be the case because you've already plotted something on this axis that resolves to this early date. For example, I can reproduce an error similar to yours by first doing plot(1,0) before the plot_date call. Can you try to create a new figure just before the call to plot_date? best, -- Paul Ivanov 314 address only used for lists, off-list direct email at: http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7 |