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
(38) |
2
(31) |
3
(9) |
|
4
(13) |
5
(24) |
6
(11) |
7
(8) |
8
(14) |
9
(7) |
10
(4) |
|
11
(7) |
12
(11) |
13
(16) |
14
(19) |
15
(11) |
16
(9) |
17
(3) |
|
18
(4) |
19
(47) |
20
(28) |
21
(9) |
22
(9) |
23
(11) |
24
|
|
25
|
26
(12) |
27
(22) |
28
(20) |
29
(16) |
30
(19) |
|
|
From: Jae-Joon L. <lee...@gm...> - 2010-04-26 18:29:20
|
On Fri, Apr 23, 2010 at 11:07 AM, Thomas Robitaille
<tho...@gm...> wrote:
> Hi,
>
> I'm having issues with translucent patches. The following code
>
> import matplotlib
> matplotlib.use('Agg')
> import matplotlib.pyplot as mpl
> from matplotlib.patches import Circle
>
> fig = mpl.figure()
> ax = fig.add_subplot(111)
> c = Circle((0.25,0.5), radius=0.2, facecolor='none', edgecolor='green', alpha=0.2)
> ax.add_patch(c)
> c = Circle((0.75,0.5), radius=0.2, facecolor='blue', edgecolor='green', alpha=0.2)
> ax.add_patch(c)
> fig.savefig('test_alpha.png')
>
> Produces a plot where the two circles have different borders - the left circle has a border with alpha=1.0 and the right circle has a border with alpha=0.2. Should I submit this as a bug report?
>
This is kind of a known bug.
http://old.nabble.com/patches-have-incorrect-alpha-values-td22667217.html#a22667217
But, please go ahead and file a bug report.
Fixing this requires some changes in backend api, and I'm not sure if
this will be fixed soon.
Regards,
-JJ
|
|
From: Mathew Y. <mat...@gm...> - 2010-04-26 17:57:29
|
Hi In an embedded application, I want to have a number of FigureCanvas s inside a scrolled window. But the FigureCanvas s always resize to fit inside my main window. I've tried intercepting resize requests but nothing seems to work. Any ideas? Mathew |
|
From: KrishnaPribadi <Kri...@ha...> - 2010-04-26 16:59:47
|
Peter Buschman-2 wrote: > > > I ended up finding a solution to this by using a FixedLocator and > manually setting each of the tick > positions for both major and minor grids without overlap. > > I'm not sure if this is the recommended way to do this, but hey, it worked > ;-) > > for tick in range(seconds+1)[1:]: > if tick % major_multiple == 0: > xmajorticks.append(tick) > elif tick % minor_multiple == 0: > xminorticks.append(tick) > > ax.xaxis.set_major_locator(FixedLocator(xmajorticks)) > ax.xaxis.set_minor_locator(FixedLocator(xminorticks)) > > Hi there, I know this is an old post, but I'm also trying to do something similar, but using different linestyles for the major and minor grids. Has anyone figured out code that's more efficient than this? It seems that this can slow down my application's data "load time". Also, since I'm using the zoom widget, I'm not certain if this will work if the tick markers change If I change my x limits... Any thoughts? ----- Krishna Adrianto Pribadi Test Engineer Harley-Davidson Motor Co. Talladega Test Facility Vehicle Test Stands -- View this message in context: http://old.nabble.com/Setting-color-of-both-major-and-minor-gridlines--tp9475256p28367421.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
|
From: Nikolaus R. <Nik...@ra...> - 2010-04-26 15:37:17
|
Hello,
I have 2d array with fourier amplitudes that I would like to plot. I
found two options: contourf and imshow. This is my code:
omega = np.fft.rfftn(b_field, axes=(1, 0))
omega = np.abs(np.fft.fftshift(omega, axes=(1,)))
fig = plt.figure()
ax = fig.add_subplot(111)
M = omega.shape[0]
N = omega.shape[1]
ax.set_title('Spectrum')
ax.set_ylabel(r'Poloidal Mode Number m')
ax.set_xlabel(r'Toroidal Mode Number n')
ax.grid(True)
# Get rid of normalization
omega /= np.prod(omega.shape)
The problem with contourf is that I can't seem to stop it from
strongly interpolating the data, which obscures the discrete nature:
(see www.rath.org/contourf.png)
ctr = ax.contourf(np.arange(-N / 2, N / 2),
np.arange(0, M),
omega * 10000, 100, cmap=cm.YlOrRd, interpolation='nearest')
fig.colorbar(ctr)
ax.set_xlim(xmin= -(N - 1) / 2, xmax=(N - 1) / 2)
ax.set_ylim(ymin=0, ymax=M - 1)
fig.show()
Apparently contourf does not accept the interpolation='nearest' option.
Is there a way to make it stop interpolating?
The problem with imshow is, that it rescales the data so the
colorbar does not show the correct amplitudes (see
www.rath.org/imshow.png):
ctr = ax.imshow(omega, cmap=cm.YlOrRd, aspect='equal', interpolation='nearest',
origin='lower', extent=(-(N-1)/2, (N-1)/2, 0, M-1))
fig.colorbar(ctr)
ax.set_xlim(xmin= -(N - 1) / 2, xmax=(N - 1) / 2)
ax.set_ylim(ymin=0, ymax=M - 1)
fig.show()
Is there a way to get the proper amplitudes into the colorbar?
Thanks!
-Nikolaus
--
»Time flies like an arrow, fruit flies like a Banana.«
PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C
|
|
From: T J <tj...@gm...> - 2010-04-26 06:38:09
|
Not sure when this occurred, but I just updated to the latest SVN and
still see the issue:
I am no longer able to save transparent figure---specifically, I
need no patch drawn for the figure and axis when saving to EPS.
>>> savefig('test.eps', transparent=True)
The above should work, but it doesn't.. Explicitly setting the patch
colors to 'none' doesn't work either.
Anyone else seeing this?
|
|
From: Eric F. <ef...@ha...> - 2010-04-23 20:40:36
|
Tom Aldcroft wrote: > I've run into a case where the rendering in a line plot is incomplete > and some lines are not drawn at all. Basically I have a dataset (see > below) where I know two points go to a value of zero. When I plot > the points and do interactive pan/zoom sometimes the line going down > to zero is there and sometimes not. After a bunch of playing around > trying to reduce the problem to a minimum the script below is what I > got. If I tried to make the 'y' array much smaller then the problem > went away. I played with antialias and interactive settings with no > benefit. Changing the window size can also produce the same effect > I'm describing. Finally, when I use savefig to save in various > formats the results varied, perhaps just a side-effect of the size of > the saved figure. > > I'm using Matplotlib 0.99.1.1 built from source with the TkAgg backend > on CentOS-5 with python 2.6. This same problem was also evident using > GtkAgg and MacOSX backends so I don't think the details of my build > are relevant (but I can supply if needed). > > Thanks, Tom It works for me in svn, so I am pretty sure you have run into the infamous path simplification bug. If you are building from source anyway, then just build from svn. Alternatively, you can put path.simplify : False in your matplotlibrc file to disable path simplification. Eric > > import numpy > import matplotlib.pyplot as plt > > y = numpy.array([ > 4., 2., 2., 3., 3., 2., 2., 6., 6., 5., 5., 4., 4., > 7., 7., 2., 2., 4., 4., 2., 2., 2., 2., 4., 4., 4., > 4., 4., 4., 7., 7., 3., 3., 5., 5., 4., 4., 5., 5., > 4., 4., 7., 7., 6., 6., 2., 2., 2., 2., 5., 5., 4., > 4., 4., 4., 6., 6., 3., 3., 4., 4., 3., 3., 2., 2., > 3., 3., 4., 4., 4., 4., 4., 4., 6., 6., 5., 5., 4., > 4., 7., 7., 3., 3., 4., 4., 4., 4., 5., 5., 4., 4., > 7., 7., 3., 3., 4., 4., 4., 4., 6., 6., 4., 4., 4., > 4., 4., 4., 2., 2., 5., 5., 6., 6., 3., 3., 5., 5., > 4., 4., 0., 0., 5., 5., 1., 1., 4., 4., 5., 5., 4.]) > > plt.figure() > plt.plot(y) > > plt.figure() > plt.plot(y) > plt.xlim(-7200, 6500) > # Does it go down to 0 now? > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
|
From: Tom A. <ald...@he...> - 2010-04-23 19:44:40
|
I've run into a case where the rendering in a line plot is incomplete and some lines are not drawn at all. Basically I have a dataset (see below) where I know two points go to a value of zero. When I plot the points and do interactive pan/zoom sometimes the line going down to zero is there and sometimes not. After a bunch of playing around trying to reduce the problem to a minimum the script below is what I got. If I tried to make the 'y' array much smaller then the problem went away. I played with antialias and interactive settings with no benefit. Changing the window size can also produce the same effect I'm describing. Finally, when I use savefig to save in various formats the results varied, perhaps just a side-effect of the size of the saved figure. I'm using Matplotlib 0.99.1.1 built from source with the TkAgg backend on CentOS-5 with python 2.6. This same problem was also evident using GtkAgg and MacOSX backends so I don't think the details of my build are relevant (but I can supply if needed). Thanks, Tom import numpy import matplotlib.pyplot as plt y = numpy.array([ 4., 2., 2., 3., 3., 2., 2., 6., 6., 5., 5., 4., 4., 7., 7., 2., 2., 4., 4., 2., 2., 2., 2., 4., 4., 4., 4., 4., 4., 7., 7., 3., 3., 5., 5., 4., 4., 5., 5., 4., 4., 7., 7., 6., 6., 2., 2., 2., 2., 5., 5., 4., 4., 4., 4., 6., 6., 3., 3., 4., 4., 3., 3., 2., 2., 3., 3., 4., 4., 4., 4., 4., 4., 6., 6., 5., 5., 4., 4., 7., 7., 3., 3., 4., 4., 4., 4., 5., 5., 4., 4., 7., 7., 3., 3., 4., 4., 4., 4., 6., 6., 4., 4., 4., 4., 4., 4., 2., 2., 5., 5., 6., 6., 3., 3., 5., 5., 4., 4., 0., 0., 5., 5., 1., 1., 4., 4., 5., 5., 4.]) plt.figure() plt.plot(y) plt.figure() plt.plot(y) plt.xlim(-7200, 6500) # Does it go down to 0 now? |
|
From: Michael D. <md...@st...> - 2010-04-23 18:32:42
|
imshow has a number of different interpolation methods you can try:
http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.imshow
Mike
John wrote:
> Hello,
>
> I'm trying to plot 0.5x0.5 global data. I'm currently using
> pcolormesh. I have a log color scale and haven't been able to use
> contourf succesfully for some reason. If I use imshow, it seems to be
> too 'bleedy'.
>
> Is there a method for plotting that does some more 'smoothing'
> interpolation of the data than pcolormesh? Is there something I'm
> doing wrong that contourf doesn't work with log data?
>
> Thanks,
> john
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
--
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
|
|
From: Carlos G. <car...@gm...> - 2010-04-23 15:44:25
|
Many thanks! carlos On Thu, Apr 22, 2010 at 18:54, Gökhan Sever <gok...@gm...> wrote: > > > On Thu, Apr 22, 2010 at 4:44 PM, Carlos Grohmann <car...@gm...> > wrote: >> >> Hi all, >> >> I'm getting this weird behavior of legend. I always get two symbols in >> front of the labels, instead of one. >> Did anyone experienced this before? >> >> I'm working with MPL in a WxPython app. >> >> code snippet: >> >> >> [code] >> for i in range(len(self.idxPlan)): >> x = self.PeigenList[i][14] + (self.PeigenList[i][15] / 2) >> y = self.PeigenList[i][15] * sqrt3_2 >> axes.plot(x,y, self.PProps[i][3], c=self.PProps[i][2], >> ms=self.PProps[i][4],label=self.Pname[i]) >> >> axes.legend(bbox_to_anchor=(0.85, 0.75), loc=2, >> prop=FontProperties(size='small')) >> >> axes.set_xlim(-0.1,1.2) >> axes.set_ylim(-0.1,1.2) >> self.dataCanvas.draw() >> >> [\code] >> >> >> tks >> -- >> Prof. Carlos Henrique Grohmann - Geologist D.Sc. >> Institute of Geosciences - Univ. of São Paulo, Brazil >> http://www.igc.usp.br/pessoais/guano >> Linux User #89721 >> ________________ >> Can’t stop the signal. > > Hi, > > Try using numpoints keyword: > > plt.legend(numpoints=1) > > > -- > Gökhan > -- Prof. Carlos Henrique Grohmann - Geologist D.Sc. Institute of Geosciences - Univ. of São Paulo, Brazil http://www.igc.usp.br/pessoais/guano Linux User #89721 ________________ Can’t stop the signal. |
|
From: Thomas R. <tho...@gm...> - 2010-04-23 15:07:52
|
Hi,
I'm having issues with translucent patches. The following code
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
from matplotlib.patches import Circle
fig = mpl.figure()
ax = fig.add_subplot(111)
c = Circle((0.25,0.5), radius=0.2, facecolor='none', edgecolor='green', alpha=0.2)
ax.add_patch(c)
c = Circle((0.75,0.5), radius=0.2, facecolor='blue', edgecolor='green', alpha=0.2)
ax.add_patch(c)
fig.savefig('test_alpha.png')
Produces a plot where the two circles have different borders - the left circle has a border with alpha=1.0 and the right circle has a border with alpha=0.2. Should I submit this as a bug report?
I am also having issues with the following script:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
from matplotlib.patches import Circle
import time
fig = mpl.figure()
ax = fig.add_subplot(111)
ax.add_patch(Circle((1.e10,1.e10), radius=1.e9))
time1 = time.time()
fig.savefig('test_perf.png')
print "Time to save: %.3f" % (time.time() - time1)
The issue is that the time to save is typically 3 seconds or so, up to 5 seconds in some caes (way more than normal), and the axes do not autoscale to show the patch (I imagine the two issues are related). Is this a bug, or just due to the way matplotlib works?
Thanks for any help,
Thomas
|
|
From: Gökhan S. <gok...@gm...> - 2010-04-23 14:01:07
|
On Thu, Apr 22, 2010 at 7:38 PM, John Hunter <jd...@gm...> wrote:
>
> The standard trick is to make the ticklabels on one axes invisible
>
> for label in ax.get_xticklabels():
> label.set_visible(False)
>
>
> JDH
>
Thanks John, This answer seems familiar to me :) You have caught my
intention correctly --not completely clearing the x-axis but rather
turning-off the labels.
Your trick works independent from sharing state of an x-axis.
Alternatively, I use ax.xaxis.set_ticklabels ("") to clear tick-labels when
I don't share the axis.
--
Gökhan
|
|
From: Stephen G. <ste...@op...> - 2010-04-23 01:04:45
|
On 23/04/2010 10:30 AM, wil...@co... wrote: > I use pylab.plot(x,y) for exploring or debugging some functions or > subroutines. > I would like to cycle through 2 or more plot windows, in a simple way > that won't force me to entangle the code in bothersome ways. But I > can't seem to get more than one plot window to open per launch. > > Here is an example of what I want to have happen: > > The program calls subroutine A, and creates a plot so that I can > see what it has done. > The plot opens, and I see that A is doing what I want, then I close > the plot window (I interactively click the close button). > Then the program calls subroutine B, and creates another plot so I > can check its results. > The plot opens, I see what I want and close it. > And so on. > > But I can't figure out how to make that work. Only one plot ever shows. > > Here is a very minimal example of what I have tried: > > import numpy as N > import pylab as P > > x = N.linspace(0,6,100) > y = N.sin(x) > > P.plot(x,y) > P.show() # At this point, I want to see what I've got, and > then move on. > > y = -y > P.plot(x,y) > P.show() # This plot will not show. > > The answer for me is not to use "subplot()". I already use that > often. But I want these plots to stand on their own, so that I don't > have to entangle the different pieces of code just for some > exploratory plotting. > > I hope someone has an easy solution! > Thanks, > Bill Hi, I gave a solution just a couple of days ago, I believe the similar approach could solve this problem also http://old.nabble.com/plotting-in-a-loop-td28306656.html Essentially, . each time you press a button on graph (not the close button) you generate an event which would call an update function, you could farm out work to perform subroutine B here, then replot the result. Steve |
|
From: John <was...@gm...> - 2010-04-23 00:47:34
|
Hello, I'm trying to plot 0.5x0.5 global data. I'm currently using pcolormesh. I have a log color scale and haven't been able to use contourf succesfully for some reason. If I use imshow, it seems to be too 'bleedy'. Is there a method for plotting that does some more 'smoothing' interpolation of the data than pcolormesh? Is there something I'm doing wrong that contourf doesn't work with log data? Thanks, john |
|
From: John H. <jd...@gm...> - 2010-04-23 00:38:20
|
On Apr 22, 2010, at 12:28 PM, Gökhan Sever <gok...@gm...>
wrote:
> Hello,
>
> Consider my simple test case:
>
> import matplotlib.pyplot as plt
>
> fp = plt.figure()
> ax1 = fp.add_subplot(4,1,1)
> ax1.plot(range(10))
> ax2 = fp.add_subplot(4,1,2)
> ax2.plot(range(10))
> ax1.xaxis.set_major_locator (plt.NullLocator ())
>
> ax3 = fp.add_subplot(4,1,3)
> ax3.plot(range(10))
> # Can't turn off
> ax3.xaxis.set_major_locator (plt.NullLocator ())
> ax4 = fp.add_subplot(4,1,4, sharex=ax3)
> ax4.plot(range(10))
> # Turn-off both ax3 and ax4
> #ax3.xaxis.set_major_locator (plt.NullLocator ())
>
> plt.show()
>
> When I share x-axis in between two plots I can't turn-off one axis'
> major ticks. Depends on the location of the function call it either
> turn nothing or all. Is it intended or a mal-functioning? (Shared
> axis is for my screen view, I can live without it by turning off
> sharex option since it won't make any difference for the final saved
> figures.)
>
The standard trick is to make the ticklabels on one axes invisible
for label in ax.get_xticklabels():
label.set_visible(False)
JDH
|
|
From: <wil...@co...> - 2010-04-23 00:30:14
|
I use pylab.plot(x,y) for exploring or debugging some functions or subroutines. I would like to cycle through 2 or more plot windows, in a simple way that won't force me to entangle the code in bothersome ways. But I can't seem to get more than one plot window to open per launch. Here is an example of what I want to have happen: The program calls subroutine A, and creates a plot so that I can see what it has done. The plot opens, and I see that A is doing what I want, then I close the plot window (I interactively click the close button). Then the program calls subroutine B, and creates another plot so I can check its results. The plot opens, I see what I want and close it. And so on. But I can't figure out how to make that work. Only one plot ever shows. Here is a very minimal example of what I have tried: import numpy as N import pylab as P x = N.linspace(0,6,100) y = N.sin(x) P.plot(x,y) P.show() # At this point, I want to see what I've got, and then move on. y = -y P.plot(x,y) P.show() # This plot will not show. The answer for me is not to use "subplot()". I already use that often. But I want these plots to stand on their own, so that I don't have to entangle the different pieces of code just for some exploratory plotting. I hope someone has an easy solution! Thanks, Bill |
|
From: Gökhan S. <gok...@gm...> - 2010-04-22 21:54:49
|
On Thu, Apr 22, 2010 at 4:44 PM, Carlos Grohmann <car...@gm...>wrote: > Hi all, > > I'm getting this weird behavior of legend. I always get two symbols in > front of the labels, instead of one. > Did anyone experienced this before? > > I'm working with MPL in a WxPython app. > > code snippet: > > > [code] > for i in range(len(self.idxPlan)): > x = self.PeigenList[i][14] + (self.PeigenList[i][15] / 2) > y = self.PeigenList[i][15] * sqrt3_2 > axes.plot(x,y, self.PProps[i][3], c=self.PProps[i][2], > ms=self.PProps[i][4],label=self.Pname[i]) > > axes.legend(bbox_to_anchor=(0.85, 0.75), loc=2, > prop=FontProperties(size='small')) > > axes.set_xlim(-0.1,1.2) > axes.set_ylim(-0.1,1.2) > self.dataCanvas.draw() > > [\code] > > > tks > -- > Prof. Carlos Henrique Grohmann - Geologist D.Sc. > Institute of Geosciences - Univ. of São Paulo, Brazil > http://www.igc.usp.br/pessoais/guano > Linux User #89721 > ________________ > Can’t stop the signal. > Hi, Try using numpoints keyword: plt.legend(numpoints=1) -- Gökhan |
|
From: Carlos G. <car...@gm...> - 2010-04-22 21:44:40
|
Hi all,
I'm getting this weird behavior of legend. I always get two symbols in
front of the labels, instead of one.
Did anyone experienced this before?
I'm working with MPL in a WxPython app.
code snippet:
[code]
for i in range(len(self.idxPlan)):
x = self.PeigenList[i][14] + (self.PeigenList[i][15] / 2)
y = self.PeigenList[i][15] * sqrt3_2
axes.plot(x,y, self.PProps[i][3], c=self.PProps[i][2],
ms=self.PProps[i][4],label=self.Pname[i])
axes.legend(bbox_to_anchor=(0.85, 0.75), loc=2,
prop=FontProperties(size='small'))
axes.set_xlim(-0.1,1.2)
axes.set_ylim(-0.1,1.2)
self.dataCanvas.draw()
[\code]
tks
--
Prof. Carlos Henrique Grohmann - Geologist D.Sc.
Institute of Geosciences - Univ. of São Paulo, Brazil
http://www.igc.usp.br/pessoais/guano
Linux User #89721
________________
Can’t stop the signal.
|
|
From: Gökhan S. <gok...@gm...> - 2010-04-22 17:29:01
|
Hello, Consider my simple test case: import matplotlib.pyplot as plt fp = plt.figure() ax1 = fp.add_subplot(4,1,1) ax1.plot(range(10)) ax2 = fp.add_subplot(4,1,2) ax2.plot(range(10)) ax1.xaxis.set_major_locator (plt.NullLocator ()) ax3 = fp.add_subplot(4,1,3) ax3.plot(range(10)) # Can't turn off ax3.xaxis.set_major_locator (plt.NullLocator ()) ax4 = fp.add_subplot(4,1,4, sharex=ax3) ax4.plot(range(10)) # Turn-off both ax3 and ax4 #ax3.xaxis.set_major_locator (plt.NullLocator ()) plt.show() When I share x-axis in between two plots I can't turn-off one axis' major ticks. Depends on the location of the function call it either turn nothing or all. Is it intended or a mal-functioning? (Shared axis is for my screen view, I can live without it by turning off sharex option since it won't make any difference for the final saved figures.) Thanks. -- Gökhan |
|
From: Alan G I. <ala...@gm...> - 2010-04-22 15:54:22
|
If I rotate an axes3D instance with a zlabel far enough so that the ticks and label "switch sides", but so that the xlabel and ylabel remain at the bottom, then the zlabel does not rotate 180 degrees, as it should to look right. (If I then tilt it so that the xlabel and the ylabel move to the top, it does the necessary rotation.) Alan Isaac |
|
From: Gökhan S. <gok...@gm...> - 2010-04-22 15:03:58
|
On Thu, Apr 22, 2010 at 3:42 AM, Matthias Michler <Mat...@gm...>wrote: > Hi Gökhan, > > Just to make one point clear to me. Do you agree that the following is the > expected behavior of your suggestion to use > event.inaxes.grid(which='minormajor') after 'g'? > > If only the major tick grid lines are shown and the user presses 'g' the > major > tick lines are removed and the minor tick lines are shown, because calling > Axes.grid with the default b=None toggles the state of plotting grid lines. > Here this means that the minor tick grid lines are switched from being not > shown to being shown and the major tick lines change vice versa. > > If you agree that this is the expected behavior of your suggestion, do you > think this is a useful behavior? > > Kind regards, > Matthias > Hi again, With grid state initially off I could get what I really wanted with "g" toggling after setting in backend_bases.py event.inaxes.grid(which='majorminor) It does exactly what it supposed to do -toggle visible grids. See my figure for a clearer description: http://img249.imageshack.us/img249/1464/gridimage.png The top-left figure has major-minor grids enabled in log-log view. This creates not a pretty image --neither on screen nor when I save the image as png or pdf. Top-right is clear since it is spaced linearly. The last figure I toggled with "g" key. It was originally like the first figure on the screen. I realize also that grid accept alpha keyword, however I couldn't get a satisfying result out of that either. For the time being I will go with full-off grids for my step plots. With this said, I still think event.inaxes.grid(which='majorminor) should be checked-in since it is the right behavior for full grid toggling. That's what toggling is about right? Either all or none --we don't want gray areas. > -- Gökhan |
|
From: Gökhan S. <gok...@gm...> - 2010-04-22 14:47:41
|
On Thu, Apr 22, 2010 at 3:25 AM, Matthias Michler <Mat...@gm...>wrote: > Hi Gökhan, > > with the attached test.py I generated the attached files 'pic?.png' and I'm > sorry, I don't get the problem. For me ax.grid(False, which='majorminor') > removes major and minor ticks on x- and y-axis. > > Maybe I changed something additionally in my svn (rev 8242) and therefore > get > the expected behavior. But unfortunately I cannot test it today. > > Kind regards, > Matthias The problem was on my side Matthias. I had enabled grid=True in my matplotlibrc file. Turned it off and I get the same behavior as you get. Thanks for providing the script and comments. -- Gökhan |
|
From: Michiel de H. <mjl...@ya...> - 2010-04-22 10:56:38
|
Actually which backend are you using? I'd like to try this to see what happens if show() is called more than once.
--Michiel.
--- On Tue, 4/20/10, Antony Lee <ant...@en...> wrote:
That would be a solution, indeed. However, is there really no way of coming back to a pre-plt.show() state once all windows are closed? What kind of irreversible things does plt.show() do?
|
|
From: <tom...@gm...> - 2010-04-21 19:14:43
|
Thank you very much Steve! This helped a lot, it worked in the ipython as well, there is no difference, only that the ipython is interactive and has more supplementary features. :)
Thanks,
Tomislav
----- Original Message -----
From: Stephen George
Sent: 04/21/10 03:33 AM
To: mat...@li...
Subject: Re: [Matplotlib-users] plotting in a loop
Hi,
Sorry haven't used ipython, so not sure if there is another/better ipython way.
Attached is how I solved it in normal python.
I added a "next line" button to the graph, and set the ydata for the line each time the button is pushed.
There is a couple of set_ylim lines commented out, depending on the nature of your data, it might be appropriate to uncomment one of those, however the set_aspect line may might mean the graph is very tall and skinny with the supplied data.
Hope that gives you some ideas for your own code.
Steve
On 21/04/2010 3:35 AM, tom...@gm... wrote: Hello everyone,
if I read a column file like this (simplified to integers):
0 1 2 3
1 2 3 4
2 3 4 5
3 4 5 6
with: "data = np.loadtxt("fileName")", why can't I use a for loop inside ipython (started with "-pylab" option) to plot each of the Line2D objects and then draw them on the plot? I am using matplotlib to debug a computational geometry code and I would like these lines to plot paused by the user input so that I can identify when (where) exactly the wrong calculations happen:
import numpy as np
import matplotlib.pyplot as plt
fig1 = plt.figure()
ax1 = fig1.add_subplot(111)
ax1.set_aspect("equal")
for line in data:
raw_input("press enter to plot the line")
ax1.plot([line[0],line[2]],[line[1],line[3]],'b')
plt.draw()
This way I could see with pressing e.g. the return key when my calculations go wrong.... any advice?
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Matplotlib-users mailing list Mat...@li...://lists.sourceforge.net/lists/listinfo/matplotlib-users https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Gökhan S. <gok...@gm...> - 2010-04-21 18:29:36
|
On Wed, Apr 21, 2010 at 12:06 PM, Gökhan Sever <gok...@gm...>wrote: > > > On Wed, Apr 21, 2010 at 4:39 AM, Matthias Michler <Mat...@gm... > > wrote: > >> I think it works like expected, i.e. it toggles the state of showing grid >> lines for minor and major ticks. >> The problem it the case were people set only major tick grid lines >> ax.grid(True, which='major') >> and than press the key 'g', because than they change between having major >> and >> minor tick grid lines and this is somehow a strange behavior, isn't it? >> Therefore I myself am not convinced of that solution. >> [...] >> > > Interesting that setting and using "g" doesn't toggle both minor and major > grids at the same time. It behaves erratically. > event.inaxes.grid(which='minormajor') > > I'm sorry, I don't get your point. If I ran your script I get a window >> without >> gridlines as expected. The result is independent of the call of >> ax.grid(False, which='majorminor'). >> By the way are you using matplotlib-svn? >> > > Yes I test this again and it doesn't work. That setting only disables major > grids. Grids are cleared in my second explicit call. This is rev 8226 using > WXAgg backend. > > >> >> Kind regards, >> Matthias >> >> >> ------------------------------------------------------------------------------ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> > > > > -- > Gökhan > I removed mpl directory and re-checked out and re-installed it using rev 8260. Applied your patch with patch -p0 -i grid_for_major_minor_ticks.patch That simple example still doesn't work here (cannot get rid of major - minor grids at the same in a double log scaled plot). Could someone confirm this behaviour? Thanks. -- Gökhan |
|
From: Gökhan S. <gok...@gm...> - 2010-04-21 17:06:17
|
On Wed, Apr 21, 2010 at 4:39 AM, Matthias Michler <Mat...@gm...>wrote: > I think it works like expected, i.e. it toggles the state of showing grid > lines for minor and major ticks. > The problem it the case were people set only major tick grid lines > ax.grid(True, which='major') > and than press the key 'g', because than they change between having major > and > minor tick grid lines and this is somehow a strange behavior, isn't it? > Therefore I myself am not convinced of that solution. > [...] > Interesting that setting and using "g" doesn't toggle both minor and major grids at the same time. It behaves erratically. event.inaxes.grid(which='minormajor') I'm sorry, I don't get your point. If I ran your script I get a window > without > gridlines as expected. The result is independent of the call of > ax.grid(False, which='majorminor'). > By the way are you using matplotlib-svn? > Yes I test this again and it doesn't work. That setting only disables major grids. Grids are cleared in my second explicit call. This is rev 8226 using WXAgg backend. > > Kind regards, > Matthias > > > ------------------------------------------------------------------------------ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Gökhan |