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
(5) |
2
(23) |
3
(17) |
4
(14) |
5
(12) |
6
(2) |
7
(3) |
8
(7) |
9
(13) |
10
(19) |
11
(24) |
12
(28) |
13
(9) |
14
(5) |
15
(7) |
16
(17) |
17
(17) |
18
(15) |
19
(6) |
20
|
21
(7) |
22
(20) |
23
(6) |
24
(4) |
25
(5) |
26
(11) |
27
(1) |
28
(2) |
29
(14) |
30
(7) |
|
|
|
|
From: Eric E. <eem...@es...> - 2010-11-17 20:18:50
|
Dear Ben thanks a lot for this thoughful answer. When I use only "ipython" and not "ipython -pylab" IT WORKS!!! So this is a problem with "ipython -pylab" call... Any thought of why this is? I provide more info below thanks for any help there. Eric P.S.: Here is the output of my setup: In [1]: matplotlib.__file__ Out[1]: '/usr/lib64/python2.6/site-packages/matplotlib/__init__.pyc' In [6]: mpl_toolkits.mplot3d.__file__ Out[6]: '/usr/lib64/python2.6/site-packages/mpl_toolkits/mplot3d/__init__.pyc' A funny one is that I have to import mpl_toolkits first and then mplot3d, and when I do this I get: In [5]: from mpl_toolkits import mplot3d try this I am not sure the "try this" is meant to be there.... P.P.S.: Here is my detailed setup when I do ipython -pylab matplotlib data path /usr/lib64/python2.6/site-packages/matplotlib/mpl-data matplotlib version 1.0.0 verbose.level helpful interactive is False units is False platform is linux2 Your PyGtk has set_interactive(), so you can use the more stable single-threaded Gtk mode. See https://bugs.launchpad.net/ipython/+bug/270856 backend GTKAgg version 2.17.0 Python 2.6.5 (r265:79063, Jul 5 2010, 11:46:13) IPython 0.10 -- An enhanced Interactive Python. |
From: Benjamin R. <ben...@ou...> - 2010-11-17 18:51:10
|
On Wed, Nov 17, 2010 at 2:32 AM, Eric Emsellem <eem...@es...> wrote: > yes, it looks like this is the right file (when I look at > matplotlib.__file__) > > Now tracing which routines are run when doing this, it looks like it looks > for > projection in projections/__init__.py > after going through line 675 of figure.py > > It looks like add_subplot of plt.figure() is not compatible in my > matplotlib. > > Eric > > No, that code path is correct. The problem has to be that the registration is not occurring correctly. I would double-check that the filepath for matplotlib.__file__ and mpl_toolkits.mplot3d.__file__ matches. I am still convinced that we have an installation issue. My bet is that -- somehow -- mplot3d is being loaded from one version, while matplotlib is being loaded from another version. Another thing that might be complicating things is the use of ipython -pylab. If you aren't using pylab, then there really isn't much need to call that. Did you fully un-install matplotlib before building matplotlib from svn? If not, you might need to do a complete clean (package-wise and build-wise) before trying again. I notice that you are using OpenSUSE. We have been having a number of reports of problems from OpenSUSE users in the past month. Almost all of them appear to be packaging issues and not problems with matplotlib itself. I don't know if this is the case here, but who knows? I find this error to be fairly odd given how simple and fundamental the algorithm is. It is essentially a python dictionary containing name/class pairs. Kinda hard to break that. If you can verify that the Axes3D object is registering itself, and then the projection can't be found later, then there remains only two possibilities. First, that the dictionary being checked is different from the dictionary used to register the Axes3D class. Second, that the Axes3D entry got removed after being inserted. Considering that I am unaware of any code that deregisters a projection, I am inclined to believe that somehow we have different dictionary objects being accessed. This is the basis for my theory that the matplotlib installation is wonky because the matplotlib.pyplot that you import from your script might -- somehow -- be different from the matplotlib that is imported from mplot3d. Again, it makes little sense, but that is what is going through my mind right now. Anybody else have any thoughts? Ben Root |
From: Eric F. <ef...@ha...> - 2010-11-17 18:20:26
|
On 11/17/2010 07:35 AM, Ognjen Ilic wrote: > Hello all, > > I posted about this problem on another forum (with an image attachment) > http://python-forum.org/pythonforum/viewtopic.php?f=18&t=21951&p=99290#p99290 > > In the figure below white space that forms a trapezoid to the right > (slope then constant) and tear-shape white space to the left (due to > maxZ being too small) are expected and I have no issues with that. > The weird things are the sharp white shapes to the left. They are very > irregular and with a little different change in parameters they appear > at different places. This looks like the path simplification bug that was fixed some time before mpl 1.0. You can upgrade, or as a workaround you can turn off path simplification by putting path.simplify : False in your matplotlibrc file, or by using matplotlib.rcParams['path.simplify'] = False in your script. Eric > > Below are the relevant pieces of code > > Code: Select all > import matplotlib.pyplot as plt > import matplotlib.colors as colors > ... > z = numpy.transpose(z) > z = numpy.ma.masked_where(z<=0, z) > levels = numpy.linspace(0,maxZ,50) > cset1=plt.contourf(x,y,z,levels,cmap=plt.get_cmap('jet',len(levels)-1)) > plt.colorbar(cset1) > fname = 'pic.png' > plt.savefig(fname) > > > > Above, z is the 2D array of values for different x and y (both lists > have 400 elements each). > Ths is really really confusing me. Any help is greatly appreciated! > > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2& L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > > > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Ognjen I. <ogn...@gm...> - 2010-11-17 17:35:56
|
Hello all, I posted about this problem on another forum (with an image attachment) http://python-forum.org/pythonforum/viewtopic.php?f=18&t=21951&p=99290#p99290 In the figure below white space that forms a trapezoid to the right (slope then constant) and tear-shape white space to the left (due to maxZ being too small) are expected and I have no issues with that. The weird things are the sharp white shapes to the left. They are very irregular and with a little different change in parameters they appear at different places. Below are the relevant pieces of code Code: Select all import matplotlib.pyplot as plt import matplotlib.colors as colors ... z = numpy.transpose(z) z = numpy.ma.masked_where(z<=0, z) levels = numpy.linspace(0,maxZ,50) cset1=plt.contourf(x,y,z,levels,cmap=plt.get_cmap('jet',len(levels)-1)) plt.colorbar(cset1) fname = 'pic.png' plt.savefig(fname) Above, z is the 2D array of values for different x and y (both lists have 400 elements each). Ths is really really confusing me. Any help is greatly appreciated! |
From: Roban H. K. <rob...@ph...> - 2010-11-17 15:02:24
|
There is numpy.histogram, which will give you the histogram without the plots. But I have had little trouble using hist on log-log plots: Try this (in ipython -pylab or with ">>> from pylab import *; import numpy"): >>> x = numpy.random.lognormal(size=1e4) >>> bins = logspace(-1.5, 1.5, 100) >>> hist(x, histtype='step', bins=bins) >>> xscale('log') >>> yscale('log') >>> show() -Roban On Wed, Nov 17, 2010 at 2:23 PM, Davide Fiocco <dav...@gm...> wrote: > Hi folks, > > I want to bin sevaral arrays of data and superimpose them in a single plot. > The simplest approach is to fire several times >> hist(data_i, N) > > My problem is that I want to make a loglog plot (i.e. putting a > logscale on the X axis too, something that hist doesn't allow me to > do). > > So what I've done so far is extracting the bin coordinates from > hist(data_i, N)[1], extract histogram values using hist(data_i, N)[0] > and then a loglog plot them one against each other. > > The point is that I have to invoke at least once the command > hist(data_i, N) in order to do so, and this draws patches on my figure > which I don't want to appear on my final plot. > > How do I delete the histogram bars? In other words, how to I delete an > entire histogram from my plot? > > Other suggestions to have this sort of "loglog histogram" in a few > lines of code are more than welcome, of course. > > Cheers, > > Davide > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Roban Hultman Kramer | Zwicky Fellow | Institute for Astronomy ETH Zürich (Swiss Federal Institute of Technology) |
From: Benjamin R. <ben...@ou...> - 2010-11-17 14:45:12
|
On Wed, Nov 17, 2010 at 5:45 AM, Matthias Plum <pl...@ph...>wrote: > Hi > > I am trying to plot data on the sphere and use the hammer projection. > The data ploting works fine, but the angular grid isn't shown correctly. > In the attached picture you can see the error(mouse pointer is on the > position 60 E 30 S). Can anyone help me on this subject? Thanks. > > Matthias > > Matthias, Looking at the transform equation for Hammer, it looks like there might be a mistake in the calculation. Can you include the script you used to make that figure so I can test the fix? Thanks, Ben Root |
From: Davide F. <dav...@gm...> - 2010-11-17 13:23:26
|
Hi folks, I want to bin sevaral arrays of data and superimpose them in a single plot. The simplest approach is to fire several times > hist(data_i, N) My problem is that I want to make a loglog plot (i.e. putting a logscale on the X axis too, something that hist doesn't allow me to do). So what I've done so far is extracting the bin coordinates from hist(data_i, N)[1], extract histogram values using hist(data_i, N)[0] and then a loglog plot them one against each other. The point is that I have to invoke at least once the command hist(data_i, N) in order to do so, and this draws patches on my figure which I don't want to appear on my final plot. How do I delete the histogram bars? In other words, how to I delete an entire histogram from my plot? Other suggestions to have this sort of "loglog histogram" in a few lines of code are more than welcome, of course. Cheers, Davide |
From: John H. <jd...@gm...> - 2010-11-17 11:55:30
|
On Wed, Nov 17, 2010 at 2:29 AM, Tim Åberg <qw...@ho...> wrote: > Hello! > > I have now been tampering with a custom formatter and the more i think about > it the more i feel there must be a more easy soulution. I have a set of > values that are plotted over time (i use date2num, to get the conversion > from date to num), i also have a list with dates that corresponds to these > values; > ['2010-11-05 10:27:45.605000', '2010-11-05 10:27:50.576000', '2010-11-05 > 10:27:55.913000'], this to not have to do a conversion back, i imagine its > the most effective way to do it. > > Now to the question; > > The only two values in the datelist that is vital is the first and the last, > in between i really just want to have values that corresponds lineary. Thats > brings me to resoulution, if the values are far far in between, say weeks or > even moth the time (h:s:ms) isnt so important and vice versa. > > Is there any formatter that do this sort of things? eg. takes in two > values(dates) and format it by itself. Take a look at this example http://matplotlib.sourceforge.net/examples/api/date_index_formatter.html It's trying to solve a different but related problem: in financial time series you only have data on Monday - Friday, and you don't want to plot the gaps on weekends. So you plot the data linearly with an index, and use a custom locator and formatter to set and format the ticks. JDH |
From: Matthias P. <pl...@ph...> - 2010-11-17 11:45:34
|
Hi I am trying to plot data on the sphere and use the hammer projection. The data ploting works fine, but the angular grid isn't shown correctly. In the attached picture you can see the error(mouse pointer is on the position 60 E 30 S). Can anyone help me on this subject? Thanks. Matthias |
From: Tim Å. <qw...@ho...> - 2010-11-17 10:21:47
|
I just checked it up, and it had some nice function, the timeseries looked nice and maybe i can use it in some way (time_series looked interesting) . I dont want to go away from Linecollection way of plotting due to its speed or is the timeseries-way a fast way of plotting? Date: Wed, 17 Nov 2010 09:55:13 +0100 Subject: Re: [Matplotlib-users] Formatter dates From: pgm...@gm... To: qw...@ho... Tim, have you tried the scikits.timeseries package? Its plotting capacities, albeit limited, may be helpful in your case... On Nov 17, 2010 9:31 AM, "Tim Åberg" <qw...@ho...> wrote: > > Hello! > > I have now been tampering with a custom formatter and the more i think about it the more i feel there must be a more easy soulution. I have a set of values that are plotted over time (i use date2num, to get the conversion from date to num), i also have a list with dates that corresponds to these values; > ['2010-11-05 10:27:45.605000', '2010-11-05 10:27:50.576000', '2010-11-05 10:27:55.913000'], this to not have to do a conversion back, i imagine its the most effective way to do it. > > Now to the question; > > The only two values in the datelist that is vital is the first and the last, in between i really just want to have values that corresponds lineary. Thats brings me to resoulution, if the values are far far in between, say weeks or even moth the time (h:s:ms) isnt so important and vice versa. > > Is there any formatter that do this sort of things? eg. takes in two values(dates) and format it by itself. > > // Tim > |
From: Eric E. <eem...@es...> - 2010-11-17 08:31:00
|
yes, it looks like this is the right file (when I look at matplotlib.__file__) Now tracing which routines are run when doing this, it looks like it looks for projection in projections/__init__.py after going through line 675 of figure.py It looks like add_subplot of plt.figure() is not compatible in my matplotlib. Eric > Strange indeed. Ok, what does matplotlib.__file__ say? Does the > filename match the path you are expecting? At this point, I would also > try putting print statements in the register code at the end of > axes3d.py to see if that code path gets executed (can't see why not). > > Ben Root > |
From: Tim Å. <qw...@ho...> - 2010-11-17 08:29:31
|
Hello! I have now been tampering with a custom formatter and the more i think about it the more i feel there must be a more easy soulution. I have a set of values that are plotted over time (i use date2num, to get the conversion from date to num), i also have a list with dates that corresponds to these values; ['2010-11-05 10:27:45.605000', '2010-11-05 10:27:50.576000', '2010-11-05 10:27:55.913000'], this to not have to do a conversion back, i imagine its the most effective way to do it. Now to the question; The only two values in the datelist that is vital is the first and the last, in between i really just want to have values that corresponds lineary. Thats brings me to resoulution, if the values are far far in between, say weeks or even moth the time (h:s:ms) isnt so important and vice versa. Is there any formatter that do this sort of things? eg. takes in two values(dates) and format it by itself. // Tim |
From: Ryan M. <rm...@gm...> - 2010-11-17 04:32:36
|
Hi, I spent a fair amount of time today debugging what I thought was a bug in the scaling of psd() when I was using NFFT to specify zero-padding. This was a mis-use of the code on my part, where I should have been using pad_to to get zero-padding. Most embarassing about this is that I'm basically the maintainer of record for this code and responsible for the most recent changes, part of which improved 0-padding. (> 2 years ago) I've come to the conclusion that if I was able to get it wrong, it's likely that this issue has bitten and will bite other users. The problem stems from the fact that the code underlying psd (and csd, etc.) will gladly pad your data to NFFT if len(x) < NFFT. The extra 0's added here throw off the scaling (whereas using pad_to does not). [Aside for the curious: The NFFT-padding code pre-dates the use of pad_to for zero-padding and was left so-as not to break code, not realizing that leaving it was still wrong.] Options: 1) Rip out the code that does the zero-padding based on NFFT and raise an exception in the case that len(x) < NFFT. 2) Issue a warning on len(x) < NFFT for awhile, and then rip it out. 3) ? I'm really tempted to just go with 1), with an exception that details the problem and the fix. While this would break existing code, this code is almost 100% guaranteed to be broken and silently producing the incorrect answer (unless code was already hacking around our broken-ness, which wouldn't be easy.) I still need to go through and convince myself that there's not some use-case where NFFT > len(x) would produce correct and desired behavior, which isn't covered by pad_to. What I'm looking for is thoughts from devs on breaking backwards compatibility and from users, whose code may or may not be broken by such a change. Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma |
From: Benjamin R. <ben...@ou...> - 2010-11-16 22:07:01
|
On Tue, Nov 16, 2010 at 12:01 PM, Nicolas Bigaouette <nbi...@gm...>wrote: > Hi all, > > I have defined some shortcuts I often use using pylab.ginput(). I normally > do: > >> fig = pylab.figure() > > fig.canvas.mpl_connect('key_press_event', on_key) > > with my "on_key" function being (simplified): > >> def on_key(event): > > if (event.key == 'q'): > > sys.exit(0) > > elif (event.key == 'w'): > > pylab.close(pylab.gcf()) > > elif (event.key == 'd'): > > print "Please click two points to get the distance and slope." > > points = pylab.ginput(n=2, show_clicks=True) > > [...] > > pylab.plot([points[0][0], points[1][0]], [points[0][1], >> points[1][1]], '+r', lw=1.0) > > pylab.plot([points[0][0], points[1][0]], [points[0][1], >> points[1][1]], '--r', lw=1.0) > > pylab.draw() > > > I'm plotting two markers where the user clicked and a line between them. > > This works fine, except when there is multiple subplots. I can correctly > select points and get their position, but the plot commands will put the > markers+line in the last subplot. I tried using "pylab.gca().plot()" but > gca() always returns the last axes. > > My question is, how can I plot on the axes the user clicked on? > > Thank you! > > While this isn't in the same approach you were going, you could continue to use mpl_connect instead of ginput. If you create connections (and properly disconnect as well) 'button_press_event' and 'button_release_event', you can then utilize the event.inaxes property of the event object. This has an added advantage of making sure that the mouse click events are inside the axes. Another approach might be to find out the bbox's of all the subplot axes and see if a coordinate falls inside any of those. Ben Root |
From: Kurt M. <kur...@su...> - 2010-11-16 19:15:56
|
Now I found a solution: From the Education Repository of openSuse: "URL: http://download.opensuse.org/repositories/Education/openSUSE_11.3/" Install the packages: - python-numpy - python-matplotlib These two seems to work together. Have a nice day -- mu...@pr... |
From: Stan W. <sta...@nr...> - 2010-11-16 18:43:41
|
> From: Gianfranco Durin [mailto:g....@in...] > Sent: Wednesday, November 10, 2010 11:32 > > Dear mpl users, > I have the following problem to solve. Imagine to have the > simple example reported on website plotting the errorbars of > some x,y data: ... > and if I change, for instance, y: > > y = y/2. > > I can easily replace the x,y with: > > p[0].set_data(x,y) > > but I do not know how to do the same for the errorbars. I believe I see how you could do it. The errorbar call returns the tuple p = (plotline, caplines, barlinecols) [1], and to update the errorbars, you must modify the objects in the caplines and barlinecols lists. Each element of the caplines list is a Line2D artist [2] for the left, right, top, or bottom caps; you can use its methods set_data, set_xdata, or set_ydata to modify its coordinates, as you did for the main line. Each element of the barlinecols list is a LineCollection [3] artist responsible for all of the x or y errorbars; you can use the set_segments method to provide new coordinates. [1] http://matplotlib.sourceforge.net/api/axes_api.html#matplotlib.axes.Axes.error bar [2] http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.lines.Line2D [3] http://matplotlib.sourceforge.net/api/collections_api.html#matplotlib.collecti ons.LineCollection |
From: Nicolas B. <nbi...@gm...> - 2010-11-16 18:01:31
|
Hi all, I have defined some shortcuts I often use using pylab.ginput(). I normally do: > fig = pylab.figure() fig.canvas.mpl_connect('key_press_event', on_key) with my "on_key" function being (simplified): > def on_key(event): if (event.key == 'q'): sys.exit(0) elif (event.key == 'w'): pylab.close(pylab.gcf()) elif (event.key == 'd'): print "Please click two points to get the distance and slope." points = pylab.ginput(n=2, show_clicks=True) [...] pylab.plot([points[0][0], points[1][0]], [points[0][1], > points[1][1]], '+r', lw=1.0) pylab.plot([points[0][0], points[1][0]], [points[0][1], > points[1][1]], '--r', lw=1.0) pylab.draw() I'm plotting two markers where the user clicked and a line between them. This works fine, except when there is multiple subplots. I can correctly select points and get their position, but the plot commands will put the markers+line in the last subplot. I tried using "pylab.gca().plot()" but gca() always returns the last axes. My question is, how can I plot on the axes the user clicked on? Thank you! N |
From: Eric E. <eem...@es...> - 2010-11-16 17:50:58
|
Dear Ben thanks a lot for the quick reply. I did that (and read some posts on the web) but no luck, as it says: 1.0.0 I in fact just went back to my openSuse 11.3 (Science repo) version because it went really wrong with scipy etc and I didn't want to mess up my setup. But still the same message with the Unknown projection. I have checked the axes3d.py in my mpl_toolkits and it has the "name = '3d'" at the beginning and the register at the end... ??? Eric > Could you please execute the following: > > import matplotlib > print matplotlib.__version__ > > and report back what it says? I suspect that when you installed the svn > version, the original version of matplotlib is still getting loaded. > The projection='3d' feature is brand new to 1.0.0. > > Ben Root |
From: Benjamin R. <ben...@ou...> - 2010-11-16 17:29:44
|
On Tue, Nov 16, 2010 at 11:24 AM, Eric Emsellem <eem...@es...> wrote: > Dear Ben > > thanks a lot for the quick reply. > > I did that (and read some posts on the web) but no luck, as it says: > > 1.0.0 > > I in fact just went back to my openSuse 11.3 (Science repo) version because > it went really wrong with scipy etc and I didn't want to mess up my setup. > But still the same message with the Unknown projection. > > I have checked the axes3d.py in my mpl_toolkits and it has the "name = > '3d'" at the beginning and the register at the end... > > ??? > > > Eric > > Could you please execute the following: >> >> import matplotlib >> print matplotlib.__version__ >> >> and report back what it says? I suspect that when you installed the svn >> version, the original version of matplotlib is still getting loaded. >> The projection='3d' feature is brand new to 1.0.0. >> >> Ben Root >> > Strange indeed. Ok, what does matplotlib.__file__ say? Does the filename match the path you are expecting? At this point, I would also try putting print statements in the register code at the end of axes3d.py to see if that code path gets executed (can't see why not). Ben Root |
From: Benjamin R. <ben...@ou...> - 2010-11-16 17:10:01
|
On Tue, Nov 16, 2010 at 10:48 AM, Eric Emsellem <eem...@es...> wrote: > Hi, > > I have just installed the svn version of matplotlib and basemap + numpy > from the > svn repository of > > http://download.opensuse.org/repositories/home:/ocefpaf/openSUSE_11.3/x86_64/ > > When I do: > ======================================================= > ipython -pylab > (matplotlib 1.0.0, backend GTKAgg version 2.17.0, openSuse 11.3 x86_64) > > import numpy as np > from mpl_toolkits.mplot3d import Axes3D > import matplotlib.pyplot as plt > > fig = plt.figure() > ax = fig.add_subplot(111, projection='3d') > ======================================================== > I get a > > ValueError: Unknown projection '3d' > > I did the upgrade to the svn version because the previous one (which was > already > 1.0) gave me the same message... > > what's wrong here? > (looked at the web and couldn't find out a good solution, beyond the > upgrade I did) > > thanks in advance > Eric > > > Eric, Could you please execute the following: import matplotlib print matplotlib.__version__ and report back what it says? I suspect that when you installed the svn version, the original version of matplotlib is still getting loaded. The projection='3d' feature is brand new to 1.0.0. Ben Root |
From: Eric E. <eem...@es...> - 2010-11-16 16:48:25
|
Hi, I have just installed the svn version of matplotlib and basemap + numpy from the svn repository of http://download.opensuse.org/repositories/home:/ocefpaf/openSUSE_11.3/x86_64/ When I do: ======================================================= ipython -pylab (matplotlib 1.0.0, backend GTKAgg version 2.17.0, openSuse 11.3 x86_64) import numpy as np from mpl_toolkits.mplot3d import Axes3D import matplotlib.pyplot as plt fig = plt.figure() ax = fig.add_subplot(111, projection='3d') ======================================================== I get a ValueError: Unknown projection '3d' I did the upgrade to the svn version because the previous one (which was already 1.0) gave me the same message... what's wrong here? (looked at the web and couldn't find out a good solution, beyond the upgrade I did) thanks in advance Eric |
From: Benjamin R. <ben...@ou...> - 2010-11-16 15:57:02
|
On Sun, Nov 14, 2010 at 5:17 PM, Kornél Jahn <kja...@gm...> wrote: > Hello, > I would like to plot the polarization state of a two-dimensional vector > field (linear, circular or generally elliptic), similarly to that seen on > this ZEMAX plot: > http://www.zemax.com/UserFiles/Image/UI/pol_pupil.gif > It looks like some kind of enhanced quiver plot: a small line with arrows > at both ends points out the local direction of linear polarization, while a > directed ellipse with a given orientation of its axes depicts local > elliptical polarization state (which becomes a circle for circular > polarization). > > I am a novice matplotlib user, please give me some advice on how to start > with implementing such a plot (what to read, API examples to look at etc.) > > Thanks, > Kornel JAHN > > Hmm, interesting idea. quiver.py is certainly the right place to start, but I think there is one key missing feature in matplotlib: I haven't a clue how one would draw a arrow in an ellipse shape. As far as I know, such an arrow style isn't possible. What you could do instead is to create a new class that is based on the ellipse collection instead of the Quiver class. Once you get just basic ellipses drawn, then maybe you can add some lines to the ellipses to indicate the direction of spin, much like how the barbs are drawn in the Barbs class. I hope this is helpful. Ben Root |
From: Guy G. <guy...@re...> - 2010-11-16 15:50:24
|
On Tuesday 16 Nov 2010 15:35:31 Benjamin Root wrote: > On Mon, Nov 15, 2010 at 4:14 AM, Guy Griffiths > > <guy...@re...>wrote: > > On Friday 12 Nov 2010 15:20:43 Ryan May wrote: > > > On Fri, Nov 12, 2010 at 8:40 AM, Benjamin Root <ben...@ou...> wrote: > > > > On Fri, Nov 12, 2010 at 5:11 AM, Guy Griffiths > > > > <guy...@re...> > > > > > > > > wrote: > > > >> Hi, > > > >> > > > >> I've been using matplotlib for a while for plotting scientific data, > > > > and > > > > > >> recently upgraded from version 0.99.1.1 to 1.0.0. Primarily I use > > > >> pcolor to > > > >> produce plots of concentration in 2D space. I use reasonably fine > > > >> meshes, and > > > >> in v0.99.1.1 the output looked great. > > > >> > > > >> In v1.0.0, all of my plots (using the same code) have faint > > > >> gridlines visible. > > > >> Since the mesh I am using is quite fine, this makes the plots look > > > >> terrible > > > >> (i.e. more gridlines than actual data). This seems to be controlled > > > > by > > > > > >> the > > > >> "edgecolors" keyword, but even when set to 'none' they are still > > > > there. > > > > > >> Is > > > >> > > > >> there any way to remove them completely without reverting back to > > > >> 0.99.1.1 (which I'd prefer not to do, since some of the API changes > > > > are > > > > > >> really useful > > > >> for creating very polished graphs suitable for publication)? > > > >> > > > >> imshow seems to have closer results to what I want (i.e. no > > > > gridlines), > > > > > >> but > > > >> with imshow, the axes denote the pixel position, and there is no > > > > option > > > > > >> to display on polar axes (which is essential). > > > >> > > > >> Any help would be much appreciated. > > > >> > > > >> Regards, > > > >> > > > >> Guy Griffiths > > > > > > > > Guy, I have noticed something similar a few months ago with pcolor, > > > > but > > > > I > > > > > > am not certain if it is the same problem as yours. First, which > > > > backend > > > > > > are you using? Second, are you seeing the grid lines in both the > > > > figure > > > > > > window and the saved output? Also, what format are you saving your > > > > output to? Lastly, which pcolor function are you using (pcolor(), > > > > pcolormesh(), pcolorfast())? > > > > > > > > If you could include a screenshot or the saved file, I could see if > > > > it > > > > is > > > > > > similar to my problem. > > > > > > Yeah, I had noticed a problem with pcolor too. You can see the problem > > > > > I've been seeing here: > > http://matplotlib.sourceforge.net/examples/pylab_examples/pcolor_demo.htm > > l > > > > > Calling pcolor with antialiased=False removes the lines, but that's > > > just a workaround, not a solution. I'm not really sure where to start > > > to track this down, so if anyone has a suggestion, I'm all ears. > > > > > > Ryan > > > > Hi, > > > > Thanks for the help. The problem I'm seeing is as Ryan describes (same > > effect > > as in the screenshot, but let me know if you still want me to provide an > > example), and appears in both the figure window and saved output (at > > least png > > and pdf). The backend I am using is Qt/Agg. I was using pcolor(), but > > it appears that pcolormesh() doesn't (always) have this problem. > > Setting antialiased=False removes some of the problems. In summary: > > > > pcolor(), antialiased=True - lines on screen, png, pdf > > pcolor(), antialiased=False - lines on pdf, fine on png/screen > > pcolormesh() - lines on pdf, fine on png/screen > > > > Regards, > > > > Guy > > Guy, > > I found my old bug report on this visual artifact. Oddly enough, the > problem for me was with pcolormesh, not with pcolor. There is a script > attached to the report that tests 4 combinations of function calls and > rasterized=True. Could you see how it turns out for you? > > Thanks, > Ben Root Ben, I've run the script attached to the bug report. The results I got were as follows: PNG - Artifacts on both pcolor() plots, no artifacts on either pcolormesh() plot PDF - Artifacts on pcolor() and pcolormesh() with rasterized=False. Less obvious artifacts on pcolor() with rasterized=True. No artifacts on pcolormesh() with rasterized=True EPS - Artifacts on pcolor() with rasterized=True. All others fine SVG - Artifacts on pcolor() and pcolormesh() with rasterized=False. More obvious artifacts on pcolor() with rasterized=True. No artifacts on pcolormesh() with rasterized=True Hope this is helpful. Cheers, Guy |
From: Benjamin R. <ben...@ou...> - 2010-11-16 15:35:58
|
On Mon, Nov 15, 2010 at 4:14 AM, Guy Griffiths <guy...@re...>wrote: > > On Friday 12 Nov 2010 15:20:43 Ryan May wrote: > > On Fri, Nov 12, 2010 at 8:40 AM, Benjamin Root <ben...@ou...> wrote: > > > On Fri, Nov 12, 2010 at 5:11 AM, Guy Griffiths > > > <guy...@re...> > > > > > > wrote: > > >> Hi, > > >> > > >> I've been using matplotlib for a while for plotting scientific data, > and > > >> recently upgraded from version 0.99.1.1 to 1.0.0. Primarily I use > > >> pcolor to > > >> produce plots of concentration in 2D space. I use reasonably fine > > >> meshes, and > > >> in v0.99.1.1 the output looked great. > > >> > > >> In v1.0.0, all of my plots (using the same code) have faint gridlines > > >> visible. > > >> Since the mesh I am using is quite fine, this makes the plots look > > >> terrible > > >> (i.e. more gridlines than actual data). This seems to be controlled > by > > >> the > > >> "edgecolors" keyword, but even when set to 'none' they are still > there. > > >> Is > > >> there any way to remove them completely without reverting back to > > >> 0.99.1.1 (which I'd prefer not to do, since some of the API changes > are > > >> really useful > > >> for creating very polished graphs suitable for publication)? > > >> > > >> imshow seems to have closer results to what I want (i.e. no > gridlines), > > >> but > > >> with imshow, the axes denote the pixel position, and there is no > option > > >> to display on polar axes (which is essential). > > >> > > >> Any help would be much appreciated. > > >> > > >> Regards, > > >> > > >> Guy Griffiths > > > > > > Guy, I have noticed something similar a few months ago with pcolor, but > I > > > am not certain if it is the same problem as yours. First, which > backend > > > are you using? Second, are you seeing the grid lines in both the > figure > > > window and the saved output? Also, what format are you saving your > > > output to? Lastly, which pcolor function are you using (pcolor(), > > > pcolormesh(), pcolorfast())? > > > > > > If you could include a screenshot or the saved file, I could see if it > is > > > similar to my problem. > > > > Yeah, I had noticed a problem with pcolor too. You can see the problem > > I've been seeing here: > > > > > http://matplotlib.sourceforge.net/examples/pylab_examples/pcolor_demo.html > > > > Calling pcolor with antialiased=False removes the lines, but that's > > just a workaround, not a solution. I'm not really sure where to start > > to track this down, so if anyone has a suggestion, I'm all ears. > > > > Ryan > > Hi, > > Thanks for the help. The problem I'm seeing is as Ryan describes (same > effect > as in the screenshot, but let me know if you still want me to provide an > example), and appears in both the figure window and saved output (at least > png > and pdf). The backend I am using is Qt/Agg. I was using pcolor(), but it > appears that pcolormesh() doesn't (always) have this problem. Setting > antialiased=False removes some of the problems. In summary: > > pcolor(), antialiased=True - lines on screen, png, pdf > pcolor(), antialiased=False - lines on pdf, fine on png/screen > pcolormesh() - lines on pdf, fine on png/screen > > Regards, > > Guy > Guy, I found my old bug report on this visual artifact. Oddly enough, the problem for me was with pcolormesh, not with pcolor. There is a script attached to the report that tests 4 combinations of function calls and rasterized=True. Could you see how it turns out for you? Thanks, Ben Root |
From: Benjamin R. <ben...@ou...> - 2010-11-16 15:32:54
|
On Tue, Nov 16, 2010 at 8:27 AM, Marc Petersen <pet...@ya...>wrote: > Hi, > > is there a solution for using matplotlib within pyside like it is > possible with pyqt4? > > Greetz > Marc > > Marc, Haven't tried it myself, but someone else did ask this a few months ago. http://old.nabble.com/Matplotlib-and-PySide---td29716125.html He didn't get far, but maybe you might have more luck? Ben Root |