SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

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
(10)
2
(30)
3
(11)
4
(5)
5
(14)
6
(21)
7
(19)
8
(29)
9
(23)
10
(5)
11
(3)
12
(9)
13
(6)
14
(12)
15
(10)
16
(15)
17
(5)
18
(6)
19
(4)
20
(28)
21
(8)
22
(5)
23
(10)
24
(4)
25
(1)
26
(6)
27
(13)
28
(11)
29
(9)
30
(23)

Showing results of 352

<< < 1 .. 9 10 11 12 13 .. 15 > >> (Page 11 of 15)
From: Noel O'B. <noe...@ma...> - 2005年09月07日 14:25:09
Debian Sarge. What are the dependencies of the Ubuntu package you have
created?
I've also tried to compile it with Tk support, and it compiles fine, but
it won't import the library as it is looking for gtk (but in setup.py I
told it to use Tk!).
... it seems that I need to compile pygtk myself now.
Regards,
Noel
On Wed, 2005年09月07日 at 09:16 -0500, John Hunter wrote:
> >>>>> "Noel" == Noel O'Boyle <noe...@ma...> writes:
> 
> Noel> Is the debian package for matplotlib broken?? I found the
> Noel> following error when trying to install the debian package
> Noel> for matplotlib as per the instructions at the bottom of
> Noel> http://matplotlib.sourceforge.net/installing.html.
> 
> What debian variant are you using. If by chance ubuntu, I could point
> you to my own repository which usually has the latest mpl from CVS.
> 
> JDH
> 
> 
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: John H. <jdh...@ac...> - 2005年09月07日 14:16:49
>>>>> "Noel" == Noel O'Boyle <noe...@ma...> writes:
 Noel> Is the debian package for matplotlib broken?? I found the
 Noel> following error when trying to install the debian package
 Noel> for matplotlib as per the instructions at the bottom of
 Noel> http://matplotlib.sourceforge.net/installing.html.
What debian variant are you using. If by chance ubuntu, I could point
you to my own repository which usually has the latest mpl from CVS.
JDH
From: LUK S. <shu...@po...> - 2005年09月07日 13:51:38
Noel O'Boyle wrote:
> Is the debian package for matplotlib broken??
> 
> I found the following error when trying to install the debian package
> for matplotlib as per the instructions at the bottom of
> http://matplotlib.sourceforge.net/installing.html.
[snipped]
> 
> I then tried apt-get install python2.3-matplotlib:
> "The following packages have unmet dependencies:
> python2.3-matplotlib: Depends: libcairo1 but it is not installable
> E: Broken packages"
> 
> I then tried apt-get install libcairo1:
> "Package libcairo1 is not available, but is referred to by another
> package.
> This may mean that the package is missing, has been obsoleted, or
> is only available from another source
> E: Package libcairo1 has no installation candidate"
Debian sid libraries are in transition. You can get older version of packages
via http://snapshot.debian.net
> 
> Regards,
> Noel
> 
Regards,
ST
--
From: Christian M. <mee...@un...> - 2005年09月07日 13:30:17
Ok, I'll do that. Just give me some time.
Cheers
Christian
On 7 Sep 2005, at 14:54, John Hunter wrote:
>>>>>> "Christian" == Christian Meesters <mee...@un...> writes:
>
> Christian> Well, the solution IS easy and pretty straightforward,
> Christian> but I didn't realise that for a while ...
>
> How about a little wiki entry explaining how to plot with masked data,
> including and example, etc...
>
> http://www.scipy.org/wikis/topical_software/MatplotlibCookbook
>
> Thanks,
> JDH
>
From: Darren D. <dd...@co...> - 2005年09月07日 13:01:11
On Wednesday 07 September 2005 05:19 am, Christian Meesters wrote:
> Hi
>
> It's me one more time ...
> Does anybody see what's wrong in my script? I've attached the final
> plot as an .png file for clarity. I expected the plot to show a uniform
> label font, but in the upper insert you see a non-uniform labelling,
> why? And why do I get a bigger '1xe4'? Why do I get it at all?
The 1xe4 is telling you that your yaxis spans 0-90,000, not 0-9. This label is 
called the offset, you can access it by the yaxis' get_offset method, and 
then change the label's font. (The offset should respect the ticklabel 
fontsize, would you please file a bugreport at the sourceforge site? I don't 
have time to work on it right now.)
Alternatively, you can use OldScalarFormatter, which does not create that 
label. Check out newscalarformatter_demo.py in the examples.
-- 
Darren
From: John H. <jdh...@ac...> - 2005年09月07日 12:59:18
>>>>> "Christian" == Christian Kristukat <c.k...@ho...> writes:
 Christian> Thanks. I did not understand the meaning of 'extent'.
 Christian> Another thing I could not find which is probably
 Christian> possible as well: How can I display a label for the
 Christian> colorbar (not ticklabel)?
