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
|
|
From: Norbert N. <No...@ne...> - 2004-12-02 14:16:37
|
True. Just had to check this again to make sure, but even PS3 does not support Alpha transparency in any way. The big improvement there was bitmapped masking of images, but the whole concept of true transparency really seems to be an extremely new idea. Am Donnerstag, 2. Dezember 2004 13:26 schrieb John Hunter: > >>>>> "Carol" == Carol Leger <car...@sr...> writes: > > Carol> The that the polar plot overlayed on a rectangular plot is > Carol> working in Postscipt, I am having trouble with the > Carol> semi-transparent boxes around the text. > > postscript doesn't support the alpha channel and there is nothing > matplotlib can do about it. It's a postscript limitation. Right now > the only vector output that supports alpha is SVG. Hopefully we'll > get a PDF backend one day which also supports alpha. > > JDH > > > ------------------------------------------------------- > SF email is sponsored by - The IT Product Guide > Read honest & candid reviews on hundreds of IT Products from real users. > Discover which products truly live up to the hype. Start reading now. > http://productguide.itmanagersjournal.com/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- _________________________________________Norbert Nemec Bernhardstr. 2 ... D-93053 Regensburg Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199 eMail: <No...@Ne...> |
|
From: John H. <jdh...@ac...> - 2004-12-02 12:27:37
|
>>>>> "Carol" == Carol Leger <car...@sr...> writes:
Carol> The that the polar plot overlayed on a rectangular plot is
Carol> working in Postscipt, I am having trouble with the
Carol> semi-transparent boxes around the text.
postscript doesn't support the alpha channel and there is nothing
matplotlib can do about it. It's a postscript limitation. Right now
the only vector output that supports alpha is SVG. Hopefully we'll
get a PDF backend one day which also supports alpha.
JDH
|
|
From: Norbert N. <Nor...@gm...> - 2004-12-02 10:14:10
|
OK, now I understand: my problem was just the ordering of show() and savefig()
Doing savefig first and show lateron solved the problem with no further
changes...
Thanks!
Am Donnerstag, 2. Dezember 2004 10:26 schrieb Darren Dale:
> On Thursday 02 December 2004 04:12 am, Norbert Nemec wrote:
> > Hi there,
> >
> > probably a trivial question, but somehow, I'm stuck anyway:
> >
> > I have the following script:
> >
> > ----------
> > #!/usr/bin/env python
> > import matplotlib.matlab
> > ... do some data preparation ...
> > plot(something)
> > show()
> > savefig("output.eps")
> > ----------
> >
> > If I call this script with the -dGtkAgg option, it displays the plot on
> > screen and saves an empty eps file. If I call it with -dPS, it displays
> > nothing and outputs the correct eps - so far everything as I would expect
> > it.
> >
> > Up to now, I just used the -dGtkAgg backend (as default) to get an
> > impression about the plots and then ran the script again to create the
> > .eps.
> >
> > Now, I would like the script to do both in one run: display the plot on
> > screen, and save it to disk at the same time.
> >
> > Somehow I have not achieved doing so. My first idea was to place
> > matplotlib.use('PS')
> > right before the savefig, but that does not change anything and still
> > writes an empty .eps file.
> >
> > What should I do?
>
> Hi Norbert,
>
> Try running this:
>
> ----------
> #!/usr/bin/env python
> matplotlib.use('GTKAgg')
> import matplotlib.matlab
> ... do some data preparation ...
> plot(something)
> savefig("output.eps")
> show()
> ----------
>
> That should save the file as eps and show the plot using the GTK backend.
> matplotlib.use('PS') would have to be called before importing
> matplotlib.matlab, which is why it seemed unresponsive in your script. But
> you dont need to call it for what you want to accomplish.
--
_________________________________________Norbert Nemec
Bernhardstr. 2 ... D-93053 Regensburg
Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
eMail: <No...@Ne...>
|
|
From: Gregory L. <gre...@ff...> - 2004-12-02 09:48:28
|
On Thu, 2004-12-02 at 04:49, Darren Dale wrote: > On Wednesday 01 December 2004 07:34 pm, Stephen Walton wrote: > > On Tue, 2004-11-30 at 17:06 -0500, Perry Greenfield wrote: > > > Yesterday I brought up some user interface issues with John. > > > > A minor point: it would be nice if in toolbar2 the currently active > > zoom or pan tool was highlighted in some way. depending on the backend, it already is...(see fltk for example). I think it is not too difficult to add this for other backends...but only the other backends developers can tell :-) It is also available in the message area (nothing, or "pan/zoom mode", or "zoom to rect mode" is written before the cursor coordinates). > Also a minor point on toolbar2, I have a suggestion for the zoom tool. If one > wanted to zoom in on the a region near the corner or edge of a plot, I think > it would be helpful if the zoom tool would remember the lower limits of the > axis where the pointer exits the axis. The way it works now, you have to be > sure to have the pointer on that last pixel inside the axis boundary when you > release the mouse button. Good point, the behavior was intentional (as a way to cancel a zoom when you started it and though afterward is was not such a good idea), but I have also found this to be more annoying than useful, and anyway the back button is already there ready to help you cancel any action... I will have a look at this to change the behavior (it should check the coordinates of the zoom rect, and adjust it to clip to current axes limits) |
|
From: Darren D. <dd...@co...> - 2004-12-02 09:27:49
|
On Thursday 02 December 2004 04:12 am, Norbert Nemec wrote:
> Hi there,
>
> probably a trivial question, but somehow, I'm stuck anyway:
>
> I have the following script:
>
> ----------
> #!/usr/bin/env python
> import matplotlib.matlab
> ... do some data preparation ...
> plot(something)
> show()
> savefig("output.eps")
> ----------
>
> If I call this script with the -dGtkAgg option, it displays the plot on
> screen and saves an empty eps file. If I call it with -dPS, it displays
> nothing and outputs the correct eps - so far everything as I would expect
> it.
>
> Up to now, I just used the -dGtkAgg backend (as default) to get an
> impression about the plots and then ran the script again to create the
> .eps.
>
> Now, I would like the script to do both in one run: display the plot on
> screen, and save it to disk at the same time.
>
> Somehow I have not achieved doing so. My first idea was to place
> matplotlib.use('PS')
> right before the savefig, but that does not change anything and still
> writes an empty .eps file.
>
> What should I do?
>
Hi Norbert,
Try running this:
----------
#!/usr/bin/env python
matplotlib.use('GTKAgg')
import matplotlib.matlab
... do some data preparation ...
plot(something)
savefig("output.eps")
show()
----------
That should save the file as eps and show the plot using the GTK backend.
matplotlib.use('PS') would have to be called before importing
matplotlib.matlab, which is why it seemed unresponsive in your script. But
you dont need to call it for what you want to accomplish.
--
Darren
|
|
From: Norbert N. <Nor...@gm...> - 2004-12-02 09:12:25
|
Hi there,
probably a trivial question, but somehow, I'm stuck anyway:
I have the following script:
----------
#!/usr/bin/env python
import matplotlib.matlab
... do some data preparation ...
plot(something)
show()
savefig("output.eps")
----------
If I call this script with the -dGtkAgg option, it displays the plot on screen
and saves an empty eps file. If I call it with -dPS, it displays nothing and
outputs the correct eps - so far everything as I would expect it.
Up to now, I just used the -dGtkAgg backend (as default) to get an impression
about the plots and then ran the script again to create the .eps.
Now, I would like the script to do both in one run: display the plot on
screen, and save it to disk at the same time.
Somehow I have not achieved doing so. My first idea was to place
matplotlib.use('PS')
right before the savefig, but that does not change anything and still writes
an empty .eps file.
What should I do?
Thanks,
Norbert
--
_________________________________________Norbert Nemec
Bernhardstr. 2 ... D-93053 Regensburg
Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
eMail: <No...@Ne...>
|
|
From: Nils W. <nw...@me...> - 2004-12-02 09:04:27
|
Hi all,
I tried to visualize the structure of large and sparse matrices using
from matplotlib.colors import LinearSegmentedColormap
from matplotlib.matlab import *
from scipy import *
import IPython
def spy2(Z):
"""
SPY(Z) plots the sparsity pattern of the matrix S as an image
"""
#binary colormap min white, max black
cmapdata = {
'red' : ((0., 1., 1.), (1., 0., 0.)),
'green': ((0., 1., 1.), (1., 0., 0.)),
'blue' : ((0., 1., 1.), (1., 0., 0.))
}
binary = LinearSegmentedColormap('binary', cmapdata, 2)
Z = where(Z>0,1.,0.)
imshow(transpose(Z), interpolation='nearest', cmap=binary)
rows, cols, entries, rep, field, symm = io.mminfo('k0.mtx')
print 'number of rows, cols and entries', rows, cols, entries
print 'Start reading matrix - this may take a minute'
ma = io.mmread('k0.mtx')
print 'Finished'
flag = 1
if flag == 1:
spy2(ma)
show()
It failed. Is it somehow possible to visualize sparse matrices ?
Any suggestion would be appreciated.
Thanks in advance
Nils
number of rows, cols and entries 67986 67986 4222171
Start reading matrix - this may take a minute
Finished
Traceback (most recent call last):
File "spy.py", line 29, in ?
spy2(ma)
File "spy.py", line 19, in spy2
Z = where(Z>0,1.,0.)
File "/usr/lib/python2.3/site-packages/scipy/sparse/Sparse.py", line 145, in __cmp__
raise TypeError, "Comparison of sparse matrices is not implemented."
TypeError: Comparison of sparse matrices is not implemented.
|
|
From: Darren D. <dd...@co...> - 2004-12-02 03:50:41
|
On Wednesday 01 December 2004 07:34 pm, Stephen Walton wrote: > On Tue, 2004-11-30 at 17:06 -0500, Perry Greenfield wrote: > > Yesterday I brought up some user interface issues with John. > > A minor point: it would be nice if in toolbar2 the currently active > zoom or pan tool was highlighted in some way. Also a minor point on toolbar2, I have a suggestion for the zoom tool. If one wanted to zoom in on the a region near the corner or edge of a plot, I think it would be helpful if the zoom tool would remember the lower limits of the axis where the pointer exits the axis. The way it works now, you have to be sure to have the pointer on that last pixel inside the axis boundary when you release the mouse button. -- Darren |
|
From: Andrew S. <str...@as...> - 2004-12-02 02:30:54
|
John Hunter wrote:
>Plea to distutils gurus: if you can figure out a way in the current
>matplotlib setup.py setup to get a module named pylab.py into
>site-packages, please advise! The current module layout is somewhat
>complicated and already stretches my distutils capabilities.
>
>
I wouldn't call myself a distutils guru, but is this what you mean?
#!/usr/bin/env python
from distutils.core import setup
setup(py_modules=['pylab'],
package_dir = {'':'path/to/where/pylab.py/source/is/located'})
|
|
From: Carol L. <car...@sr...> - 2004-12-02 00:50:37
|
The that the polar plot overlayed on a rectangular plot is working in
Postscipt, I am having trouble with the semi-transparent boxes around
the text.
The png file looks fine, but the postcript file does not show the
differences in the alpha value.
Since the code is short, I'll supply it here:
#!/usr/bin python
from matplotlib.matlab import *
def OverlayText(xmax):
x=0
y = 0.65*xmax
ystep = 0.2*xmax
alpha = arange(0.0,1.2,0.2)
for a in alpha:
stext = 'Alpha = %.1f' % a
t = text(x,y,stext)
set(t,bbox={'edgecolor':'w','facecolor':'w','alpha':a})
y = y - ystep
if __name__ == "__main__":
# Make some kind of plot
xmin = -750
xmax = 750
ymin = xmin
ymax = xmax
x = [xmin,xmax,xmax,xmin]
y = [ymin,ymin,ymax,ymax]
fill(x,y,'g',edgecolor='b')
a = gca()
a.set_xlim([xmin,xmax])
a.set_ylim([ymin,ymax])
OverlayText(xmax)
savefig('overlay2.png')
savefig('overlay2.ps')
show()
--
Ms. Carol A. Leger
SRI International Phone: (650) 859-4114
333 Ravenswood Avenue G-273
Menlo Park, CA 94025 e-mail: le...@sr...
|
|
From: Stephen W. <ste...@cs...> - 2004-12-02 00:45:57
|
I don't know where the problem is and I know Fernando is out there
somewhere. Try the following:
In [2]: import numarray.random_array as ra
=20
In [3]: x=3Dra.random((50,50))
=20
In [4]: x.size()
Out[4]: 2500
=20
In [5]: imshow(x)
Out[5]: <matplotlib.image.AxesImage instance at 0x5658c7cc>
=20
In [6]: axis('square')
=20
After the last step you get an error dialog, but clicking OK causes the
whole session to hang. IPython and matplotlib both at version 0.64,
running on Fedora Core 2, numerix: numarray, backend: GTKAgg.
I know now that the last command is incorrect :-), but it is something a
naive MATLAB user coming to matplotlib/ipython for the first time is
likely to try.
--=20
Stephen Walton, Professor, Dept. of Physics & Astronomy, Cal State Northrid=
ge
ste...@cs...
|
|
From: Stephen W. <ste...@cs...> - 2004-12-02 00:35:06
|
On Tue, 2004-11-30 at 17:06 -0500, Perry Greenfield wrote: > Yesterday I brought up some user interface issues with John. A minor point: it would be nice if in toolbar2 the currently active zoom or pan tool was highlighted in some way. --=20 Stephen Walton, Professor, Dept. of Physics & Astronomy, Cal State Northrid= ge ste...@cs... |
|
From: Jeff P. <jef...@se...> - 2004-12-01 23:18:54
|
Hello, I have a simple script that creates a few plots. Although the script is in a while loop and creates plots endlessly, what I want is to have one plot that is updated. How can I tell my script to update a figure rather than create a new one? Thanks. I'm using the WX backend. Thanks. |
|
From: John H. <jdh...@ac...> - 2004-12-01 22:07:15
|
>>>>> "Carol" == Carol Leger <car...@sr...> writes:
>> Yep, this is a bug. In backend_ps in the the set_linedashes
>> function on line 103, replace the line if seq: with if seq is
>> not None and len(seq): My guess is you are using numarray, and
>> if memory serves numarray but not Numeric fails on using an
>> array as a boolean, which is what backend ps is doing here.
>>
Carol> Yes, I am using numarray. I made the change to line 103
Carol> and now line 102 is reporting a similar error.
Ignore my last post - the solution I posted was as buggy as before. I
think I finally nailed this down. Basically, we are comparing seq1
and seq2, either are possibly None, or general sequences, or arrays.
I wrote a little function
def seq_allequal(seq1, seq2):
"""
seq1 and seq2 are either None or sequences or numerix arrays
Return True if both are None or both are seqs with identical
elements
"""
if seq1 is None:
return seq2 is None
if seq2 is None:
return False
#ok, neither are None:, assuming iterable
if len(seq1) != len(seq2): return False
return alltrue(equal(seq1, seq2))
You should import alltrue and equal from the numerix module at the top
of backend_ps, add this function to backend_ps and then replace
set_linedash with
def set_linedash(self, offset, seq):
if self.linedash is not None:
oldo, oldseq = self.linedash
if seq_allequal(seq, oldseq): return
if seq is not None and len(seq):
s="[%s] %d setdash\n"%(_nums_to_str(*seq), offset)
self._pswriter.write(s)
else:
self._pswriter.write("[] 0 setdash\n")
self.linedash = (offset,seq)
I think this is finally coherent. At least it passes my tests now...
JDH
|
|
From: John H. <jdh...@ac...> - 2004-12-01 21:26:46
|
>>>>> "Gregory" == Gregory Lielens <gre...@ff...> writes:
Gregory> I though that calling draw() would update the active
Gregory> figure without starting the mainloop already, or am I
Gregory> confused? Alternatively, in the fltk backend, I have
Gregory> allowed calling show() multiple times, it just check
Gregory> before running the mainloop that it is not already
Gregory> running...Maybe this is also feasible in a more general
Gregory> way?
The matlab interface draw function does not need the renderer passed
as an arg (the FigureCanvas.draw method does) and it is intended for
interactive use when you want to force a redraw
>>> o = title('blah')
>>> o.set_fontsize(12) # no draw
>>> o.set_fontstyle('italic') # no draw
>>> draw() # draw
Perry and I discussed trying to come up with some python magic such
that calls to setattr on an artist would trigger a call to
the matlab interface draw_if_interactive. This would have to be done
carefully, because some users will explicitly not want to force a
redraw on any call to a setter since drawing is potentially an
expensive operation. True, they could temporarily turn interaction
off, but I think any solution here would need to be optional.
JDH
|
|
From: John H. <jdh...@ac...> - 2004-12-01 21:21:44
|
>>>>> "Carol" == Carol Leger <car...@sr...> writes:
>> Yep, this is a bug. In backend_ps in the the set_linedashes
>> function on line 103, replace the line if seq: with if seq is
>> not None and len(seq): My guess is you are using numarray, and
>> if memory serves numarray but not Numeric fails on using an
>> array as a boolean, which is what backend ps is doing here.
>>
Carol> Yes, I am using numarray. I made the change to line 103
Carol> and now line 102 is reporting a similar error.
Sorry for all the troubles here. Try this function for set_linedash
in backend_ps
def set_linedash(self, offset, seq):
if self.linedash is not None:
oldo, oldseq = self.linedash
if offset==oldo and seq==oldseq: return
if seq is not None and len(seq):
s="[%s] %d setdash\n"%(_nums_to_str(*seq), offset)
self._pswriter.write(s)
else:
self._pswriter.write("[] 0 setdash\n")
self.linedash = (offset,seq)
|
|
From: John H. <jdh...@ac...> - 2004-12-01 21:15:21
|
>>>>> "Humufr" == Humufr <hu...@ya...> writes:
Humufr> the bug:
Humufr> I tried:
Humufr> plot([1,2],[4,5],'g^',markersize=4,label='1')
Humufr> errorbar([1,4],[6,7],[1,1],fmt='bh',markersize=4,label='4')
Humufr> #plot([3,4],[6,7])
Humufr> legend()
Humufr> show()
Humufr> and there are a problem with errorbar and the label and
Humufr> the legend. Different line appeard and at the end we have
Humufr> only the good symbols)
I don't consider this a bug but maybe you can convince me :-). Legend
tries to be helpful but not omniscient. If you have many lines and
only want to include some of them in the legend, just use the explicit
legend(lines, labels) form
from matplotlib.matlab import *
l1, = plot([1,2],[4,5],'g^',markersize=4)
l2, errlines = errorbar([1,4],[6,7],[1,1],fmt='bh',markersize=4)
plot([3,4],[6,7])
legend((l1, l2), ('1', '4'))
show()
Your suggestion that the legend ignore lines with empty labels appears
reasonable at first glance, but as Norbert will tell you, some people
use the fact that matplotlib legends include lines with empty labels
to their advantage when laying out legends.
So in this case there is a way to get matplotlib to make the legend
you want, and if legend tries to get too smart about guessing what you
want it will get in the way of power users who don't what matplotlib
guessing what they are trying to do.
Humufr> 2)
Humufr> I add the line: plot([3,4],[6,7]) only to show you that
Humufr> even if the plot command doesn't have a label the legend
Humufr> give a place for it. I think at two solution to solve this
Humufr> (perhaps it's already implemented and I didn't find...):
Humufr> - by default if there are some label with the plot command
Humufr> the plot command without are not take in count to create
Humufr> the legend
Humufr> - add something like: label=None to indicate the the user
Humufr> don't want this line in the legend.
This could work. Currently the default label is '', which as I said
is a perfectly legitimate label in some cases. We could use None as a
hint to legend. It would increase the coding burden somewhat, since
we'd always have to check for None before performing string ops on the
legend. I'm amenable to this approach. Anyone else have input here?
Humufr> Thanks again to have found and correct all this bug so
Humufr> fast, I'm very impressed :)
Thanks!
JDH
|
|
From: John H. <jdh...@ac...> - 2004-12-01 21:01:33
|
>>>>> "Norbert" == Norbert Nemec <Nor...@gm...> writes:
Norbert> Hi there, apart from the "gry"-typo, the currect CVS-code
Norbert> really is in a broken state after my patch was applied
Norbert> and half-way reverted back. (The python2.2-pop problem)
Norbert> Possible solutions:
Norbert> * change "kwargs.get('xxx',def)" to
Norbert> "popd(kwargs,'xxx',def)" and add popd to the import from
Norbert> cbook
Here is what I committed to CVS earlier today in axes.Axes.legend
if len(args)==0:
labels = [line.get_label() for line in self.lines]
lines = self.lines
loc = popd(kwargs, 'loc', 1)
and more like it. I think this works...
JDH
|
|
From: Norbert N. <Nor...@gm...> - 2004-12-01 19:54:22
|
Hi there,
apart from the "gry"-typo, the currect CVS-code really is in a broken state
after my patch was applied and half-way reverted back. (The python2.2-pop
problem)
Possible solutions:
* change "kwargs.get('xxx',def)" to "popd(kwargs,'xxx',def)" and add popd to
the import from cbook
* change "kwargs.get('xxx',def)" to "kwargs.pop('xxx',def)" (will not work for
Python 2.2
* change the last lines of Axes.legend according to:
lines = flatten(lines)
+ kwargs["loc"] = loc
+ self.legend_ = Legend(self, lines, labels, **kwargs)
- self.legend_ = Legend(self, lines, labels, loc, **kwargs)
return self.legend_
I guess, the first solution is, what will be done in the long run.
Ciao,
Nobbi
Am Mittwoch, 1. Dezember 2004 15:34 schrieb Humufr:
> Hi John,
>
> I tried:
> > Yep, it's a bug. Replace the indicate line from
> > axes.py
> >
> > loc = kwargs.gry('loc', 1)
> >
> > with
> >
> > loc = kwargs.get('loc', 1)
> > ^^^
>
> That correct the problem with legend() but I have another problem and I
> think it's another bug (not sure) it's not possible to tell to
> matplotlib in this case o use the "loc" keywords more it's impossible to
> use this keywords. There are always an error message:
> File "<string>", line 3, in legend
> File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line 1502,
> in legend
> self.legend_ = Legend(self, lines, labels, loc, **kwargs)
> TypeError: __init__() got multiple values for keyword argument 'loc'
>
>
> example:
>
> plot ([2,3],[4,5])
> legend(('toto'),loc=2)
>
> I tried everything: loc='upper left', loc=0,1 , loc=(0,1), loc=2 etc.
> Nothing work but if I omit the " loc= " . It's ok and that explain
> probably why I cant do something like:
>
> plot([1,2],[4,5],label='toto')
> legend(loc='upper left')
>
>
> Another strange thing I remark is:
>
> if you are doing:
>
> plot([1,2],[4,5])
> legend(('toto'))
>
> the text for the legend is vertical and not horizontal, that's work
> normally when we are using more than one argument.
>
> Thank you very much for you fast answer and sorry for the second
> question I had to verify more precisely in the archival.
>
>
> Nicolas
>
>
> -------------------------------------------------------
> SF email is sponsored by - The IT Product Guide
> Read honest & candid reviews on hundreds of IT Products from real users.
> Discover which products truly live up to the hype. Start reading now.
> http://productguide.itmanagersjournal.com/
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
--
_________________________________________Norbert Nemec
Bernhardstr. 2 ... D-93053 Regensburg
Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
eMail: <No...@Ne...>
|
|
From: Humufr <hu...@ya...> - 2004-12-01 19:43:27
|
Hi John, I just recuperate the cvs and I saw that you correct a lot of things inside the legend, thanks very much. you will hate me soon I think :) but I found one bug and onething I don't like too much: 1) the bug: I tried: plot([1,2],[4,5],'g^',markersize=4,label='1') errorbar([1,4],[6,7],[1,1],fmt='bh',markersize=4,label='4') #plot([3,4],[6,7]) legend() show() and there are a problem with errorbar and the label and the legend. Different line appeard and at the end we have only the good symbols) 2) I add the line: plot([3,4],[6,7]) only to show you that even if the plot command doesn't have a label the legend give a place for it. I think at two solution to solve this (perhaps it's already implemented and I didn't find...): - by default if there are some label with the plot command the plot command without are not take in count to create the legend - add something like: label=None to indicate the the user don't want this line in the legend. Thanks again to have found and correct all this bug so fast, I'm very impressed :) Nicolas |
|
From: Chris B. <Chr...@no...> - 2004-12-01 19:31:45
|
HI all,
When I do:
from matplotlib.matlab import *
I get the following warning message:
Could not load matplotlib icon: Couldn't recognize the image file format
for file '/usr/share/matplotlib/matplotlib.svg'
This is really just a minor annoyance, but it's been doing this for the
last couple of releases. Anyone know why? why is it trying to load an svg?
Gentoo Linux Python 2.3.3, matplotlib 0.64, pygtk2.0 (I think)
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Carol L. <car...@sr...> - 2004-12-01 17:19:59
|
> Yep, this is a bug. In backend_ps in the the set_linedashes function
> on line 103, replace the line
>
> if seq:
>
> with
>
> if seq is not None and len(seq):
>
> My guess is you are using numarray, and if memory serves numarray but
> not Numeric fails on using an array as a boolean, which is what
> backend ps is doing here.
>
>
Yes, I am using numarray. I made the change to line 103 and now line
102 is reporting a similar error.
Traceback (most recent call last):
File "testoverlay.py", line 91, in ?
savefig('overlay.ps')
File "/usr/lib/python2.3/site-packages/matplotlib/matlab.py", line
1008, in savefig
manager.canvas.print_figure(*args, **kwargs)
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_gtkagg.py",
line 66, in print_figure
agg.print_figure(filename, dpi, facecolor, edgecolor, orientation)
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_agg.py",
line 385, in print_figure
ps.print_figure(filename, dpi, facecolor, edgecolor, orientation)
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py",
line 570, in print_figure
self.figure.draw(renderer)
File "/usr/lib/python2.3/site-packages/matplotlib/figure.py", line
254, in draw
for a in self.axes: a.draw(renderer)
File "/usr/lib/python2.3/site-packages/matplotlib/axes.py", line
3125, in draw
l.draw(renderer)
File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line
257, in draw
lineFunc(renderer, gc, xt, yt)
File "/usr/lib/python2.3/site-packages/matplotlib/lines.py", line
513, in _draw_dotted
renderer.draw_lines(gc, xt, yt)
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py",
line 275, in draw_lines
self._draw_lines(gc,points[0:1000])
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py",
line 264, in _draw_lines
self._draw_ps("\n".join(ps), gc, None)
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py",
line 375, in _draw_ps
self.set_linedash(*gc.get_dashes())
File
"/usr/lib/python2.3/site-packages/matplotlib/backends/backend_ps.py",
line 102, in set_linedash
if (offset,seq) != self.linedash:
File "/usr/lib/python2.3/site-packages/numarray/generic.py", line
477, in __nonzero__
raise RuntimeError("An array doesn't make sense as a truth value.
Use sometrue(a) or alltrue(a).")
RuntimeError: An array doesn't make sense as a truth value. Use
sometrue(a) or alltrue(a).
--
Ms. Carol A. Leger
SRI International Phone: (650) 859-4114
333 Ravenswood Avenue G-273
Menlo Park, CA 94025 e-mail: le...@sr...
|
|
From: Perry G. <pe...@st...> - 2004-12-01 15:48:46
|
On Dec 1, 2004, at 10:07 AM, Alan G Isaac wrote: > On Tue, 30 Nov 2004, Perry Greenfield apparently wrote: >> 3) Tick control can be awkward if one simply wants to add an integral >> number of minor ticks to the chosen major tick interval. Currently >> using minor ticks forces one to access the plot objects, and specify >> the major tick interval as well. It would be nice if one could just >> ask >> for n minor ticks for each major tick interval by using the >> appropriate >> keyword (name tbd). Some illustrations of possible alternatives: > >> plot(x, y, xmajor=5) >> plot(x, y, xmajor=5, xminor=1) >> plot(x, y, xminordiv=5) # 5 minor ticks per major > > The basic idea is very useful, but I think it is more common > to specify the number of subdivisions rather than the number > of tic marks. (E.g., 'freq' in gnuplot or 'minordiv' in > GAUSS.) Maybe that's what you meant? I do not know the > Matlab convention. > Yes, you are right, I meant number of subdivisions. |
|
From: Alan G I. <ai...@am...> - 2004-12-01 15:30:29
|
On Tue, 30 Nov 2004, Perry Greenfield apparently wrote: > 3) Tick control can be awkward if one simply wants to add an integral > number of minor ticks to the chosen major tick interval. Currently > using minor ticks forces one to access the plot objects, and specify > the major tick interval as well. It would be nice if one could just ask > for n minor ticks for each major tick interval by using the appropriate > keyword (name tbd). Some illustrations of possible alternatives: > plot(x, y, xmajor=5) > plot(x, y, xmajor=5, xminor=1) > plot(x, y, xminordiv=5) # 5 minor ticks per major The basic idea is very useful, but I think it is more common to specify the number of subdivisions rather than the number of tic marks. (E.g., 'freq' in gnuplot or 'minordiv' in GAUSS.) Maybe that's what you meant? I do not know the Matlab convention. fwiw, Alan Isaac |
|
From: John H. <jdh...@ac...> - 2004-12-01 14:56:02
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes:
Jochen> Hello Nicolas
Jochen> On Wed, Dec 01, 2004 at 09:34:51AM -0500, Humufr wrote:
>> Another strange thing I remark is:
>>
>> if you are doing:
>>
>> plot([1,2],[4,5]) legend(('toto'))
>>
>> the text for the legend is vertical and not horizontal, that's
>> work normally when we are using more than one argument.
Jochen> This happens because ('toto') is not a one-element list
Jochen> but a string. If you write
Jochen> plot([1,2],[4,5]) legend(('toto',))
Jochen> instead it works as expected.
This is such a common mistake I think we should special case string
input for the labels and make it a len(1) tuple
if is_string_like(labels): labels = (labels, )
All opposed, say nay!
JDH
|