[Matplotlib-users] zorder for collections

2011-04-02 Thread Thomas Robitaille
Hi,

I would like to set the zorder on a collection e.g. PatchCollection. By looking 
at the matplotlib source code in collections.py, I figured that it would be 
possible to set the zorder attribute of a collection manually, e.g.

p = PatchCollection(...)
p.zorder = ...

but I was wondering whether it would make sense to allow zorder to be passed as 
a keyword argument when initializing a collection, or when running 
ax.add_collection, or is there a reason that this was not done?

Cheers,
Tom
--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Widgets on top of FigureCanvas

2011-04-02 Thread Andreas Matthias
I would like to put a gtk.Button on top of a FigureCanvas. But whatever
I try the FigureCanvas stays always on top hiding the button.

Below is an example where I can change the order of buttons
by switching the following two lines

   lay.put(but1,360,260)
   lay.put(but2,360,275)

but this doesn't work for FigureCanvas

  lay.put(canvas,0,0)

Any help appreciated.

Ciao
Andreas




import gtk
import numpy as np
import pylab as mpl
from matplotlib.backends.backend_gtkagg import FigureCanvasGTKAgg as 
FigureCanvas

win = gtk.Window()
win.set_default_size(450,350)

fig = mpl.figure()
subfig = fig.add_subplot(1,1,1)
ax = subfig.plot([2,3,1])
canvas = FigureCanvas(fig)
canvas.set_size_request(400,300)

but1 = gtk.Button('1')
but2 = gtk.Button('2')

lay = gtk.Layout()
lay.put(canvas,0,0)
lay.put(but1,360,260)
lay.put(but2,360,275)

win.add(lay)
win.show_all()
win.connect('destroy', gtk.main_quit)
gtk.main()


--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] can't picker once pan or zoom chosen

2011-04-02 Thread bdb112

Straightfoward solution is to deselect zoom or pan by clicking those buttons
again.  The cursor returns to the "Arrow" shape.
Any better solution?


marc desmarais-2 wrote:
> 
> I created a simple scatter plot and a service routine to print out the
> coordinates of the points I pick with the cursor (based on the demo). It
> works until I select the pan or zoom cursor. After I zoom or pan,  I can
> no longer get back to the normal cursor which allows me to "pick" a
> circle. Even clicking "home" doesn't help.
> 
> The code is shown below
> 
> 
> from matplotlib import figure,pyplot
> from numpy import linspace,sin,take
> 
> fig=pyplot.figure()
> 
> ax1=fig.add_subplot(1,1,1) # (numRows, numCols, plotNum)
> 
> t=linspace(0,10,100)
> y1=sin(5*t)
> y2=y1+sin(10*t)
> 
> line1=ax1.scatter(y1,y2,picker=True)
> 
> def onpick1(event):
>     ind = event.ind
>     print 'onpick1 scatter:', ind, take(y1, ind), take(y2, ind)
>     
> fig.canvas.mpl_connect('pick_event', onpick1)
> pyplot.show()   
> 
> 
> this is based on the demo at
> 
> http://matplotlib.sourceforge.net/examples/event_handling/pick_event_demo.html?highlight=scatter
> 
> Marc Desmarais
> 
> 537 Park Av.
> 
> Long Beach, CA, 90814
> 
>  
> 
> (562) 712 8682 cell
> 
> 
> 
> --
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
> 30-Day 
> trial. Simplify your report design, integration and deployment - and focus
> on 
> what you do best, core application coding. Discover what's new with 
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/can%27t-picker-once-pan-or-zoom-chosen-tp25097973p31305018.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Can't pick on various scatter markers

2011-04-02 Thread bdb112

This bug or feature? is still in matplotlib 0.99.1.1 (Ubuntu 10.04 LTS)

More precisely scatter using symbols with zero area ('x', '+') will not
pick, regardless of the float value in picker.
Although this DOES work with plot, you can't vary the marker size between
points like you can with scatter.
I have also confirmed this in a version of the example in the docs
http://matplotlib.sourceforge.net/users/event_handling.html#picking-exercise
Which I could upload, but the code below is just fine.

If this is a feature, I suggest it be stated in the documentation.


Kyle Whitmer wrote:
> 
> I'm having trouble using picker on a scatter plots with various markers
> (e.g. + and x). It works with the plot command fine. What am I missing?
> Sample code below.
> 
> import numpy
> import pylab
> 
> def onpick(event):
> print 'Pick:',event.ind
> 
> fig = pylab.figure()
> ax = fig.add_subplot(111)
> 
> x1,y1 = numpy.random.random((2,100))
> series1=ax.plot(x1,y1,marker='x',color='b',linestyle='',label='plot',picker=5)
> x2,y2 = numpy.random.random((2,100))
> series2=ax.scatter(x2,y2,marker='x',color='g',label='scatter-X',picker=5)
> x3,y3 = numpy.random.random((2,100))
> series3=ax.scatter(x3,y3,marker='o',color='r',label='scatter-O',picker=5)
> 
> fig.canvas.mpl_connect('pick_event',onpick)
> pylab.legend()
> pylab.show()
> 
> -
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://old.nabble.com/Can%27t-pick-on-various-scatter-markers-tp19140977p31305085.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] import matplotlib.pyplot errors

2011-04-02 Thread Nate Gallagher
In [1]: import matplotlib.pyplot as plt
---
ImportError   Traceback (most recent call last)

/Users/ibook/Downloads/ in ()

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/pyplot.py
 in ()
 21 from matplotlib.cbook import dedent, silent_list, is_string_like, 
is_numlike
 22 from matplotlib import docstring
---> 23 from matplotlib.figure import Figure, figaspect
 24 from matplotlib.backend_bases import FigureCanvasBase
 25 from matplotlib.image import imread as _imread

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/figure.py
 in ()
 14 import numpy as np
 15 
---> 16 import artist
 17 from artist import Artist, allow_rasterization
 18 from axes import Axes, SubplotBase, subplot_class_factory

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/artist.py
 in ()
  4 import matplotlib.cbook as cbook
  5 from matplotlib import docstring, rcParams
> 6 from transforms import Bbox, IdentityTransform, TransformedBbox, 
TransformedPath
  7 from path import Path
  8 

/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/transforms.py
 in ()
 32 import numpy as np
 33 from numpy import ma
---> 34 from matplotlib._path import affine_transform
 35 from numpy.linalg import inv
 36 

ImportError: 
dlopen(/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_path.so,
 2): no suitable image found.  Did find:
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib/_path.so:
 no matching architecture in universal wrapper


--
Create and publish websites with WebMatrix
Use the most popular FREE web apps or write code yourself; 
WebMatrix provides all the features you need to develop and 
publish your website. http://p.sf.net/sfu/ms-webmatrix-sf
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users