Re: [Matplotlib-users] loss of 3d plot interactivity after cla()?

2012-03-17 Thread Zachary Pincus
For posterity, Ben Root let me know off-list that the interaction bug is fixed 
in the soon-to-be-released v 1.1.1.

Also, regarding documentation, I mentioned to Ben and I'll mention here too 
that I'd be happy to help out where I can with what sort of information would 
be helpful for getting people in my position (tons of python knowledge, but 
almost none of matlab) up and running with matplotlib -- which as of now seems 
to rely on similarity-with-matlab for getting new users started. 

I'm obviously not the right person to write new docs, but if there's any other 
way I can help, I'd be happy to.

Zach


On Mar 16, 2012, at 5:34 PM, Zachary Pincus wrote:

 Hi all,
 
 I'm (finally) getting started with matplotlib, and am enjoying the lovely 
 plot quality. However, as a non-matlab user, I'm finding it *extremely* 
 difficult to figure out how to do even the simplest tasks / understand the 
 code samples. (e.g. what is the '111' in the boilerplate calls to 
 add_subplot() in the various examples? I couldn't find anything in the docs, 
 and had to resort to the matlab documentation!)
 
 Anyhow, I've soldiered on, and have run across an issue that I don't know if 
 is related to my non-comprehension of the right syntax, a bug in the Axes3D 
 code, or a problem with the MacOSX backend. Here's code to duplicate the 
 issue (Python 2.7, OS X 10.7, matplotlib 1.1.0, via pre-built installer):
 
 import matplotlib as mpl
 mpl.use('macosx')
 import matplotlib.pyplot as plt
 plt.ion()
 from mpl_toolkits.mplot3d import Axes3D
 fig = plt.figure()
 ax = fig.gca(projection='3d')
 ax.plot([1,2,3], [2,3,2], [2,5,7]) # draws immediately!?
 ax.cla() # plt.cla() has same effect
 ax.plot([1,2,3], [2,3,2], [2,5,7]) # doesn't draw?
 plt.draw() # now draws, but z-order is messed up -- grid lines on top?
 # And worse, now figure can't be interactively rotated with the mouse
 
 Nothing can restore interactivity short of making a new figure, or calling 
 fig.clf() (which I *randomly* happened on), and then making a new set of axes.
 
 Is this a known issue? Am I doing something wrong -- is ax.cla() or plt.cla() 
 the wrong thing to clear the figure?
 
 Thanks a lot,
 Zach
 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here 
 http://p.sf.net/sfu/sfd2d-msazure
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] OSX: need testing

2012-03-17 Thread Zachary Pincus
 If you can test and confirm that you can build and use mpl normally with this 
 patch, please respond with a python version and OSX version that you tested 
 with.  Some of the fixes were python3 specific, so if you also can test this 
 against matplotlib master and python3, that would be great.
 

Builds and (appears to) work fine on 10.7 with python 2.7, using the latest 
code from the github master.

Zach


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] OSX: need testing

2012-03-17 Thread John Hunter




On Mar 17, 2012, at 9:49 AM, Zachary Pincus zachary.pin...@yale.edu wrote:

 If you can test and confirm that you can build and use mpl normally with 
 this patch, please respond with a python version and OSX version that you 
 tested with.  Some of the fixes were python3 specific, so if you also can 
 test this against matplotlib master and python3, that would be great.
 
 
 Builds and (appears to) work fine on 10.7 with python 2.7, using the latest 
 code from the github master.
 
 

Just to be clear, this code is not in github master. I assume you have a 
checkout of master and then dropped the attached _macosx.m into your src for 
before building and testing?
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] loss of 3d plot interactivity after cla()?

2012-03-17 Thread John Hunter
On Fri, Mar 16, 2012 at 4:34 PM, Zachary Pincus zachary.pin...@yale.eduwrote:

 Hi all,

 I'm (finally) getting started with matplotlib, and am enjoying the lovely
 plot quality. However, as


Finally getting started?  You were one of our first contributors!

http://sourceforge.net/mailarchive/message.php?msg_id=5192900


a non-matlab user, I'm finding it *extremely* difficult to figure out how
 to do even the simplest tasks / understand the code samples. (e.g. what is
 the '111' in the boilerplate calls to add_subplot() in the various
 examples? I couldn't find anything in the docs, and had to resort to the
 matlab documentation!)


The 111, and the numbering scheme in general, is covered in the pyplot
tutorial

http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#working-with-multiple-figures-and-axes

and in the subplots API docs

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplot

but it looks like the Figure.add_subplot docs could use some improvement
here to explain the numbering scheme better (as pyplot.subplot does)

http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.add_subplot


I'll try and find some time today to clean up this docstring and to improve
the pyplot tutorial to use the recommended subplots command.

JDH
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Website error

