Re: [Matplotlib-users] axes3d.get_test_data; where else is test data?

2014-11-07 Thread Thomas Caswell
Take a look at matplotlib.cbook.get_sample_data. That said, I don't think an _axes_ object should have such a function and axes3d.get_test_data() should be removed. Tom On Thu Nov 06 2014 at 11:40:18 AM Adam Hughes wrote: > Hi, > > I recently noticed the method: > > axes3d.get_test_data()

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Štěpán Roučka
It works. Thanks a lot for explanation, Ben. Stepan On Fri, Nov 7, 2014 at 6:37 PM, Benjamin Root wrote: > Figured it out! The instance of Test() isn't being retained anywhere, so > when it goes out of scope, the garbage collector eventually gets it. The > fact that it works in py3k is likely a

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Federico Ariza
Sorry I'm lost in the discussion. What is the relation between the weak references in callback registry and moving stuff to the figure manager? Federico On 7 Nov 2014 14:13, "Thomas Caswell" wrote: > I am also beginning to like the idea of hanging all of these things off of > FigureManager objec

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Thomas Caswell
I am also beginning to like the idea of hanging all of these things off of FigureManager objects. We have them around, but they are really only used in pyplot (which is a shame) and seems a natural place to put all of these aggregation type objects (list of animations, the toolbar stuff, the navig

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Thomas Caswell
The old-style classes are because mpl pre-dates new-style classes. On master all classes now inherit from object (as of about 3 weeks ago https://github.com/matplotlib/matplotlib/pull/3662) On Fri Nov 07 2014 at 2:02:15 PM Brendan Barnwell wrote: > On 2014-11-07 09:37, Benjamin Root wrote: >

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Benjamin Root
There have been some discussion of adding an fig.animations list (a la ax.images, ax.artists), and have a fig.add_animation() method. We could then update the animation code to add itself to the given figure to make this work for all existing code. Maybe it would be a nice tie-in with the updates t

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Brendan Barnwell
On 2014-11-07 09:37, Benjamin Root wrote: > Figured it out! The instance of Test() isn't being retained anywhere, so > when it goes out of scope, the garbage collector eventually gets it. The > fact that it works in py3k is likely a coincidence as the garbage > collector would eventually have clean

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Thomas Caswell
This came up regrading sliders a while ago: https://github.com/matplotlib/matplotlib/issues/3105 and is one of the persistent gotchas with animation code. Tom On Fri Nov 07 2014 at 12:38:28 PM Benjamin Root wrote: > Figured it out! The instance of Test() isn't being retained anywhere, so > when

Re: [Matplotlib-users] error import matplotlib.pyplot

2014-11-07 Thread Benjamin Root
I am unfamiliar with zypper (seems to be a package manager of some sort). Does it build the binaries from source on your system, or does it just install binaries from a repository? Was there an existing install of matplotlib? Cheers! Ben Root On Thu, Nov 6, 2014 at 4:04 PM, ahtos wrote: > Impor

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Benjamin Root
Figured it out! The instance of Test() isn't being retained anywhere, so when it goes out of scope, the garbage collector eventually gets it. The fact that it works in py3k is likely a coincidence as the garbage collector would eventually have cleaned it up at some point. I don't know the scoping/g

Re: [Matplotlib-users] Defaults?

2014-11-07 Thread Sebastian Berg
On Fr, 2014-11-07 at 16:15 +0100, Sebastian Berg wrote: > Hey, > > just something I was wondering about today. I commonly want to change > certain things about my plots. For example I like a serif/larger fonts, > and everyone knows that "jet" is an awful default colour map almost > always... > >

Re: [Matplotlib-users] Defaults?

2014-11-07 Thread Thomas Caswell
The style module (extracted from mpltools) is now part of the library and was one of the major features added in the 1.4 series. See http://matplotlib.org/users/style_sheets.html Tom On Fri Nov 07 2014 at 11:05:58 AM Adam Hughes wrote: > I use a config file in ipython notebooks that sets some

Re: [Matplotlib-users] Defaults?

2014-11-07 Thread Adam Hughes
I use a config file in ipython notebooks that sets some parameters of the ipython notebook and then sets the matplotlib defaults. http://nbviewer.ipython.org/github/hugadams/pyuvvis/blob/master/examples/Notebooks/NBCONFIG.ipynb Then I use in all subsequent analysis in the ipython notebook: http:

Re: [Matplotlib-users] Defaults?

2014-11-07 Thread Francesco Montesano
Hi Sebastian, If you want to set the defaults only once and use them forever, there is the matplotlibrc file (http://matplotlib.org/users/customizing.html) If you want to easily change the defaults according to the context of the plot mpltools by Tony S. Yu can help you ( https://github.com/tonys

Re: [Matplotlib-users] Basemap from proj4 string

2014-11-07 Thread Joe Kington
I agree that it would be useful, but basemap doesn't support EPSG codes, so this isn't fully possible in general. On a side note, if you're ever just wanting to transform coordinates, pyproj supports generic proj4 strings. (e.g. "proj = pyproj.Proj(your_proj4_string)") It might be possible to in

[Matplotlib-users] Defaults?

2014-11-07 Thread Sebastian Berg
Hey, just something I was wondering about today. I commonly want to change certain things about my plots. For example I like a serif/larger fonts, and everyone knows that "jet" is an awful default colour map almost always... It could be neat to have some more "default" rc's or so that can be load

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread rouckas
Thanks for the tip. However, subclassing from object didn't help. -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-event-handling-in-matplotlib-in-tkinter-tp44302p44315.html Sent from the matplotlib - users mailing list archive at Nabble.com. --

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread Benjamin Root
I think it is because your Test() class is not subclassed from "object". Of course, I have no clue why that would be an issue, but I have seen stranger things when not subclassing from object. On Fri, Nov 7, 2014 at 9:31 AM, rouckas wrote: > I have a little update on the issue: I tried it with d

Re: [Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread rouckas
I have a little update on the issue: I tried it with different versions of python and matplotlib and it is still present in python 2.7.6 + matplotlib 1.4.2 but it works as expected in python 3.4.0 + matplotlib 1.4.2 Should this be reported as a bug in matplotlib 1.4.2 on python 2.7.6? BTW, I not

Re: [Matplotlib-users] Basemap from proj4 string

2014-11-07 Thread Knut-Frode Dagestad
As an example, say I have a proj4 string defining a spatial reference system: p4 = '+lon_0=0.0 +lat_ts=60.0 +R=6370997.0 +proj=stere +x_0=-0.0 +units=m +y_0=4327039.11059 +lat_0=90.0' Then one can construct a Basemap from this as: map = Basemap(projection='stere', lon_0=0., lat_0=90, lat_ts=60

[Matplotlib-users] Problem with event handling in matplotlib in tkinter

2014-11-07 Thread rouckas
Dear all, I have a problem with using certain class methods as event handlers. In the following example: the method Test.on_press() is never executed. Only "clicked0" and "clicked1" is printed when I click on the canvas. When i use pure matplotlib widgets instead of tkinter embedding, the code