colorbar returns an Axes instance for the colorbar, so you can use any
of the Axes methods described at
http://matplotlib.sf.net/matplotlib.axes.html#Axes
 cax = colorbar()
 cax.set_title('A title')
 cax.set_ylabel('ylabel')
 cax.set_xlabel('xlabel')
or if your prefer "setp" style args
 cax = colorbar()
 setp(cax, title='A title', ylabel='ylabel', xlabel='xlabel')
JDH
From: John H. <jdh...@ac...> - 2005年09月07日 12:54:58
>>>>> "Christian" == Christian Meesters <mee...@un...> writes:
 Christian> Well, the solution IS easy and pretty straightforward,
 Christian> but I didn't realise that for a while ...
How about a little wiki entry explaining how to plot with masked data,
including and example, etc...
 http://www.scipy.org/wikis/topical_software/MatplotlibCookbook
Thanks,
JDH
From: Noel O'B. <noe...@ma...> - 2005年09月07日 11:57:26
Is the debian package for matplotlib broken??
I found the following error when trying to install the debian package
for matplotlib as per the instructions at the bottom of
http://matplotlib.sourceforge.net/installing.html.
apt-get install python-matplotlib python-matplotlib-doc
"The following packages have unmet dependencies:
 python-matplotlib: Depends: python2.3-matplotlib (= 0.82-1) but it is
not going to be installed
E: Broken packages"
I then tried apt-get install python2.3-matplotlib:
"The following packages have unmet dependencies:
 python2.3-matplotlib: Depends: libcairo1 but it is not installable
E: Broken packages"
I then tried apt-get install libcairo1:
"Package libcairo1 is not available, but is referred to by another
package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package libcairo1 has no installation candidate"
Regards,
Noel
From: Christian M. <mee...@un...> - 2005年09月07日 09:19:15
Attachments: ES_calibration.png
Hi
It's me one more time ...
Does anybody see what's wrong in my script? I've attached the final 
plot as an .png file for clarity. I expected the plot to show a uniform 
label font, but in the upper insert you see a non-uniform labelling, 
why? And why do I get a bigger '1xe4'? Why do I get it at all?
I think getting an answer on these question would help me a lot. 
Perhaps a pointer on the tutorial is already sufficient, but I didn't 
answers there. I'm sorry if I overlooked something.
TIA
Christian
Here's the relevant part of my script:
 pylab.title('Beam intensity dependence of the ES slit position', 
fontproperties=font)
 pylab.plot(position_data,intensity_data,'k-')
 pylab.xlabel('shift [}\mu\rm{m] from closure', fontproperties=font)
 pylab.ylabel('intensity [counts/min]', fontproperties=font)
 pylab.xticks(fontproperties=font)
 pylab.yticks(fontproperties=font)
 #plotting peak broadness
 a = pylab.axes([.65,.6,.2,.2])
 pylab.plot(position_data,sigmas,'k-')
 a.set_xlim(position_data[0],position_data[-1])
 pylab.title('Peak broadness', fontproperties=font)
 pylab.xlabel(r'$\rm{shift [}\mu\rm{m] from closure}$', 
fontproperties=font)
 pylab.ylabel(r'$\sigma \rm{ [channels]}$', fontproperties=font)
 for labelx, labely in zip(a.get_xticklabels(),a.get_yticklabels()):
 labelx.set_fontproperties(font)
 labely.set_fontproperties(font)
 #plotting peak centers
 b = pylab.axes([.65,.2,.2,.2])
 pylab.plot(position_data,mus,'k-')
 b.set_xlim(position_data[0],position_data[-1])
 pylab.title('Peak center position', fontproperties=font)
 pylab.ylabel(r'$\rm{beam center [channels]}$', fontproperties=font)
 pylab.xlabel(r'$\rm{shift [}\mu\rm{m] from closure}$', 
fontproperties=font)
 for labelx, labely in zip(b.get_xticklabels(),b.get_yticklabels()):
 labelx.set_fontproperties(font)
 labely.set_fontproperties(font)
 pylab.savefig("ES_calibration.%s" % plot_format)
