Re: [Matplotlib-users] Smooth animations

2013-07-17 Thread Michael Droettboom
There is nothing available to push points -- matplotlib uses Numpy 
arrays internally for the data, and they can not be (efficiently) 
resized.  I would try implementing this before assuming it's too slow.


Mike

On 07/05/2013 12:02 PM, v0idnull wrote:
Yes, but this is where I am failing. I don't have the code with me 
right now but I can explain it:


I get a new number every 2000 milliseconds, and I want to update the 
graph say, every 50 milliseconds, and keep a minute of history visible 
in the graph.


So that's 30 x-axis ticks.

But if I want to draw this out smoothly, I need 40 more ticks per 
update interval. I have five lines I want to show, so every 50ms, 600 
points need to be plotted out.


Now, my proof of concept code is just working with arrays in a sort of 
FIFO queue, I haven't actually tried to plug those arrays into 
matplotlib, but it seems like replotting 600 points is a lot of work.


Maybe I am over reacting? Or is there some feature of matplotlib that 
allows me to push data onto a plot instead of replotting all points?


I dunno, I'm not confident in my approach. I seek inspiration.

thanks,
--alex

This means that every 50ms, 600 points need to be updated.

On 13-07-04 05:11 PM, Michael Droettboom wrote:
I see -- you want to basically interpolate between points?  I don't 
think there's anything built in to matplotlib to do that, but you 
could always do that interpolation outside and just update the graph 
more often.


Mike

On 07/04/2013 04:28 PM, v0idnull wrote:

eh

Let me explain my problem in a different way:

Every two seconds I get a value from a service. Let's say I over 8 
seconds I get 1, 5, 10, 5 as values.


So if my application updates the graph every two seconds, this will 
look choppy and ugly. This is because every two seconds, an entire 
line is added onto the graph between the two points.


Imagine if I could control the drawing of said line though. If I 
could draw the individual pixels of the line every couple of ticks 
instead of just dumping a line in every two seconds, I will end up 
with a nice smooth animation. It may not be 100% real time anymore, 
but my focus on this personal project of mine is vanity, not 
practicality ;)


I hope this better explains what I am trying to accomplish...

Thanks,
--alex

On 13-07-04 04:09 PM, Michael Droettboom wrote:
Have you looked at the simple_anim.py example -- other than the 
networking piece, it seems to do what you describe, and it's pretty 
fast. Maybe start from that and make changes until it gets slow in 
order to determine where the slowness comes from...?


Mike

On 07/03/2013 09:19 PM, v0idnull wrote:
I am receiving a number from a server every two seconds. I would 
like to plot this number.out over time for the past say... 30 polls.


Would it be possible to use... Anything, to produce a smooth 
animation of the plot line getting drawn? As it stands now the 
animation is well... Quite choppy. ;)


I'm using pygame currently to render my graphs on this full screen 
application I'm making just for my self. I am not bound to it 
though if there are better linux-only things out there.


Thanks in advance,
--alex


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

!DSPAM:51d5d60416102691037314!


___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


!DSPAM:51d5d60416102691037314!




--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev


___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


!DSPAM:51d5e4c116101841011479!


--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

!DSPAM:51d5e4c116101841011479!


___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


!DSPAM:51d5e4c116101841011479!




--
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev

Re: [Matplotlib-users] Graph ticks label missing !

2013-07-17 Thread Michael Droettboom
Can you please provide a completely standalone example?  The following 
code has undefined variables etc.

Mike

On 07/08/2013 10:49 AM, Nicolas Mailhot wrote:
>subplot.set_xticks([dd.monthstart(m) for m in months])
>subplot.set_xticks([w.gmticks() for w in weeks], minor=True)
>subplot.set_xticklabels([])
>plt.xlim(dd.monthstart(min(months)),dd.monthend(max(months)))
>
>subplot1 = subplot.twiny()
>mmonths = [m for i,m in enumerate(months)
>  if operator.mod(i,1+(len(months)-1)/12) == 0]
>subplot1.set_xticks([dd.monthmiddle(m) for m in mmonths])
>subplot1.set_xticklabels(mmonths)
>subplot1.tick_params(labelsize='6.5',labelbottom=True, labeltop=False)
>plt.xlim(dd.monthstart(min(months)),dd.monthend(max(months)))
>
>subplot2 = subplot.twiny()
>mweeks = [w for i,w in enumerate(weeks)
>  if operator.mod(i,1+(len(weeks)-1)/53) == 0]
>subplot2.set_xticks([dd.weekmiddle(w)   for w in mweeks])
>subplot2.set_xticklabels([w.iso_week[1] for w in mweeks])
>subplot2.tick_params(labelsize='5',labelbottom=False, labeltop=True,pad=3)
>plt.xlim(dd.monthstart(min(months)),dd.monthend(max(months)))
>
>subplot2.xaxis.set_ticks_position('none')
>subplot1.xaxis.set_ticks_position('none')
>subplot.xaxis.set_ticks_position('both')


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] [Patch] Patch for fontmanager crash

