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
(14) |
2
(6) |
3
(10) |
4
(3) |
5
(2) |
6
(3) |
7
(21) |
8
|
9
|
10
(4) |
11
(2) |
12
(8) |
13
(17) |
14
(9) |
15
(5) |
16
(3) |
17
|
18
(10) |
19
(11) |
20
(3) |
21
(11) |
22
(1) |
23
|
24
(2) |
25
|
26
(3) |
27
(6) |
28
|
29
|
30
|
|
|
|
|
|
|
From: Benjamin R. <ben...@ou...> - 2014-11-07 19:04:05
|
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 to the navigation toolbar (automatically adding useful buttons for starting/pausing animations, etc)? On Fri, Nov 7, 2014 at 1:35 PM, Thomas Caswell <tca...@gm...> wrote: > 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 <ben...@ou...> 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 cleaned it up at some point. I don't know the >> scoping/garbage collection rules for lambdas, so I am guessing that they >> persist as they are part of the code as opposed to a de-reference-able (is >> that even a word?). Just save the instance of Test as a member variable of >> App, and you should be good to go! >> >> Ben Root >> >> On Fri, Nov 7, 2014 at 10:05 AM, rouckas <ste...@gm...> wrote: >> >>> 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. >>> >>> >>> ------------------------------------------------------------------------------ >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >> >> ------------------------------------------------------------ >> ------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > |
From: Brendan B. <bre...@br...> - 2014-11-07 19:00:30
|
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 cleaned it up at some point. I don't > know the scoping/garbage collection rules for lambdas, so I am guessing > that they persist as they are part of the code as opposed to a > de-reference-able (is that even a word?). Just save the instance of Test > as a member variable of App, and you should be good to go! This note in cbook.py (which handles the callback registry) explains it. . . sort of: In practice, one should always disconnect all callbacks when they are no longer needed to avoid dangling references (and thus memory leaks). However, real code in matplotlib rarely does so, and due to its design, it is rather difficult to place this kind of code. To get around this, and prevent this class of memory leaks, we instead store weak references to bound methods only, so when the destination object needs to die, the CallbackRegistry won't keep it alive. The Python stdlib weakref module can not create weak references to bound methods directly, so we need to create a proxy object to handle weak references to bound methods (or regular free functions). This technique was shared by Peter Parente on his `"Mindtrove" blog <http://mindtrove.info/articles/python-weak-references/>`_. Definitely a hidden trap! Also, speaking of the dangers of classes not inheriting from object, I noticed that CallbackRegistry in cbook.py is also an old-style class (doesn't inherit from object). I then did a search and found numerous old-style classes throughout MPL. Is there any reason for this? -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown |
From: Thomas C. <tca...@gm...> - 2014-11-07 18:35:54
|
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 <ben...@ou...> 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 cleaned it up at some point. I don't know the > scoping/garbage collection rules for lambdas, so I am guessing that they > persist as they are part of the code as opposed to a de-reference-able (is > that even a word?). Just save the instance of Test as a member variable of > App, and you should be good to go! > > Ben Root > > On Fri, Nov 7, 2014 at 10:05 AM, rouckas <ste...@gm...> wrote: > >> 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. >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > ------------------------------------------------------------ > ------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2014-11-07 17:57:41
|
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 <sy...@md...> wrote: > ImportError: > /usr/lib64/python2.6/site-packages/matplotlib/backends/_backend_agg.so: > undefined symbol: MPL_matplotlib__path_ARRAY_API > > SUSE Linux Enterprise Server 11 (x86_64) > VERSION = 11 > PATCHLEVEL = 3 > > Python 2.6.9 > GCC 4.3.4 > numpy 1.8.0 > > > installed through zypper > > thanks, > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/error-import-matplotlib-pyplot-tp44297.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Benjamin R. <ben...@ou...> - 2014-11-07 17:37:56
|
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/garbage collection rules for lambdas, so I am guessing that they persist as they are part of the code as opposed to a de-reference-able (is that even a word?). Just save the instance of Test as a member variable of App, and you should be good to go! Ben Root On Fri, Nov 7, 2014 at 10:05 AM, rouckas <ste...@gm...> wrote: > 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. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Thomas C. <tca...@gm...> - 2014-11-07 16:33:50
|
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 <hug...@gm...> wrote: > 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://nbviewer.ipython.org/urls/raw.github.com/hugadams/pyuvvis/master/examples/Notebooks/basic_units.ipynb > > On Fri, Nov 7, 2014 at 10:15 AM, Sebastian Berg < > seb...@si...> 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... >> >> It could be neat to have some more "default" rc's or so that can be >> loaded easily. I mean I could just create one for myself, but having >> some examples of what can be done and being able to switch that could be >> neat. Such as some defaults that are better for printing, maybe in >> matplotlib or really just on a website which shows some example plot for >> uploaded RCs. >> >> Anyway, just rambling :), I am not planning to really think about it >> much. And maybe some things even exist and I am not aware of it. >> >> Regards, >> >> Sebastian >> >> >> ------------------------------------------------------------------------------ >> >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> > ------------------------------------------------------------ > ------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Sebastian B. <seb...@si...> - 2014-11-07 16:32:46
|
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... > > It could be neat to have some more "default" rc's or so that can be > loaded easily. I mean I could just create one for myself, but having > some examples of what can be done and being able to switch that could be > neat. Such as some defaults that are better for printing, maybe in > matplotlib or really just on a website which shows some example plot for > uploaded RCs. > > Anyway, just rambling :), I am not planning to really think about it > much. And maybe some things even exist and I am not aware of it. > Nevermind, seems like we got matpltolib.style in 1.4, that is cool. Now all I could hope for is for some more styles ;). - Sebastian > Regards, > > Sebastian > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Adam H. <hug...@gm...> - 2014-11-07 16:04:24
|
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://nbviewer.ipython.org/urls/raw.github.com/hugadams/pyuvvis/master/examples/Notebooks/basic_units.ipynb On Fri, Nov 7, 2014 at 10:15 AM, Sebastian Berg <seb...@si...> 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... > > It could be neat to have some more "default" rc's or so that can be > loaded easily. I mean I could just create one for myself, but having > some examples of what can be done and being able to switch that could be > neat. Such as some defaults that are better for printing, maybe in > matplotlib or really just on a website which shows some example plot for > uploaded RCs. > > Anyway, just rambling :), I am not planning to really think about it > much. And maybe some things even exist and I am not aware of it. > > Regards, > > Sebastian > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Francesco M. <fra...@gm...> - 2014-11-07 16:02:21
|
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/tonysyu/mpltools) Cheers, Fra 2014-11-07 16:15 GMT+01:00 Sebastian Berg <seb...@si...>: > 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 > loaded easily. I mean I could just create one for myself, but having > some examples of what can be done and being able to switch that could be > neat. Such as some defaults that are better for printing, maybe in > matplotlib or really just on a website which shows some example plot for > uploaded RCs. > > Anyway, just rambling :), I am not planning to really think about it > much. And maybe some things even exist and I am not aware of it. > > Regards, > > Sebastian > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Joe K. <jof...@gm...> - 2014-11-07 15:47:11
|
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 initialize a projection in Cartopy from a generic pyproj projection... I'm not sure, though. At any rate, that doesn't answer your question at all, but consider it food for thought. Cheers, -Joe On Fri, Nov 7, 2014 at 7:16 AM, Knut-Frode Dagestad < knu...@ho...> wrote: > 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, > llcrnrlat=50, urcrnrlat=70, llcrnrlon=0, urcrnrlon=20) > > > I could make a function to construct Basemap arguments from any user > specified proj4 string (which is out of control of my application). But > that function would probably be long and contain a lot of > projection-specific if-then-switches. Copying proj4 arguments directly does > not work, e.g. if passing "x_0=0" Basemap complains that x_0 is an > unexpected argument. > The problem of making a long parser is not that this is tedious, but that > it is error prone and unstable e.g. with respect to future upgrades of > Basemap or proj4 libraries. > > So as Basemap obviously does have an algorithm to create a proj4 string > from its input arguments, I was hoping the reverse algorithm would also be > available somehow. E.g. it would be very useful to be able to initialise a > Basemap with: > > map = Basemap(proj4=p4, llcrnrlat=50, urcrnrlat=70, llcrnrlon=0, > urcrnrlon=20) > > Knut-Frode > > > ------------------------------ > Date: Wed, 5 Nov 2014 09:32:16 -0800 > > > I think some examples would help. Which proj4 string are you looking to > use? How are you currently constructing the map? > -p > > On Wed, Nov 5, 2014 at 7:53 AM, knutfrode <knu...@ho...> > wrote: > > Does anyone know if this is possible? > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Basemap-from-proj4-string-tp43428p44290.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > > > ------------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > |
From: Sebastian B. <seb...@si...> - 2014-11-07 15:43:28
|
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 loaded easily. I mean I could just create one for myself, but having some examples of what can be done and being able to switch that could be neat. Such as some defaults that are better for printing, maybe in matplotlib or really just on a website which shows some example plot for uploaded RCs. Anyway, just rambling :), I am not planning to really think about it much. And maybe some things even exist and I am not aware of it. Regards, Sebastian |
From: rouckas <ste...@gm...> - 2014-11-07 15:05:16
|
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. |
From: Benjamin R. <ben...@ou...> - 2014-11-07 14:55:37
|
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 <ste...@gm...> wrote: > 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 noticed that my minimal text from previous mail didn't get through > to > the mailing list, so I am attaching it again (modified for python 2.7) > without formatting: > > from __future__ import print_function > import sys > if sys.version_info < (3, 0): > import Tkinter as tk > else: > import tkinter as tk > from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg > import matplotlib.figure as mplfig > > > class Test: > def on_press(self, event): > print("clicked2") > > def connect(self, canvas): > self.cidpress = canvas.mpl_connect( > 'button_press_event', self.on_press) > self.cidpress = canvas.mpl_connect( > 'button_press_event', lambda event: print("clicked1")) > > class App(object): > def on_press(self, event): > print("clicked0") > def __init__(self, master): > self.fig = mplfig.Figure() > self.canvas = FigureCanvasTkAgg(self.fig, master=master) > > dl = Test() > dl.connect(self.canvas) > > self.cidpress = self.canvas.mpl_connect( > 'button_press_event', self.on_press) > > self.canvas.get_tk_widget().pack() > self.canvas.draw() > > if __name__ == "__main__": > root = tk.Tk() > app = App(root) > tk.mainloop() > > this should print > clicked2 > clicked1 > clicked0 > > after each click on the canvas. But in python 2.7.6 it prints only > clicked1 > clicked0 > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Problem-with-event-handling-in-matplotlib-in-tkinter-tp44302p44307.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: rouckas <ste...@gm...> - 2014-11-07 14:31:55
|
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 noticed that my minimal text from previous mail didn't get through to the mailing list, so I am attaching it again (modified for python 2.7) without formatting: from __future__ import print_function import sys if sys.version_info < (3, 0): import Tkinter as tk else: import tkinter as tk from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import matplotlib.figure as mplfig class Test: def on_press(self, event): print("clicked2") def connect(self, canvas): self.cidpress = canvas.mpl_connect( 'button_press_event', self.on_press) self.cidpress = canvas.mpl_connect( 'button_press_event', lambda event: print("clicked1")) class App(object): def on_press(self, event): print("clicked0") def __init__(self, master): self.fig = mplfig.Figure() self.canvas = FigureCanvasTkAgg(self.fig, master=master) dl = Test() dl.connect(self.canvas) self.cidpress = self.canvas.mpl_connect( 'button_press_event', self.on_press) self.canvas.get_tk_widget().pack() self.canvas.draw() if __name__ == "__main__": root = tk.Tk() app = App(root) tk.mainloop() this should print clicked2 clicked1 clicked0 after each click on the canvas. But in python 2.7.6 it prints only clicked1 clicked0 -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-event-handling-in-matplotlib-in-tkinter-tp44302p44307.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Knut-Frode D. <knu...@ho...> - 2014-11-07 13:16:18
|
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, llcrnrlat=50, urcrnrlat=70, llcrnrlon=0, urcrnrlon=20) I could make a function to construct Basemap arguments from any user specified proj4 string (which is out of control of my application). But that function would probably be long and contain a lot of projection-specific if-then-switches. Copying proj4 arguments directly does not work, e.g. if passing "x_0=0" Basemap complains that x_0 is an unexpected argument. The problem of making a long parser is not that this is tedious, but that it is error prone and unstable e.g. with respect to future upgrades of Basemap or proj4 libraries. So as Basemap obviously does have an algorithm to create a proj4 string from its input arguments, I was hoping the reverse algorithm would also be available somehow. E.g. it would be very useful to be able to initialise a Basemap with: map = Basemap(proj4=p4, llcrnrlat=50, urcrnrlat=70, llcrnrlon=0, urcrnrlon=20) Knut-Frode Date: Wed, 5 Nov 2014 09:32:16 -0800 I think some examples would help. Which proj4 string are you looking to use? How are you currently constructing the map?-p On Wed, Nov 5, 2014 at 7:53 AM, knutfrode <knu...@ho...> wrote: Does anyone know if this is possible? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Basemap-from-proj4-string-tp43428p44290.html Sent from the matplotlib - users mailing list archive at Nabble.com. ------------------------------------------------------------------------------ _______________________________________________ Matplotlib-users mailing list Mat...@li... https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: rouckas <ste...@gm...> - 2014-11-07 11:08:40
|
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 works as expected. Is this a matplotlib bug or am I doing something wrong? My software versions are: Python 3.4.0 matplotlib.__version__ == '1.3.1' tkinter.TkVersion == 8.6 in Ubuntu 14.04 Thanks in advance for any help, Stepan -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Problem-with-event-handling-in-matplotlib-in-tkinter-tp44302.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: ahtos <sy...@md...> - 2014-11-06 21:04:23
|
ImportError: /usr/lib64/python2.6/site-packages/matplotlib/backends/_backend_agg.so: undefined symbol: MPL_matplotlib__path_ARRAY_API SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 3 Python 2.6.9 GCC 4.3.4 numpy 1.8.0 installed through zypper thanks, -- View this message in context: http://matplotlib.1069221.n5.nabble.com/error-import-matplotlib-pyplot-tp44297.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Maria L. <li...@us...> - 2014-11-06 18:56:06
|
Hello, I was wondering if there is an option in basemap to put “fancy“ (white and black skinny rectangles) map border like the one is available in GMT? Many thanks, Masha -- li...@us... |
From: Adam H. <hug...@gm...> - 2014-11-06 16:39:08
|
Hi, I recently noticed the method: axes3d.get_test_data() I was curious if other test/sample data is available somewhere in matplotlib, for demo purposes? Or if this is the only sample dataset in the library? Not just for 3dplots but for any plot type... Sorry if I'm overlooking the obvious... |
From: Paul H. <pmh...@gm...> - 2014-11-05 17:32:24
|
I think some examples would help. Which proj4 string are you looking to use? How are you currently constructing the map? -p On Wed, Nov 5, 2014 at 7:53 AM, knutfrode <knu...@ho...> wrote: > Does anyone know if this is possible? > > > > > > -- > View this message in context: > http://matplotlib.1069221.n5.nabble.com/Basemap-from-proj4-string-tp43428p44290.html > Sent from the matplotlib - users mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: knutfrode <knu...@ho...> - 2014-11-05 15:53:55
|
Does anyone know if this is possible? -- View this message in context: http://matplotlib.1069221.n5.nabble.com/Basemap-from-proj4-string-tp43428p44290.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Ian T. <ian...@gm...> - 2014-11-04 08:14:46
|
On 2 November 2014 16:30, Benjamin Root <ben...@ou...> wrote: > Would it make sense to at least emit a warning when a mask is encountered. > There are very few places in matplotlib where masked arrays are not allowed > (I think histograms is the other spot, but I can't remember for sure). > Ben, That's certainly an option, but I'm happy with leaving it as it is with the onus on users to read the documentation. Ian |
From: Eric F. <ef...@ha...> - 2014-11-04 00:41:59
|
On 2014/11/03, 2:19 PM, Damien Irving wrote: > I often like to define my own colormaps using hex strings, e.g. > hex_list = ['#FFF295', '#FFD555', '#FF850B', '#D55000', '#D50000', > '#550040','#600080', '#000080', '#0000D5', '#0B85FF', '#55AAFF', '#95CAFF'] > > However, when I pass them to contourf and try to extend the colorbar... > plt.contourf(x, y, data, colors=hex_list, extend='both') > > ... it always ends up that the color of the final segment on the > extended ends of the colorbar is the same color as the extension segment > (i.e. the bit in the little arrow). This happens even when hex_list is > much longer than the actual number of segments required. You need to use the "levels" kwarg to specify the contour interval boundaries, and then your list of colors needs to have a length equal to len(levels) + 1. In other words, the number of colors listed in the colors kwarg needs to be *exactly* the number needed to fill between the specified levels, plus one for each requested "extend" direction, if any. plt.contourf(x, y, data, levels=[0, 1, 2], colors=['red', 'blue, 'brown', 'black'], extend='both') That should give you blue and brown for 0-1 and 1-2; with red for data<0, and black for data>2. Eric > > Has anyone else had this problem? > > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Damien I. <dam...@ya...> - 2014-11-04 00:19:15
|
I often like to define my own colormaps using hex strings, e.g. hex_list = ['#FFF295', '#FFD555', '#FF850B', '#D55000', '#D50000', '#550040', '#600080', '#000080', '#0000D5', '#0B85FF', '#55AAFF', '#95CAFF'] However, when I pass them to contourf and try to extend the colorbar... plt.contourf(x, y, data, colors=hex_list, extend='both') ... it always ends up that the color of the final segment on the extended ends of the colorbar is the same color as the extension segment (i.e. the bit in the little arrow). This happens even when hex_list is much longer than the actual number of segments required. Has anyone else had this problem? |
From: Andy B. <an...@in...> - 2014-11-03 22:59:54
|
Hi again, I didn't see any on-list answer, but got an off-list suggestion to use an rc parameter to set a LaTeX preamble. I played around a little and thought I should report on what I found, especially since it seems that there is room for improvement here and I'd be interested to help. Here are the relevant rc params that I have set: "font.size" : 17, "font.family" : "serif", "font.serif" : ["TeX Gyre Pagella"], "pgf.rcfonts" : True, "pgf.preamble": [r"\usepackage{amsmath,amssymb}", r"\usepackage{fontspec}", r"\defaultfontfeatures{Numbers=OldStyle}"], A couple of points to note here: * I'm using the PGF backend -- this ran a bit faster and produced much smaller files than MPL rendering with TeX labels (text.usetex = True). Also, I have data files with labels using macros like \text which MPL MathText doesn't support, so I need to be able to include amsmath. * I've had to set TeX Gyre Pagella rather than Palatino, since this SE question points out that fontspec's Palatino doesn't support small-caps and old-style figures:http://tex.stackexchange.com/questions/2994/fontspec-palatino-with-small-caps-and-old-style-figures * Although the backend uses fontspec, I have to import it explicitly in my preamble, because the MPL import and use of fontspec happens _after_ where the pgf.preamble key is inserted. Actually, given that I found fontspec doesn't seem to do the right thing for most math fonts, maybe I need to ignore the rcfonts setting and do it a bit more manually if I want full control -- pity. If I ask this configuration to output a PDF file, though, I don't get old-style figures as intended. So I started looking at the generated TeX source by outputting as .pgf and wrapping in a little LaTeX file like this: \documentclass[12pt,minimal]{standalone} \usepackage{pgf} \usepackage{amsmath,amssymb} \usepackage{fontspec} \setmainfont[Numbers=OldStyle]{TeX Gyre Pagella} \begin{document} \input{plot.pgf} \end{document} I've attached the result of this with the default MPL .pgf output as plot-mpldefault.pdf. A couple of things are notable in that plot: * Old-style figures are used in the legend (where math mode is not used), but the axis tick labels are not. * The full-size figures on the axes are very thin weight compared to the text axis labels -- I knew something had looked a bit wrong in the default output! Looking in the .pgf file, the reason is clear. The axis ticks are in display math mode, like this: \pgftext[x=0.987638in,y=1.778400in,right,]{{\rmfamily\fontsize{17.000000}{20.400000}\selectfont \(\displaystyle 1.05\)}}% ^^^^^^^^^^^^^^^^^^^^^^ I removed the \(\displaystyle and \) from the file and then recompiled with and without the Numbers=OldStyle spec in the wrapper, producing the attached plot-textoldstyle.pdf and plot-textlining.pdf figures. In both of these the weight of the tick labels is much more balanced with the other labels than in the default; the old-style or lining figure style is more a matter of personal preference, but I would like to have the option. Apologies for the long email! I'd appreciate any feedback. It seems that there are a couple of small tweaks which would greatly improve the MPL TeX/PGF output, although they probably have side-effects of which I'm unaware: * Don't put tick labels in math mode by default (i.e. unless a special ticker is used). In our previous code, which I'm trying to reproduce in MPL, even exponent-format tick labels were typeset as "10$^\text{exp}$" which automatically gets the font weights and styles correct. Is the current \(\displaystyle etc. specified by the default ticker or is it specific to the PGF backend? * I checked a bit, and fontspec seems a bit ropey when it comes to changing math fonts to match the text font; I had to \usepackage[osf]{mathpazo} before importing fontspec to get a correctly weighted math font. mathspec is maybe worth investigation. Thanks in advance, and thanks for tolerating this plot-cosmetics obsessiveness ;-) Andy On 27/10/14 14:35, Andy Buckley wrote: > Hi, > > I'm using MPL to implement a new plotter for a project has so far been > using a custom-written LaTeX+pstricks script. Despite being slow and a > bit hacky, the output is really quite nice and I want to try and emulate > it as closely as possible via MPL; for example: > > https://users.hepforge.org/~buckley/atlas-py8-shower-e/ATLAS_2012_I1094568/d03-x02-y01.pdf > > I more or less have this working, but would really like to be able to > use the "old-style figures" (OSF) numerals with variable baseline (aka > lower-case or text figures cf. > http://en.wikipedia.org/wiki/Text_figures), which give those plots quite > a bit of their character. > > Probably this will anyway be possible only with the TeX or PGF backend > to MPL, but what would be the best way to enable OSF figures from MPL? > If I correctly understand the backend, the rc params font.family & e.g. > font.serif are passed to the LaTeX fontspec package -- and in the > fontspec documentation > http://mirror.utexas.edu/ctan/macros/latex/contrib/fontspec/fontspec.pdf > it seems that passing the Numbers=(OldStyle) option to the \fontspec > command (or as the arg to \addfontfeature) would be the fontspec version > of, for example, \usepackage[osf]{mathpazo}. Is there a way to pass > options like this to fontspec? In general this would seem a useful thing > to be able to do, since fontspec controls far more than OSFs, but I > couldn't find a discussion of it in the docs. > > Hope you can help; thanks! > Andy > -- Dr Andy Buckley, Royal Society University Research Fellow Particle Physics Expt Group, University of Glasgow / PH Dept, CERN |