From: Christian M. <mee...@un...> - 2005年09月07日 08:34:22
Thanks, Arnd & Christian.
Combining your answers and the example on masked plots brought me to 
this solution (pseudo code):
y_values = M.array(y_values)
y_values = M.masked_where(y_values < threshold , y_values) #mask values 
below a certain threshold
pylab.plot(x_values, y_values,'k-')
a.set_xlim(x_values[0], x_values[-1]) #for otherwise the range of 
x_values gets truncated
Well, the solution IS easy and pretty straightforward, but I didn't 
realise that for a while ...
Cheers,
Christian
From: Christian K. <ck...@ho...> - 2005年09月07日 07:26:26
John Hunter wrote:
>>>>>>"Jo=C3=A3o" =3D=3D Jo=C3=A3o Lu=C3=ADs Silva <rom...@ya...> w=
rites:
>=20
>=20
> Jo=C3=A3o> Christian Kristukat wrote:
> >> Hi, is it possible to have an image map (imshow) with real axes
> >> like those created by 'contour' when supplying a xy meshgrid?
> >> The pcolor command unfortunately doesn't do interpolation.
> >> Regards, Christian
>=20
> You can use set the coordinates of the image data using the extent
> kwarg. Among other things, this lets you plot image data with other
> data (eg line data). See examples/image_demo2.py. =20
Thanks. I did not understand the meaning of 'extent'.
Another thing I could not find which is probably possible as well:
How can I display a label for the colorbar (not ticklabel)?
Regards, Christian
From: Christian K. <c.k...@ho...> - 2005年09月07日 07:26:13
John Hunter wrote:
>>>>>>"Jo=C3=A3o" =3D=3D Jo=C3=A3o Lu=C3=ADs Silva <rom...@ya...> w=
rites:
>=20
>=20
> Jo=C3=A3o> Christian Kristukat wrote:
> >> Hi, is it possible to have an image map (imshow) with real axes
> >> like those created by 'contour' when supplying a xy meshgrid?
> >> The pcolor command unfortunately doesn't do interpolation.
> >> Regards, Christian
>=20
> You can use set the coordinates of the image data using the extent
> kwarg. Among other things, this lets you plot image data with other
> data (eg line data). See examples/image_demo2.py. =20
Thanks. I did not understand the meaning of 'extent'.
Another thing I could not find which is probably possible as well:
How can I display a label for the colorbar (not ticklabel)?
Regards, Christian
From: Mark B. <ma...@gm...> - 2005年09月06日 19:19:23
One more thing on axis('equal')
There is an axis_equal_demo on CVS that demontrates the basic functionality
Mark
From: Mark B. <ma...@gm...> - 2005年09月06日 19:18:31
The revised axis('equal') command is now available on CVS.
Several emails have been posted regarding the proper
functioning. Let me explain what it is designed to do and
why, then we can see if we want to modify (and whether it
works as advertised).
The doc string for axis('equal') is
axis('equal') changes limits of x or y axis such that equal
tick mark increments are equal in size. This makes a circle
look like a circle, for example. This is persistent. For
example, when axis limits are changed after this command,
the scale remains equal
The axis('equal') command works as in matlab. When you give
the command, it will change the data limits of one of the
axes such that the scale is equal on both axes. If you
change the data limits after that with the command axis(),
then it will keep the scales equal, and will resize the
figure. As a result, the order of commands matters (the
same holds in matlab):
plot([1,2,3],[1,2,3])
axis('equal')
axis((1,3,1,3))
will produce a square graph with limits from 1 to 3 on
both axes, while
plot([1,2,3],[1,2,3])
axis((1,3,1,3))
axis('equal')
will create a rectangular plot with axes limits
(0.71620934959349603, 3.283790650406504, 1.0, 3.0)
So far for 'compatibility' with matlab. If you want to set
the axes equal, but not change the data limits, all in one
statement, you can do that as follows
plot([1,2,3],[1,2,3])
gca().set_aspect('equal',fixLimits=3DTrue)
Regarding the 'fixLimits' option, you are telling the
routine to fix the limits, so I think the choice of the
variable name is ok. It may be a good idea to add
'fixLimits' as an optional keyword to the pylab interface,
(I would use it a lot for that matter).
Now regarding the history, when using the toolbar in
interactive mode. I think we should modify the history such
that it saves both the data limits and the position. I can
do that (I think); let me know if that is what you want to
do.
The equal scale should be maintained when zooming-in with
the new toolbar.
Things that still need to be fixed: When you resize the
figure in interactive mode by dragging a corner or
expanding to full screen size, the scale of the axes are
not maintained, even if they are set to be equal. I am not
sure where to make this change (where does MPL know that
the figure got resized????). But it would be cool if that
worked as well.
Also, when axis are equal and the axis is shared, and you
change the axis limits such that the size of the subplot
changes, the shared axis size is not changed with it, as I
think it should. I need to fix that too.
I have not tested the current CVS, but hope to find time to
do that soon. Let me know what you think.
Mark
From: <ri...@pa...> - 2005年09月06日 17:24:54
I am attempting to use subplot with pie charts to get multiple pie
charts on one figure.
I modified the pie_demo.py as show below. Unfortunatly
it seems that the second pie-chart is written on top of the first.
How do I get multiple pie-charts on one figure? Is subplot the wrong
way to do this?
 from pylab import *
 
 # make a square figure and axes
 figure(1, figsize=(8,4))
 ax = axes([0.1, 0.1, 0.8, 0.8])
 labels = 'Frogs', 'Hogs', 'Dogs', 'Logs'
 fracs = [15,30,45, 10]
 figure(1)
 subplot(1,2,1)
 pie(fracs, labels=labels)
 labels = 'Frogs', 'Hogs', 'Cat', 'Cans'
 fracs = [15,30,45, 77]
 figure(1)
 subplot(1,2,2)
 pie(fracs, labels=labels)
 ...
 show()