2012-03-17 Thread Eric Firing
On 03/16/2012 02:24 PM, Annie Seagram wrote:
 I've encountered an error on all pages associated with the tumbnails in
 the matplotlib thumbnail gallery (matplotib.sourceforge.net/gallery/html
 http://matplotib.sourceforge.net/gallery/html). Thus, none of the
 source codes or explanations are available. One such error:

Annie,

It looks to me like the problem is specific to a few of the examples. 
The thumbnail is linking to

http://matplotlib.sourceforge.net/examples/pylab_examples/demo_tight_layout_00.html

but the relevant page url is as above but without the _00 part.

I have no idea why this is happening.

Eric


 1. *Server:*matplotlib.sourceforge.net http://matplotlib.sourceforge.net
 2. *URL path:*/examples/pylab_examples/demo_tight_layout_01.html
 3. *Error notes:*NONE
 4. *Error type:*404
 5. *Request method:*GET
 6. *Request query string:*NONE
 7. *Time:*2012-03-17 00:20:17 UTC (1331943617)

 Thanks,

 - Annie Seagram
 Research Assistant
 Department of Earth and Ocean Sciences
 University of British Coumbia
 Vancouver, BC
 aseag...@eos.ubc.ca mailto:aseag...@eos.ubc.ca



 --
 This SF email is sponsosred by:
 Try Windows Azure free for 90 days Click Here
 http://p.sf.net/sfu/sfd2d-msazure



 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] OSX: need testing

2012-03-17 Thread Zachary Pincus
 Just to be clear, this code is not in github master. I assume you have a 
 checkout of master and then dropped the attached _macosx.m into your src for 
 before building and testing?

Yes, precisely. Checked out master, dropped the attached into src (and made 
sure that git diff showed a some changes in that file), and compiled without 
error.

Zach
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] loss of 3d plot interactivity after cla()?

2012-03-17 Thread Zachary Pincus
 I'm (finally) getting started with matplotlib, and am enjoying the lovely 
 plot quality. However, as
 
 Finally getting started?  You were one of our first contributors!
 http://sourceforge.net/mailarchive/message.php?msg_id=5192900

Heh. Well, now I'm actively trying to use it as a plotting library rather than 
a great place to snag code from for my own projects :)


 The 111, and the numbering scheme in general, is covered in the pyplot 
 tutorial
 
 http://matplotlib.sourceforge.net/users/pyplot_tutorial.html#working-with-multiple-figures-and-axes
 
 and in the subplots API docs
 
 http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.subplot
 
 but it looks like the Figure.add_subplot docs could use some improvement here 
 to explain the numbering scheme better (as pyplot.subplot does) 
 
 http://matplotlib.sourceforge.net/api/figure_api.html#matplotlib.figure.Figure.add_subplot

Aah, thanks for the pointers! I realize that it's hard to keep all the docs 
spiffy when there are a couple of different ways to get the various bits of 
functionality. I'll go more thoroughly through the pyplot tutorial...

Thanks again,
Zach
--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] matplotlib picking mouseevent.key=None

2012-03-17 Thread gsal

o.k., here is some minimal code...what am I doing wrong? 

Within the picker (def pkr)...I would like to be able to see the
mouseevent.key value, but this is always None...is this the expected
behaviour? Is mouseevent.key not set at this point?

Anye hints would be greatly appreciated.

[code]
import sys

import matplotlib.patches as mpathes
import matplotlib.text as mtext
import matplotlib.lines as mlines
from matplotlib.path import Path

from PyQt4.QtGui import *

from matplotlib.figure import Figure
from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as
FigureCanvas
from matplotlib.backends.backend_qt4agg import NavigationToolbar2QTAgg as
NavigationToolbar

class AAA():
pass

class Qt4MplCanvas(FigureCanvas):
   class to represent the FigureCanvas widget
   def __init__(self, parent, data):
  self.data = data
  self.fig = Figure()
  self.axes = self.fig.add_subplot(111)
  self.axes.set_aspect(1)  
  self.compute_initial_figure()
  FigureCanvas.__init__(self, self.fig)
  self.setParent(parent)
 
FigureCanvas.setSizePolicy(self,QSizePolicy.Expanding,QSizePolicy.Expanding)
  FigureCanvas.updateGeometry(self)
  
class MagnedMplCanvas(Qt4MplCanvas):
   Simple canvas with a sine plot.
   
   def pkr(self, art, mouseevent):
   key = mouseevent.key
   button = mouseevent.button
   print key
   print button
   print art   
   return False, dict()   

   def compute_initial_figure(self):  
   GR = [1.0, 2.0, 3.0, 4.0]
   self.axes.hlines(GR,0.0,4.0,picker=self.pkr)   

class ApplicationWindow(QMainWindow):
   Example main window
   def __init__(self):
  QMainWindow.__init__(self)
  self.setWindowTitle(Matplotlib Figure in a Qt4 Window
WithNavigationToolbar)
  self.main_widget = QWidget(self)
  vbl = QVBoxLayout(self.main_widget)
  
  self.data=AAA()
  self.data.nnn=0  
  
  qmc = MagnedMplCanvas(self.main_widget, self.data)
  ntb = NavigationToolbar(qmc, self.main_widget)
  vbl.addWidget(qmc)
  vbl.addWidget(ntb)
  self.main_widget.setFocus()
  self.setCentralWidget(self.main_widget)
  
qApp = QApplication(sys.argv)
aw = ApplicationWindow()
aw.show()
sys.exit(qApp.exec_())  

[/code]
-- 
View this message in context: 
http://old.nabble.com/matplotlib-picking-mouseevent.key%3DNone-tp33494747p33524689.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users