2013-07-17 Thread Michael Droettboom
This patch doesn't make a whole lot of sense to me.  get_name should 
work just fine if self._family is None, and indeed it does in my own 
testing:

```
from matplotlib import font_manager

f = font_manager.FontProperties(None)
print f._family
print f.get_family()
print f.get_name()
```

So I'd much prefer to get to the bottom of the root cause of this 
problem than patch it unnecessarily in this way.  Any idea what that is?

Mike


On 07/08/2013 10:57 AM, Nicolas Mailhot wrote:
> Hi,
>
> In matplotlib 1.2.1, the  get_name function is not garding against none
> self (unlike other functions); Unfortunately it seems I have a workload
> that makes matplotlib call get_name with None (wasn't the case in 1.2.0).
> I couldn't isolate the exact trigger, when I reduce the volume of data
> processed the problem goes away so I have to simple shareable reproducer.
>
> Anyway, the following patch makes it all work for me, could it (or
> something similar) be merged?
>
> diff -uNr matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py
> matplotlib-1.2.1/lib/matplotlib/font_manager.py
> --- matplotlib-1.2.1.orig/lib/matplotlib/font_manager.py2013-03-26
> 14:04:37.0 +0100
> +++ matplotlib-1.2.1/lib/matplotlib/font_manager.py 2013-07-08
> 14:49:37.791845661 +0200
> @@ -721,6 +721,8 @@
>   Return the name of the font that best matches the font
>   properties.
>   """
> +if self._family is None:
> +  return rcParams['font.family']
>   return ft2font.FT2Font(str(findfont(self))).family_name
>
>   def get_style(self):
>
> Regards,
>


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Install problems, OSX 10.6.8, Python 3.3.1

2013-07-17 Thread Michael Droettboom
Do any Mac experts have any ideas?

One thing that may help us is to fire this up in gdb and get a traceback.

1) Run "gdb python" (or "gdb python3").
2) At the gdb prompt, type "run"
3) At the Python prompt, type "import matplotlib.pyplot"
4) Python should crash, then type "bt" to get a backtrace
5) Post the *complete* backtrace to this list and maybe it will make the 
problem more obvious to us

Mike

On 07/08/2013 12:17 PM, p.maxted wrote:
> Trying to install matplotlib-1.2.1 from source, i.e.,
>
> [macpflm:~/matplotlib-1.2.1] pflm% python3 setup.py install
>
> Everything seems to run ok, but I cannot import macplotlib:
>
> [macpflm:~] pflm% python3
> Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 11:07:11)
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
 import matplotlib.pyplot
> Python(16295) malloc: *** error for object 0x101c86820: pointer being freed
> was not allocated
> *** set a breakpoint in malloc_error_break to debug
> Abort
>
>
>   I tried updating libpng and freetype using macports and re-building, it did
> not solve the problem.
>
> There are some warnings printed during the build, e.g.,
>
> ld: warning: in /opt/local/lib/libfreetype.dylib, file was built for
> unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libz.dylib, file was built for unsupported
> file format which is not the architecture being linked (i386)
> ld: warning: in
> /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libstdc++.dylib, file was built
> for unsupported file format which is not the architecture being linked
> (i386)
>
> ..and..
>
> /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
> warning: #warning "Using deprecated NumPy API, disable it by #defining
> NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
>
> (both warning several times).
>
> Some details from the start of the screen output during the build.
> basedirlist is: ['/usr/local/', '/usr', '/usr/X11', '/opt/local']
> 
> BUILDING MATPLOTLIB
>  matplotlib: 1.2.1
>  python: 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 11:07:11)
>  [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
>platform: darwin
>
> REQUIRED DEPENDENCIES
>   numpy: 1.7.0
>   freetype2: 16.2.10
>
> OPTIONAL BACKEND DEPENDENCIES
>  libpng: 1.5.16
> Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
>Gtk+: no
>  * Building for Gtk+ requires pygtk; you must be able
>  * to "import gtk" in your build/install environment
> Mac OS X native: yes
>  Qt: no
> Qt4: no
>  PySide: no
>   Cairo: no
>
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
>dateutil: matplotlib will provide
>pytz: matplotlib will provide
> six: matplotlib will provide
>
> OPTIONAL USETEX DEPENDENCIES
>  dvipng: 1.5
> ghostscript: 6.01
>   latex: 3.141592
>
> [Edit setup.cfg to suppress the above messages]
> 
>
>   Help!
>
>
>
>
>
> --
> View this message in context: 
> http://matplotlib.1069221.n5.nabble.com/Install-problems-OSX-10-6-8-Python-3-3-1-tp41430.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.
>
> --
> This SF.net email is sponsored by Windows:
>
> Build for Windows Store.
>
> http://p.sf.net/sfu/windows-dev2dev
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cbook.report_memory IOError

2013-07-17 Thread Michael Droettboom
To debug, it might be helpful to try

ps -p PID -o rss,vsz

(where PID is the process id of an interesting process)

and see what happens.

Mike

On 07/17/2013 02:05 AM, Eric Firing wrote:
> On 2013/07/16 5:50 PM, K.-Michael Aye wrote:
>> Hi!
>>
>> I have just run an old code that I believe was working before on OSX.
>> I am trying this with matplotlib 1.2.1 on an OSX EPD running Python 2.7.3
> It works for me with OSX  Mountain Lion and mpl 1.2.1 compiled from
> source.  I don't think this is fundamentally a problem with
> cbook.report_memory.
>
> Eric
>
>>
>> In [1]: from matplotlib.pylab import *
>>
>> In [2]: import matplotlib.cbook as cbook
>>
>> In [3]: data = ones((1500,1500,3))
>>
>> In [4]: imshow(data)
>> Out[4]: 
>>
>> In [5]: ax = gca()
>>
>> In [6]: print cbook.report_memory()
>> ---
>> IOError   Traceback (most recent call last)
>>  in ()
>> > 1 print cbook.report_memory()
>>
>> /Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/cbook.py
>> in report_memory(i)
>>  1210 elif sys.platform.startswith('darwin'):
>>  1211 a2 = Popen('ps -p %d -o rss,vsz' % pid, shell=True,
>> -> 1212stdout=PIPE).stdout.readlines()
>>  1213 mem = int(a2[1].split()[0])
>>  1214 elif sys.platform.startswith('win'):
>>
>> IOError: [Errno 4] Interrupted system call
>>
>> First I thought, maybe this doesn't run in IPython for a reason, but
>> trying it as a script also fails:
>>
>> (general_dev+)[maye@lunatic ~/Dropbox/src/pymars]$ python imshow_test.py
>> Traceback (most recent call last):
>> File "imshow_test.py", line 7, in 
>>   print cbook.report_memory()
>> File
>> "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/cbook.py",
>> line 1212, in report_memory
>>   stdout=PIPE).stdout.readlines()
>> IOError: [Errno 4] Interrupted system call
>>
>>
>> Is this cbook recipe maybe broken?
>>
>> Best,
>> Michael
>>
>>
>>
>>
>> --
>> See everything from the browser to the database with AppDynamics
>> Get end-to-end visibility with application monitoring from AppDynamics
>> Isolate bottlenecks and diagnose root cause in seconds.
>> Start your free trial of AppDynamics Pro today!
>> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
>> ___
>> Matplotlib-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> --
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] cbook.report_memory IOError

2013-07-17 Thread Benjamin Root
I have a vague recollection of a similar problem faced by @dopplershift
when he was updating the animation module to pipe a stream to a
mencoder/ffmpeg process on certain Macs.  Maybe this is the same problem?


On Wed, Jul 17, 2013 at 9:18 AM, Michael Droettboom  wrote:

> To debug, it might be helpful to try
>
> ps -p PID -o rss,vsz
>
> (where PID is the process id of an interesting process)
>
> and see what happens.
>
> Mike
>
> On 07/17/2013 02:05 AM, Eric Firing wrote:
> > On 2013/07/16 5:50 PM, K.-Michael Aye wrote:
> >> Hi!
> >>
> >> I have just run an old code that I believe was working before on OSX.
> >> I am trying this with matplotlib 1.2.1 on an OSX EPD running Python
> 2.7.3
> > It works for me with OSX  Mountain Lion and mpl 1.2.1 compiled from
> > source.  I don't think this is fundamentally a problem with
> > cbook.report_memory.
> >
> > Eric
> >
> >>
> >> In [1]: from matplotlib.pylab import *
> >>
> >> In [2]: import matplotlib.cbook as cbook
> >>
> >> In [3]: data = ones((1500,1500,3))
> >>
> >> In [4]: imshow(data)
> >> Out[4]: 
> >>
> >> In [5]: ax = gca()
> >>
> >> In [6]: print cbook.report_memory()
> >>
> ---
> >> IOError   Traceback (most recent call
> last)
> >>  in ()
> >> > 1 print cbook.report_memory()
> >>
> >>
> /Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/cbook.py
> >> in report_memory(i)
> >>  1210 elif sys.platform.startswith('darwin'):
> >>  1211 a2 = Popen('ps -p %d -o rss,vsz' % pid, shell=True,
> >> -> 1212stdout=PIPE).stdout.readlines()
> >>  1213 mem = int(a2[1].split()[0])
> >>  1214 elif sys.platform.startswith('win'):
> >>
> >> IOError: [Errno 4] Interrupted system call
> >>
> >> First I thought, maybe this doesn't run in IPython for a reason, but
> >> trying it as a script also fails:
> >>
> >> (general_dev+)[maye@lunatic ~/Dropbox/src/pymars]$ python
> imshow_test.py
> >> Traceback (most recent call last):
> >> File "imshow_test.py", line 7, in 
> >>   print cbook.report_memory()
> >> File
> >>
> "/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/cbook.py",
> >> line 1212, in report_memory
> >>   stdout=PIPE).stdout.readlines()
> >> IOError: [Errno 4] Interrupted system call
> >>
> >>
> >> Is this cbook recipe maybe broken?
> >>
> >> Best,
> >> Michael
> >>
> >>
> >>
> >>
> >>
> --
> >> See everything from the browser to the database with AppDynamics
> >> Get end-to-end visibility with application monitoring from AppDynamics
> >> Isolate bottlenecks and diagnose root cause in seconds.
> >> Start your free trial of AppDynamics Pro today!
> >>
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> >> ___
> >> Matplotlib-users mailing list
> >> [email protected]
> >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> >>
> >
> >
> --
> > See everything from the browser to the database with AppDynamics
> > Get end-to-end visibility with application monitoring from AppDynamics
> > Isolate bottlenecks and diagnose root cause in seconds.
> > Start your free trial of AppDynamics Pro today!
> >
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> > ___
> > Matplotlib-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>
>
> --
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] numpy masked array plot - isolated single unmasked value is hidden

2013-07-17 Thread Gregorio Bastardo
Hi,

The following example demonstrates the problem, value 5 could not be
seen w/o marker:

data = np.arange(10)
mask = [0,0,0,1,1,0,1,0,0,0]
x = np.ma.masked_array(data, mask)
plot(x)
plot(x, '+')

In my datasets, isolated unmasked values are rare, but placing a
marker to spot them makes the whole graph cluttered. I do realize that
at least 2 valid points are needed for a line segment, but still, is
there any way to visualize these isolated unmasked values w/o a
marker?

Thanks,
Gregorio

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] timer objects in macosx backend

2013-07-17 Thread Justin Lazear

Hi all,

I'm using a timer object to interact with the MPL event loop on my OS X 
laptop. However, it seems to be missing a few key methods that are 
making using it a little difficult. In particular, I can't find a way to 
stop the timer from sending events:


$ ipython --pylab

   In [1]: def fun():
   ...: for i in range(5):
   ...: print "We're having fun!"; yield
   ...: for i in range(5):
   ...: print "Too much fun..."; yield
   ...: while True:
   ...: print "Stop the fun! No more!"; yield

   In [2]: f = fun().next

   In [3]: fig = plt.figure()

   In [4]: t = fig.canvas.new_timer()

   In [5]: t.add_callback(f)

   In [6]: t.start()

   In [7]: t.stop()

   In [8]: del t  # It's all over now...


It looks like the stop method may never have been implemented:

   In [3]: t.stop??
   Type:   instancemethod
   String Form:
   File: /usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py
   Definition: t.stop(self)
   Source:
def stop(self):
'''
Stop the timer.
'''
self._timer_stop()

   In [4]: t._timer_stop??
   Type:   instancemethod
   String Form:
   File: /usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py
   Definition: t._timer_stop(self)
   Source:
def _timer_stop(self):
pass


I'm able to remove the callback function from the timer's callback list, 
but I suspect that won't stop the events from being triggered. But I'd 
really prefer to completely stop the timer events, since in my 
application I may end up going through many timers.


Is this the expected behavior? Is there an easy fix I'm overlooking?

Version info:

   In [3]: sys.version
   Out[3]: '2.7.3 (default, Feb 19 2013, 18:00:31) \n[GCC 4.2.1
   Compatible Apple LLVM 4.2 (clang-425.0.24)]'

   In [4]: mpl.__version__
   Out[4]: '1.2.0'


Thanks,
Justin
--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] numpy masked array plot - isolated single unmasked value is hidden

2013-07-17 Thread Michael Droettboom
You could use a single pixel for a marker (','), I guess.  But as you 
say, you need at least two points for a line segment.

Mike

On 07/17/2013 10:45 AM, Gregorio Bastardo wrote:
> Hi,
>
> The following example demonstrates the problem, value 5 could not be
> seen w/o marker:
>
> data = np.arange(10)
> mask = [0,0,0,1,1,0,1,0,0,0]
> x = np.ma.masked_array(data, mask)
> plot(x)
> plot(x, '+')
>
> In my datasets, isolated unmasked values are rare, but placing a
> marker to spot them makes the whole graph cluttered. I do realize that
> at least 2 valid points are needed for a line segment, but still, is
> there any way to visualize these isolated unmasked values w/o a
> marker?
>
> Thanks,
> Gregorio
>
> --
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Install problems, OSX 10.6.8, Python 3.3.1

2013-07-17 Thread Scott Lasley
I am able to import matplotlib.pyplt under python 3.3.2 from www.python.org in 
OS X 10.6.8.  matplotlib 1.2.1, libfreetype and libpng were built from source 
using gcc 4.2.1 from Xcode 3.2.6.
Are you using python from macports or from www.python.org?  You might try using 
python from the installer at www.python.org and building libfreetype and libpng 
from source.  I did a simple

./configure
make
sudo make install

in the libfreetype and libpng source directories.  You can download the latest 
source from

http://sourceforge.net/projects/libpng/files/libpng16/1.6.2/
http://sourceforge.net/projects/freetype/files/freetype2/2.5.0/

hth,
Scott

On Jul 8, 2013, at 12:17 PM, p.maxted  wrote:

> Trying to install matplotlib-1.2.1 from source, i.e.,
> 
> [macpflm:~/matplotlib-1.2.1] pflm% python3 setup.py install
> 
> Everything seems to run ok, but I cannot import macplotlib:
> 
> [macpflm:~] pflm% python3
> Python 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 11:07:11) 
> [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
> Type "help", "copyright", "credits" or "license" for more information.
 import matplotlib.pyplot
> Python(16295) malloc: *** error for object 0x101c86820: pointer being freed
> was not allocated
> *** set a breakpoint in malloc_error_break to debug
> Abort
> 
> 
> I tried updating libpng and freetype using macports and re-building, it did
> not solve the problem.
> 
> There are some warnings printed during the build, e.g., 
> 
> ld: warning: in /opt/local/lib/libfreetype.dylib, file was built for
> unsupported file format which is not the architecture being linked (i386)
> ld: warning: in /opt/local/lib/libz.dylib, file was built for unsupported
> file format which is not the architecture being linked (i386)
> ld: warning: in
> /Developer/SDKs/MacOSX10.6.sdk/usr/local/lib/libstdc++.dylib, file was built
> for unsupported file format which is not the architecture being linked
> (i386)
> 
> ..and..
> 
> /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2:
> warning: #warning "Using deprecated NumPy API, disable it by #defining
> NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
> 
> (both warning several times).
> 
> Some details from the start of the screen output during the build.
> basedirlist is: ['/usr/local/', '/usr', '/usr/X11', '/opt/local']
> 
> BUILDING MATPLOTLIB
>matplotlib: 1.2.1
>python: 3.3.1 (v3.3.1:d9893d13c628, Apr  6 2013, 11:07:11)
>[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]
>  platform: darwin
> 
> REQUIRED DEPENDENCIES
> numpy: 1.7.0
> freetype2: 16.2.10
> 
> OPTIONAL BACKEND DEPENDENCIES
>libpng: 1.5.16
>   Tkinter: Tkinter: version not identified, Tk: 8.5, Tcl: 8.5
>  Gtk+: no
>* Building for Gtk+ requires pygtk; you must be able
>* to "import gtk" in your build/install environment
>   Mac OS X native: yes
>Qt: no
>   Qt4: no
>PySide: no
> Cairo: no
> 
> OPTIONAL DATE/TIMEZONE DEPENDENCIES
>  dateutil: matplotlib will provide
>  pytz: matplotlib will provide
>   six: matplotlib will provide
> 
> OPTIONAL USETEX DEPENDENCIES
>dvipng: 1.5
>   ghostscript: 6.01
> latex: 3.141592
> 
> [Edit setup.cfg to suppress the above messages]
> 
> 
> Help!
> 
> 
> --
> View this message in context: 
> http://matplotlib.1069221.n5.nabble.com/Install-problems-OSX-10-6-8-Python-3-3-1-tp41430.html
> Sent from the matplotlib - users mailing list archive at Nabble.com.


--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] timer objects in macosx backend

2013-07-17 Thread Michiel de Hoon
Hi Justin,

The .stop() method was indeed never implemented for Timer objects in the MacOSX 
backend.
I am not sure if a .stop() method is really needed, because deleting the timer 
has the same effect as stopping the timer.
Is there some reason you prefer
>>> t.stop()
instead of
>>> del t
?

Best,
-Michiel





 From: Justin Lazear 
To: [email protected] 
Sent: Thursday, July 18, 2013 12:13 AM
Subject: [Matplotlib-users] timer objects in macosx backend
 


Hi all,

I'm using a timer object to interact with the MPL event loop on my
OS X laptop. However, it seems to be missing a few key methods that
are making using it a little difficult. In particular, I can't find
a way to stop the timer from sending events:

        $ ipython --pylab

In [1]: def fun():
>   ...: for i in range(5):
>   ...: print "We're having fun!"; yield
>   ...: for i in range(5):
>   ...: print "Too much fun..."; yield
>   ...: while True:
>   ...: print "Stop the fun! No more!"; yield
>
>In [2]: f = fun().next
>
>In [3]: fig = plt.figure()
>
>In [4]: t = fig.canvas.new_timer()
>
>In [5]: t.add_callback(f)
>
>In [6]: t.start()
>
>In [7]: t.stop()
>
>In [8]: del t  # It's all over now...
>
It looks like the stop method may never have been implemented:


In [3]: t.stop??
>Type:   instancemethod
>String Form:
>File:  
  /usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py
>Definition: t.stop(self)
>Source:
>    def stop(self):
>    '''
>    Stop the timer.
>    '''
>    self._timer_stop()
>
>In [4]: t._timer_stop??
>Type:   instancemethod
>String Form:
>File:  
  /usr/local/lib/python2.7/site-packages/matplotlib/backend_bases.py
>Definition: t._timer_stop(self)
>Source:
>    def _timer_stop(self):
>    pass
>
I'm able to remove the callback function from the timer's callback
list, but I suspect that won't stop the events from being triggered.
But I'd really prefer to completely stop the timer events, since in
my application I may end up going through many timers. 

Is this the expected behavior? Is there an easy fix I'm overlooking?

Version info:


In [3]: sys.version
>Out[3]: '2.7.3 (default, Feb 19 2013, 18:00:31) \n[GCC 4.2.1
  Compatible Apple LLVM 4.2 (clang-425.0.24)]'
>
>In [4]: mpl.__version__
>Out[4]: '1.2.0'
>
Thanks,
Justin

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users