From: John H. <jdh...@ac...> - 2005年09月06日 16:13:46
>>>>> "John" == John Gill <jn...@eu...> writes:
 John> I was also interested in some sort of legend for scatter
 John> plots recently. To that end I took a bit of a look at the
 John> legend code this am with a view to adding support for
 John> RegularPolyCollection's being passed in as handles for
 John> legends.
 John> My idea was just to assume the first element in the
 John> collection is representative of the others and use that to
 John> create a suitable RegularPolyPatch to use as the handle.
 John> I've not got it quite right as yet -- my current code
 John> produces a big blue blob in the middle of the plot.
 John> Is it worth me fixing this up and sending in a patch?
I think so, the case of a solid colored scatter with varying sizes
seems sufficiently common to warrant legend support.
So a patch would be great, if you aren't too busy with the Katrina
aftermath these days ...
Thanks,
JDH
From: John G. <jn...@eu...> - 2005年09月06日 16:04:11
I was also interested in some sort of legend for scatter plots recently.
To that end I took a bit of a look at the legend code this am with a 
view to adding support for RegularPolyCollection's being passed in as 
handles for legends.
My idea was just to assume the first element in the collection is 
representative of the others and use that to create a suitable 
RegularPolyPatch to use as the handle.
I've not got it quite right as yet -- my current code produces a big 
blue blob in the middle of the plot.
Is it worth me fixing this up and sending in a patch?
John
John Hunter wrote:
>>>>>>"Jack" == Jack Andrews <ef...@iv...> writes:
>>>>>> 
>>>>>>
>
> Jack> is there any more information you'd like to help me with
> Jack> constructing a legend for this scatter?
>
> Jack> i think i am misusing the scatter graph here... letting
> Jack> scatter assign colours from a continous selection rather
> Jack> than specifying a color.
>
>Yes, you probably want to assign specific colors in multiple calls to
>scatter. Scatter returns a
>matplotlib.collections.RegularPolyCollection, which legend is not
>equiped to deal with. To hack around this, you can create a proxy
>patch to pass to legend, which has the colors you want to use for the
>legend
>
>from matplotlib.patches import Rectangle
>from pylab import *
>
>N=20
>
>props = dict( alpha=0.75, faceted=False )
>
>x, y= rand(2,N)
>s=array(([400]+[30]*(N/2-1))*2)
>reds = scatter(x, y, c='red', s=s, **props)
>
>x, y= rand(2,N)
>s=array(([400]+[30]*(N/2-1))*2)
>
>blues = scatter(x, y, c='blue', s=s, **props)
>
>redp = Rectangle( (0,0), 1,1, facecolor='red')
>bluep = Rectangle( (0,0), 1,1, facecolor='blue')
>
>legend( (redp, bluep), ('reds', 'blues') )
>grid(True)
>
>show()
>
>
>-------------------------------------------------------
>SF.Net email is Sponsored by the Better Software Conference & EXPO
>September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
>Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
>Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
>
From: John H. <jdh...@ac...> - 2005年09月06日 15:44:47
>>>>> "Jo=E3o" =3D=3D Jo=E3o Lu=EDs Silva <rom...@ya...> writes:
 Jo=E3o> Christian Kristukat wrote:
 >> Hi, is it possible to have an image map (imshow) with real axes
 >> like those created by 'contour' when supplying a xy meshgrid?
 >> The pcolor command unfortunately doesn't do interpolation.
 >> Regards, Christian
You can use set the coordinates of the image data using the extent
kwarg. Among other things, this lets you plot image data with other
data (eg line data). See examples/image_demo2.py. =20
 Jo=E3o> This would be useful for me too, as I need to display an
 Jo=E3o> imshow with nonuniform axes.
This is not possible. image data, by definition, is regularly
sampled. At least it is in matplotlib. However, supporting
interpolation and gouraud shading over patches (eg rectangles) is
becoming an increasing priority (in particular to support John
Porter's recent 3D surface plot work) so hopefully we'll have this
feature for pcolor soon.
JDH
From: Christian K. <ck...@ho...> - 2005年09月06日 15:21:27
Christian Meesters wrote:
>> Christian Meesters wrote:
>>
>>> Hi
>>> It's certainly no important problem and there are ways to work around 
>>> it, but I was wondering whether there is a way to do it directly 
>>> using matplotlib.
>>> My 'problem' is as follows: My detector does not detect at all times; 
>>> in case nothing is detected a 0 is written in the data-file. So what 
>>> I end up with are data like [0,0,1000,1001,999,0,1000 ...], which - 
>>> of course - looks a bit odd, when plotted. (The 0s are meaningless.) 
>>> Is it possible to plot only values unequal to zero? Or is there any 
>>> other way to 'mask' data which should be skipped for the plot?
>>
>>
>> I believe that all plot methods accept masked arrays:
>>
>> import MA
>>
>> y = sin(arange(10))
>> dat = MA.array(y,mask=(y<0))
>> plot(dat,'o-')
>>
> Thanks. Sounds good. But what is 'mask'. It is not part of MA or scipy, 
> or is it? Do you know in which submodule it is hidden?
> 
mask is a keyword argument to MA.array. It must be an array of the same shape as 
y, containing ones and zeros.
type help(MA.array) to get more information.
Regards, Christian
From: John H. <jdh...@ac...> - 2005年09月06日 15:16:05
>>>>> "Martin" == Martin Richter <law...@gm...> writes:
 >>> 1) Unfortunetly this history seems not to work properly in
 >>> some cases. I was able to track down this error on the call of
 >>> the subplot-command
 Martin> [...]. is that neither the positioning nor the limits are
 Martin> restored. To be precise: They are not restored
 Martin> incorrectly; nothing happens if the buttons are
 Martin> pressed. (To be correct: The zoomhistory works only back
 Martin> to the last click which had an connected event. This state
 Martin> seems to be set as new 'home' - see the example which I
 Martin> sent the last time.)
Yep, this is a bug; I was able to replicate it. Could you file it on
the sourceforge site. I don't know what the immediate fix is, and
getting on sourceforge will help prevent it from falling through the
cracks.
 http://sourceforge.net/tracker/?group_id=80706&atid=560720
Thanks,
JDH
From: John H. <jdh...@ac...> - 2005年09月06日 15:11:20
>>>>> "Martin" == Martin Richter <law...@gm...> writes:
 Martin> Hello John, it was pretty easy to rewrite the (formally
 Martin> called) LineSelector so that the callback-function now
 Martin> awaits two events (press and release). Now it is possible
 Martin> to use the different mousebuttons. (By the way: It is
 Martin> checked if press- and releasebutton are the same.)
 Martin> If you want to include the RubberbandWidget - please feel
 Martin> free to do so.
Thanks Martin,
The changes are in CVS
 Checking in lib/matplotlib/widgets.py;
 /cvsroot/matplotlib/matplotlib/lib/matplotlib/widgets.py,v <--
 widgets.py new revision: 1.23; previous revision: 1.22
I made a few stylistic changes to use mpl naming conventions and added
your example to examples/widgets/rectangle_selector.py . I also
decided on the name "RectangleSelector" since rubberband won't mean
much to many people.
 Martin> I took the latest CVS, tried it again with GTKAgg, WXAgg
 Martin> and TkAgg and (as you said) it worked fine!
That's the great thing about using Agg as a common renderer and doing
event handling with the MDE. Folks using other GUI toolkits get to
reuse your work (and contribute to it).
Thanks for the widget!
JDH
From: Arnd B. <arn...@we...> - 2005年09月06日 15:03:45
On Tue, 6 Sep 2005, John Hunter wrote:
[...]
> Hey Arnd,
>
> All of your suggestions look reasonable to me on cursory inspection,
> but the person best equipped to decide these things is Mark Bakker,
> who wrote the axes equal handling. I've CC'd him on this message.
OK, I think the best is that Mark has a look at the CVS version
and our comments and then we will move on ...
[...]
> I have a couple of minor comments:
>
> Arnd> While at this: I also don't like `autoscale_on` very much.
> Arnd> I think that `autoscale` (being True or False) would be enough.
>
> I recall Fernando objecting to this too, so it must be particularly
> irritating. My inclination for cosmetic things like this is to not
> break backwards compatibility for a slightly more pleasing name.
I can understand this, but on the other hand, we are at *0*.84,
so users should expect things to break when running < 1.0 software.
Also the breakage does not seem too bad to me.
Not changing it now means that it will also be in matplotlib 8.0
(and even in the upcoming MDE (Matplotlib Desktop Environment) ;-).
> Arnd> And one more (just to complicate matters even more): At the
> Arnd> moment there is only autoscaling for x and y at the same
> Arnd> time. Gnuplot, for example, allows to specify the xrange or
> Arnd> yrange separately and the other range is autoscaled. I am
> Arnd> mentionining this, because it might be a useful feature.
> Arnd> (However, it might make the coding of the autoscaling even
> Arnd> more involved...).
>
> I think this would be useful too. We could implement autoscalex and
> autoscaley properties which would handle this. I don't think the code
> would be particularly cumbersome. Then the question is: what should
> be done with autoscale_on: deprecate it, or have it set autoscalex and
> autoscaley together?
I think `autoscale` should imply `autoscalex` and `autoscaley`
(Note that I did not write `autoscale_on`,`autoscale_on_x`,
`autoscale_on_y` ;-).
Best,
Arnd
From: John H. <jdh...@ac...> - 2005年09月06日 14:50:59
>>>>> "Arnd" == Arnd Baecker <arn...@we...> writes:
 Arnd> On Fri, 2 Sep 2005, John Hunter wrote:
 Arnd> To be honest, from a user perspective such effects are very
 Arnd> problematic and I would usually considered as a bug.
 Arnd> Together with Martin Richter I had a closer look at this:
Hey Arnd, 
All of your suggestions look reasonable to me on cursory inspection,
but the person best equipped to decide these things is Mark Bakker,
who wrote the axes equal handling. I've CC'd him on this message. 
 Mark> Regarding the questions of axis('equal') and axis('scaled'),
 Mark> I submitted a patch for the axis('equal') command about a
 Mark> month ago that will turn it into the same behavior as
 Mark> matlab. After the axis('equal') command is given, the scale
 Mark> on both axes will be equal (such that a circle looks like a
 Mark> circle). It has a little demo file with it as
 Mark> well. Hopefully that will be implemented in CVS soon (let me
 Mark> know if I can help here, John),
Mark, I committed your patch and these guys are using CVS, so the
issues Arnd and Martin describe apply to the patched matplotlib.
If the three of you could hash this out and come up with an updated
patch you are all happy with, I'm happy to apply it. As always,
please provide some language with your patch for API_CHANGES, if there
are any.
I have a couple of minor comments:
 Arnd> While at this: I also don't like `autoscale_on` very much.
 Arnd> I think that `autoscale` (being True or False) would be enough.
I recall Fernando objecting to this too, so it must be particularly
irritating. My inclination for cosmetic things like this is to not
break backwards compatibility for a slightly more pleasing name.
 Arnd> And one more (just to complicate matters even more): At the
 Arnd> moment there is only autoscaling for x and y at the same
 Arnd> time. Gnuplot, for example, allows to specify the xrange or
 Arnd> yrange separately and the other range is autoscaled. I am
 Arnd> mentionining this, because it might be a useful feature.
 Arnd> (However, it might make the coding of the autoscaling even
 Arnd> more involved...).
I think this would be useful too. We could implement autoscalex and
autoscaley properties which would handle this. I don't think the code
would be particularly cumbersome. Then the question is: what should
be done with autoscale_on: deprecate it, or have it set autoscalex and
autoscaley together?
Thanks,
JDH
From: John H. <jdh...@ac...> - 2005年09月06日 14:38:30
>>>>> "Jack" == Jack Andrews <ef...@iv...> writes:
 Jack> is there any more information you'd like to help me with
 Jack> constructing a legend for this scatter?
 Jack> i think i am misusing the scatter graph here... letting
 Jack> scatter assign colours from a continous selection rather
 Jack> than specifying a color.
Yes, you probably want to assign specific colors in multiple calls to
scatter. Scatter returns a
matplotlib.collections.RegularPolyCollection, which legend is not
equiped to deal with. To hack around this, you can create a proxy
patch to pass to legend, which has the colors you want to use for the
legend
from matplotlib.patches import Rectangle
from pylab import *
N=20
props = dict( alpha=0.75, faceted=False )
x, y= rand(2,N)
s=array(([400]+[30]*(N/2-1))*2)
reds = scatter(x, y, c='red', s=s, **props)
x, y= rand(2,N)
s=array(([400]+[30]*(N/2-1))*2)
blues = scatter(x, y, c='blue', s=s, **props)
redp = Rectangle( (0,0), 1,1, facecolor='red')
bluep = Rectangle( (0,0), 1,1, facecolor='blue')
legend( (redp, bluep), ('reds', 'blues') )
grid(True)
show()
From: Mark B. <ma...@gm...> - 2005年09月06日 14:29:29
Regarding the questions of axis('equal') and axis('scaled'), I submitted a=
=20
patch for the axis('equal') command about a month ago that will turn it int=
o=20
the same behavior as matlab. After the axis('equal') command is given, the=
=20
scale on both axes will be equal (such that a circle looks like a circle).=
=20
It has a little demo file with it as well. Hopefully that will be=20
implemented in CVS soon (let me know if I can help here, John),=20
Mark
matlab also has a handy axis('tight') command that sets tight limits on the=
=20
axes such that it contains all data tighly; that would be easy to implement=
=20
as well.
3 messages has been excluded from this view by a project administrator.

Showing results of 352

<< < 1 .. 9 10 11 12 13 .. 15 > >> (Page 11 of 15)
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /