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
(13) |
2
(11) |
3
|
4
(9) |
|
5
(3) |
6
(17) |
7
(24) |
8
(11) |
9
(26) |
10
(19) |
11
(4) |
|
12
(4) |
13
(14) |
14
(9) |
15
(5) |
16
(18) |
17
(23) |
18
(3) |
|
19
(1) |
20
(7) |
21
(27) |
22
(26) |
23
(6) |
24
(17) |
25
(1) |
|
26
|
27
(7) |
28
(1) |
29
(4) |
30
(5) |
|
|
|
From: Roman B. <be...@sm...> - 2006-11-22 20:05:10
|
Hello,
i had problems subscribing to the list, maybe the mail below I sent last
week, was not delivered. Hence I send it again:
---------------------------------------------------
Hello,
i try to write a module which evaluates various Data, and occasionally
creates a plot, which is returned to the user. At the discretion of the
user, he should be able to show selected plots. This is an example
module with two approaches for this problem:
-----------------
import pylab
import matplotlib
def makeplot1():
pylab.ioff()
fig = pylab.figure()
spl1 = fig.add_subplot(211)
spl2 = fig.add_subplot(212)
spl1.plot([1,4,9,16])
spl2.plot([1,3,5,7])
pylab.ion()
return fig
def makeplot2():
fig = matplotlib.figure.Figure()
spl1 = fig.add_subplot(211)
spl2 = fig.add_subplot(212)
spl1.plot([1,4,9,16])
spl2.plot([1,3,5,7])
return fig
----------------------
The user fires up ipython and imports my module:
ipython -pylab
>>> import plotgen
After analysizing various data, he wants to look at a particular plot:
>>> fig = plotgen.makeplot1()
Now can one make pop up this plot? I tried to make this figure current:
>>> figure(fig.number)
but nothing to see. Then:
>>> draw()
>>> ion()
Only show() works, but this pops up all figures defined, and this can be
a large number of figures if makeplot1() has been called often, or I
have many figures. I only want to see this particular figure.
So next try with the object oriented interface:
>>> fig = plotgen.makeplot2()
>>> figure(fig.number)
AttributeError: Figure instance has no attribute 'number'
Ok, this does not work. In a cookbook i saw that one needs something
like "canvas = FigureCanvasAgg(fig)". But i cannot use it: As writer of
module "plotgen" i dont know what backend (Agg) is used by the user. And
the user simply uses "ipython -pylab" and should not care about the
backend.
Whats the correct solution for my problem?
Best Regards,
Roman
|
|
From: Christopher B. <Chr...@no...> - 2006-11-22 19:41:21
|
giovanni ruggiero wrote: > Hi All, > I had problens to use the function quiver with the matplotlib 82-5. Eric > advice me to upgrade the mpl. I have tried to upgrade the matplotlib but > i have to upgrade almost all my libs. The case is that i can not upgrade > these dependences without affect all my configuration wich means that i > need to install my system again. Am i correct? You should be able to have newer version of libs alongside the old ones. If there are not compatible packages (rpms, debs, whatever) for the newer libs, you should be able to build them by hand (./configure, make, etc). Just make sure they are installed in /usr/local/... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: John H. <jdh...@ac...> - 2006-11-22 19:31:36
|
>>>>> "giovanni" == giovanni ruggiero <oc...@ya...> writes:
giovanni> Hi All, I had problens to use the function quiver with
giovanni> the matplotlib 82-5. Eric advice me to upgrade the
giovanni> mpl. I have tried to upgrade the matplotlib but i have
giovanni> to upgrade almost all my libs. The case is that i can
giovanni> not upgrade these dependences without affect all my
giovanni> configuration wich means that i need to install my
giovanni> system again. Am i correct? If yes, What linux do you
giovanni> advice for me? Does anybody see another way to upgrade
giovanni> my mpl? Thanks
With a proper debian configuration, this should be as easy as
> sudo apt-get install python-matplotlib
If can't do this because your debian distro is too old or because you
are not properly using debian package management, you may consider
getting a newer distro (ubuntu is a debian distro that is current and
popular with scientific python users and developers) and/or spending the
time to get a smoothly functioning apt configuration so you can
upgrade painlessly and w/o fear.
JDH
|
|
From: giovanni r. <oc...@ya...> - 2006-11-22 19:24:01
|
Hi All, =0AI had problens to use the function quiver with the matplotlib 82= -5. Eric advice me to upgrade the mpl. I have tried to upgrade the matplotl= ib but i have to upgrade almost all my libs. The case is that i can not upg= rade these dependences without affect all my configuration wich means that = i need to install my system again. Am i correct? If yes, What linux do you = advice for me? Does anybody see another way to upgrade my mpl?=0AThanks=0A= =0A=0A=0A=0A=0A=09=09=0A___________________________________________________= ____ =0AYahoo! Acesso Gr=E1tis - Internet r=E1pida e gr=E1tis. Instale =0Ao= discador agora! =0Ahttp://br.acesso.yahoo.com |
|
From: John H. <jdh...@ac...> - 2006-11-22 18:36:26
|
>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes:
Samuel> I don't know where the transparency is coming from
Samuel> either. I don't know where I would set the alpha. Could it
Samuel> be in the .rc file? Could it be the way Macs process png
Samuel> files. If you like I can send a copy of the image
I looked at it and yes the alpha channel is zero. Very bizarre.
Please send a free standing script, the rc file you are using, the
output of the script when you run the file with --verbose-helpful and
the generated image file.
JDH
|
|
From: Samuel M. S. <sm...@sa...> - 2006-11-22 18:30:30
|
I don't know where the transparency is coming from either. I don't know where I would set the alpha. Could it be in the .rc file? Could it be the way Macs process png files. If you like I can send a copy of the image On 21 Nov, 2006, at 12:29, John Hunter wrote: >>>>>> "Samuel" == Samuel M Smith <sm...@sa...> writes: > > Samuel> I figured it out. It is saving the outside edge as > Samuel> transparent not gray. I was viewing the images in Apple's > Samuel> preview and it displays transparent as gray (not > Samuel> checkerboard like photoshop or graphic converter). > > I still don't understand where the transparency is coming from (unless > you are setting the alpha explicitly somewhere else). In the example > output I posted previously, the 4th entry in the image RGBAs is 1, > indicating that the alpha channel is 1, fully opaque. > > JDH ********************************************************************** Samuel M. Smith Ph.D. 2966 Fort Hill Road Eagle Mountain, Utah 84005-4108 801-768-2768 voice 801-768-2769 fax ********************************************************************** "The greatest source of failure and unhappiness in the world is giving up what we want most for what we want at the moment" ********************************************************************** |
|
From: John H. <jdh...@ac...> - 2006-11-22 18:26:44
|
>>>>> "Eric" == Eric Firing <ef...@ha...> writes:
Eric> fine. But if it (mainly the function option) is something
Eric> that merely might be useful to someone someday, then I
Eric> suggest it be left out until there is a clear need. (My 2
Eric> cents-worth, or less.)
sounds good
Eric> Curiosity questions about implementation:
Eric> 1) What is the "tocoo" method, and what objects have it? 2)
If someone is already using a sparse matrix from scipy.sparse, it's a
lot more efficient to use the sparse matrix functionality than to do
the sparsity check myself
Help on class coo_matrix in module scipy.sparse.sparse:
class coo_matrix(spmatrix)
| A sparse matrix in coordinate list format.
|
| COO matrices are created either as:
| A = coo_matrix(None, dims=(m, n), [dtype])
| for a zero matrix, or as:
| A = coo_matrix((obj, ij), [dims])
| where the dimensions are optional. If supplied, we set (M, N) =
| dims.
| If not supplied, we infer these from the index arrays
| ij[0][:] and ij[1][:]
|
| The arguments 'obj' and 'ij' represent three arrays:
| 1. obj[:] the entries of the matrix, in any order
| 2. ij[0][:] the row indices of the matrix entries
| 3. ij[1][:] the column indices of the matrix entries
|
| So the following holds:
| A[ij[0][k], ij[1][k] = obj[k]
Eric> Is there a reason why one shouldn't simply default precision
Eric> to 0 and use the condition "absolute(asarray(Z)) <=
Eric> precision"?
Minor performance issue since thisapproach requires two passes
through the data whereas mine takes one when precision=None
Eric> One more miscellaneous thought: perhaps spy and spy2 should
Eric> be consolidated into a single function with a kwarg to
Eric> select the marker version or the image version? Their
Eric> purpose is identical (isn't it?), and it would reduce
Eric> namespace clutter.
Fine by me -- if you want to implement it :-)
JDH
|
|
From: Michael H. <mic...@bc...> - 2006-11-22 18:19:24
|
hi, does anybody know I can show figure legend for 3D plots correctly? I am using Axes3D.scatter3D which returns a Patch3D object, which seems not to work with pylab.figlegend thanks! michael |
|
From: Eric F. <ef...@ha...> - 2006-11-22 18:12:29
|
Robert Cimrman wrote: > John Hunter wrote: >>>>>>> "Robert" == Robert Cimrman <cim...@nt...> writes: >> >> Robert> BTW would you consider changing the definition of spy(2) >> Robert> as shown below, so that one could specify what 'to be a >> Robert> zero' means? >> >> I added these enhancement, and a couple more, and an >> examples/spy_demos.py. >> >> On reflection, it might be better to allow the user to simply pass a >> sparsity function rather than a precision >> >> def not_zero(Z): >> return Z!=0. >> >> class not_near_zero: >> def __init__(self, precision): >> self.precision = precision >> def __call__(self, Z): >> return absolute(asarray(Z))>self.precision >> >> def spy(Z, element=not_zero): >> mask = element(Z) >> >> Then you could do: >> >> spy(Z, issparse=not_near_zero(1e-6)) >> >> >> >> The precision implementation you suggested is in svn, but if there is >> any consensus that either of these approaches is better, speak up. > > I was thinking about passing directly a function (or an expression?) > too. But I would not remove the precision argument, since it's usage is > simpler, and is usually all one needs. The best would be to have both > possibilities :) (function, if present, taking precedence?) I agree--and in fact my uninformed view is that even the precision option is taking spy beyond the realm of showing true sparcity. If this is genuinely useful to people, then fine. But if it (mainly the function option) is something that merely might be useful to someone someday, then I suggest it be left out until there is a clear need. (My 2 cents-worth, or less.) Curiosity questions about implementation: 1) What is the "tocoo" method, and what objects have it? 2) Is there a reason why one shouldn't simply default precision to 0 and use the condition "absolute(asarray(Z)) <= precision"? One more miscellaneous thought: perhaps spy and spy2 should be consolidated into a single function with a kwarg to select the marker version or the image version? Their purpose is identical (isn't it?), and it would reduce namespace clutter. Eric |
|
From: Christopher B. <Chr...@no...> - 2006-11-22 17:48:23
|
One more note: Christopher Barker wrote: > I wonder if you had installed 6.3.8 yourself. If you did, it really should have been put in /usr/local/ somewhere -- then you wouldn't risk conflicts with Apple's version. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Jeff W. <js...@fa...> - 2006-11-22 16:45:30
|
Christopher Barker wrote: > Tony Mannucci wrote: > >> If you saw my previous post about upgrading to XDarwin 1.1.3, and >> breaking matplotlib, the following seems to work: >> >> Soft-linking to libfreetype.6.3.8.dylib rather than >> libfreetype.6.3.dylib (see below, copied from previous email). >> > > That's interesting. I don't have a 6.3.8, only 6.3 (and 6, linked to > 6.3). I did just install the latest Apple X11 update. > Same here (intel mac with X11 1.1.3). -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 NOAA/OAR/CDC R/PSD1 FAX : (303)497-6449 325 Broadway Boulder, CO, USA 80305-3328 |
|
From: Ted D. <ted...@jp...> - 2006-11-22 16:32:57
|
John,
One small note - we've been bitten in the past by doing:
x != 0
This assumes a numeric (int/float) quantity. If someone substitutes
a different type that looks like a number, this will most likely
fail. Python has a __nonzero__ method which can be used by calling
'not' or 'bool()':
not x == ! bool( x )
All the numeric types implement this correctly (i.e. like a test for
x == 0). Of course, I haven't been following this conversion so I'm
not sure this applies here...
Ted
At 06:08 AM 11/22/2006, John Hunter wrote:
> >>>>> "Robert" == Robert Cimrman <cim...@nt...> writes:
>
>
> Robert> BTW would you consider changing the definition of spy(2)
> Robert> as shown below, so that one could specify what 'to be a
> Robert> zero' means?
>
>I added these enhancement, and a couple more, and an
>examples/spy_demos.py.
>
>On reflection, it might be better to allow the user to simply pass a
>sparsity function rather than a precision
>
>def not_zero(Z):
> return Z!=0.
>
>class not_near_zero:
> def __init__(self, precision):
> self.precision = precision
> def __call__(self, Z):
> return absolute(asarray(Z))>self.precision
>
>def spy(Z, element=not_zero):
> mask = element(Z)
>
>Then you could do:
>
>spy(Z, issparse=not_near_zero(1e-6))
>
>
>
>The precision implementation you suggested is in svn, but if there is
>any consensus that either of these approaches is better, speak up.
>
>JDH
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share your
>opinions on IT & business topics through brief surveys - and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>Matplotlib-users mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
|
|
From: Christopher B. <Chr...@no...> - 2006-11-22 15:53:55
|
Tony Mannucci wrote: > If you saw my previous post about upgrading to XDarwin 1.1.3, and > breaking matplotlib, the following seems to work: > > Soft-linking to libfreetype.6.3.8.dylib rather than > libfreetype.6.3.dylib (see below, copied from previous email). That's interesting. I don't have a 6.3.8, only 6.3 (and 6, linked to 6.3). I did just install the latest Apple X11 update. Also, in the past, MPL has been know not to work with Apple's X11 libfreetype. I wonder if you had installed 6.3.8 yourself. That would have explained it, in that usually if you install, for instance, 6.3.8, there would be a link from 6.3 to 6.3.8, which may have been what you linked to originally. Then, if Apple provided a new 6.3 with their X11, it overwrote yours. I do note that your 6.3.8 is MUCH larger than 6.3, which is a bit curious. Anyway, most of us end up linking MPL statically against a self-installed libfreetype, just for these reasons. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Robert C. <cim...@nt...> - 2006-11-22 14:18:01
|
John Hunter wrote: >>>>>> "Robert" == Robert Cimrman <cim...@nt...> writes: > > > Robert> BTW would you consider changing the definition of spy(2) > Robert> as shown below, so that one could specify what 'to be a > Robert> zero' means? > > I added these enhancement, and a couple more, and an > examples/spy_demos.py. > > On reflection, it might be better to allow the user to simply pass a > sparsity function rather than a precision > > def not_zero(Z): > return Z!=0. > > class not_near_zero: > def __init__(self, precision): > self.precision = precision > def __call__(self, Z): > return absolute(asarray(Z))>self.precision > > def spy(Z, element=not_zero): > mask = element(Z) > > Then you could do: > > spy(Z, issparse=not_near_zero(1e-6)) > > > > The precision implementation you suggested is in svn, but if there is > any consensus that either of these approaches is better, speak up. I was thinking about passing directly a function (or an expression?) too. But I would not remove the precision argument, since it's usage is simpler, and is usually all one needs. The best would be to have both possibilities :) (function, if present, taking precedence?) r. |
|
From: John H. <jdh...@ac...> - 2006-11-22 14:13:44
|
>>>>> "Stephen" == Stephen George <ste...@op...> writes:
Stephen> Have a lot of data, and when looking at full view I'd
Stephen> like no markers, but when zoom in to see individual
Stephen> points I'd like to place markers on the graph. Planing
Stephen> on attaching some code to events to toggle markers on my
Stephen> line. Is there a way to change the markers a line uses
Stephen> after it has been plotted, or do I have to clear the plot
Stephen> and replot?
Here is some example code that changes the marker style based on zoom
level. I wrote the example initially to show how to clip data from a
line based on zoom, but it also changes the marker style based on
number of points in the view window
"""
Clip a line according to the current xlimits, and change the marker
style when zoomed in
"""
from matplotlib.lines import Line2D
import matplotlib.numerix as nx
from pylab import figure, show
class ClippedLine(Line2D):
"""
Clip the xlimits to the axes view limits -- this example assumes x is sorted
"""
def __init__(self, ax, *args, **kwargs):
Line2D.__init__(self, *args, **kwargs)
self.ax = ax
def set_data(self, *args, **kwargs):
Line2D.set_data(self, *args, **kwargs)
self.xorig = nx.array(self._x)
self.yorig = nx.array(self._y)
def draw(self, renderer):
xlim = self.ax.get_xlim()
ind0, ind1 = nx.searchsorted(self.xorig, xlim)
self._x = self.xorig[ind0:ind1]
self._y = self.yorig[ind0:ind1]
N = len(self._x)
if N<1000:
self._marker = 's'
self._linestyle = '-'
else:
self._marker = None
self._linestyle = '-'
Line2D.draw(self, renderer)
fig = figure()
ax = fig.add_subplot(111, autoscale_on=False)
t = nx.arange(0.0, 100.0, 0.01)
s = nx.sin(2*nx.pi*t)
line = ClippedLine(ax, t, s, color='g', ls='-', lw=2)
ax.add_line(line)
ax.set_xlim(10,30)
ax.set_ylim(-1.1,1.1)
show()
|
|
From: John H. <jdh...@ac...> - 2006-11-22 14:08:49
|
>>>>> "Robert" == Robert Cimrman <cim...@nt...> writes:
Robert> BTW would you consider changing the definition of spy(2)
Robert> as shown below, so that one could specify what 'to be a
Robert> zero' means?
I added these enhancement, and a couple more, and an
examples/spy_demos.py.
On reflection, it might be better to allow the user to simply pass a
sparsity function rather than a precision
def not_zero(Z):
return Z!=0.
class not_near_zero:
def __init__(self, precision):
self.precision = precision
def __call__(self, Z):
return absolute(asarray(Z))>self.precision
def spy(Z, element=not_zero):
mask = element(Z)
Then you could do:
spy(Z, issparse=not_near_zero(1e-6))
The precision implementation you suggested is in svn, but if there is
any consensus that either of these approaches is better, speak up.
JDH
|
|
From: Christian K. <ck...@ho...> - 2006-11-22 13:20:33
|
Darren Dale <dd55@...> writes: > We tried supporting sans-serif ticklabels with usetex a while back, and it > turned out to be a headache. I'll have a look at cmbright, but no promises. Thanks. Btw., I didn't know about cmbright before looking at this problem. It seems to be part of most tex distributions, e.g. tetex, miktex. Christian |
|
From: Darren D. <dd...@co...> - 2006-11-22 11:26:19
|
On Wednesday 22 November 2006 3:27 am, Christian Kristukat wrote:
> I am unable to get sans-serif tick labels with matplotlib 0.87.5 in tex
> text mode. I tried with some hints from the list archive but had no
> success. So I had a look at the tex-files which are created to render the
> tick labels, which look like this:
>
> \documentclass{article}
> \usepackage{type1cm}
> \renewcommand{\rmdefault}{pnc}
> \usepackage{helvet}
> \usepackage{courier}
> \usepackage{textcomp}
> \usepackage[papersize={72in,72in}, body={70in,70in},
> margin={1in,1in}]{geometry}
> \pagestyle{empty}
> \begin{document}
> \fontsize{16.000000}{20.000000}{\sffamily $80$}
> \end{document}
>
> According to the psnfss doc, the package helvet does not affect the font in
> math mode. So I don't see why a tick label '$80$' should be rendered in
> sans-serif.
Right, most fonts do not provide sans-serif math-mode fonts. And the
ticklabels are always rendered in math mode, such that minus signs are
rendered as minus signs (and not hyphens). That may seem like a minor issue,
but having hyphens for minus signs on a linear x-axis and regular minus signs
on a log y-axis doesnt look professional.
> I experimented with texmanager.py and added a
> \usepackage{cmbright}, which introduces sans-serif fonts in math mode,
> and was able to display sans-serif tick labels on screen but the ps-backend
> failed with a segfault(!).
>
> I simply added an element to the font_info dict in texmanager.py:
>
> 'cmbright' : ('cmbr', r'\usepackage{cmbright}'),
>
> and added 'CMBright' to the list of sans-serif fonts in my .matplotlibrc
>
> It would be nice if some tex-expert could have a look at this or tell me
> what I could do to get sans-serif tick labels.
We tried supporting sans-serif ticklabels with usetex a while back, and it
turned out to be a headache. I'll have a look at cmbright, but no promises.
Darren
|
|
From: Christian K. <ck...@ho...> - 2006-11-22 08:27:23
|
I am unable to get sans-serif tick labels with matplotlib 0.87.5 in tex
text mode. I tried with some hints from the list archive but had no success.
So I had a look at the tex-files which are created to render the tick labels,
which look like this:
\documentclass{article}
\usepackage{type1cm}
\renewcommand{\rmdefault}{pnc}
\usepackage{helvet}
\usepackage{courier}
\usepackage{textcomp}
\usepackage[papersize={72in,72in}, body={70in,70in},
margin={1in,1in}]{geometry}
\pagestyle{empty}
\begin{document}
\fontsize{16.000000}{20.000000}{\sffamily $80$}
\end{document}
According to the psnfss doc, the package helvet does not affect the font in
math mode. So I don't see why a tick label '$80$' should be rendered in
sans-serif. I experimented with texmanager.py and added a
\usepackage{cmbright}, which introduces sans-serif fonts in math mode,
and was able to display sans-serif tick labels on screen but the ps-backend
failed with a segfault(!).
I simply added an element to the font_info dict in texmanager.py:
'cmbright' : ('cmbr', r'\usepackage{cmbright}'),
and added 'CMBright' to the list of sans-serif fonts in my .matplotlibrc
It would be nice if some tex-expert could have a look at this or tell me what
I could do to get sans-serif tick labels.
Christian
|
|
From: Robert C. <cim...@nt...> - 2006-11-22 07:52:26
|
John Hunter wrote:
>>>>>> "Eric" == Eric Firing <ef...@ha...> writes:
>
> Eric> Yes, it should be !=0. The purpose is to show how sparse a
> Eric> matrix is--how much is filled with zeros--by displaying the
> Eric> non-zero entries.
>
> OK I fixed it. Thanks.
Thanks!
BTW would you consider changing the definition of spy(2) as shown below,
so that one could specify what 'to be a zero' means?
r.
def spy(self, Z, precision = None, marker='s', markersize=10, **kwargs):
if hasattr(Z, 'tocoo'):
c = Z.tocoo()
if precision is None:
x = c.row
y = c.col
z = c.data
else:
ii = where( abs( c.data ) > precision )[0]
x = c.row[ii]
y = c.col[ii]
z = c.data[ii]
else:
if precision is None:
x,y,z = matplotlib.mlab.get_xyz_where(Z, Z != 0)
else:
x,y,z = matplotlib.mlab.get_xyz_where(Z, abs( Z ) > precision)
return self.plot(x+0.5,y+0.5, linestyle='None',
marker=marker,markersize=markersize, **kwargs)
|
|
From: Richard J. <soy...@tb...> - 2006-11-22 06:50:57
|
I have been trying the 3D matplotlib examples in http://www.scipy.org/Cookbook/Matplotlib/mplot3D using ipython as follows: python -pylab -p scipy import matplotlib.axes3d as ax3d u=r_[0:2*pi:100j] v=r_[0:2*pi:100j] x=10*outer(cos(u),sin(v)) y=10*outer(sin(u),sin(v)) z=10*outer(ones(size(u)),cos(v)) a=ravel(x) b=ravel(y) c=ravel(z) fig=figure() ax=ax3d.Axes3D(fig) This works fine for ax.plot_wireframe(x,y,z) and ax.scatter3D(a,b,c) but when I try ax.plot3D(a,b,c) the following errors appear: x.plot3D(a,b,c) --------------------------------------------------------------------------- exceptions.TypeError Traceback (most recent call last) /home/rj/<ipython console> /usr/lib/python2.3/site-packages/matplotlib/axes3d.py in plot3D(self, xs, ys, zs, *args, **kwargs) 488 def plot3D(self, xs, ys, zs, *args, **kwargs): 489 had_data = self.has_data() --> 490 lines = Axes.plot(self, xs,ys, *args, **kwargs) 491 if len(lines)==1: 492 line = lines[0] /usr/lib/python2.3/site-packages/matplotlib/axes.py in plot(self, *args, **kwargs) 2129 lines = [line for line in lines] # consume the generator 2130 -> 2131 self.autoscale_view(scalex=scalex, scaley=scaley) 2132 return lines 2133 TypeError: autoscale_view() got an unexpected keyword argument 'scalex' Also, moving the mouse into the blank figure window gives many errors like: File "/usr/lib/python2.3/site-packages/matplotlib/proj3d.py", line 243, in proj_trans_points return proj_transform(xs,ys,zs,M) File "/usr/lib/python2.3/site-packages/matplotlib/proj3d.py", line 226, in proj_transform return proj_transform_vec(vec,M) File "/usr/lib/python2.3/site-packages/matplotlib/proj3d.py", line 185, in proj_transform_vec vecw = nx.matrixmultiply(M,vec) TypeError: unsupported operand type(s) for *: 'NoneType' and 'float' I am using Scientific Linux 4.4 i386 Scipy(with ATLAS) & numpy from svn, rev. 2292 & 3375 respectively MatPlotLib 87.7 Any ideas about what is going on? Thanks RJ |
|
From: Pierre GM <pgm...@gm...> - 2006-11-22 04:22:45
|
On Tuesday 21 November 2006 22:09, Stephen George wrote:
> Thank you Pierre,
>
> I've taken a while to get around to it, but this code worked a treat,
> and taught me a little about how I can override things in matplotlib
Glad you found it useful.
playing some more about it, I realized that there could be some improvement
with small values between 0.001 and 1: the following modifications should
take care of that:
def _set_orderOfMagnitude(self, mrange):
"""Sets the order of margnitude."""
locs = N.absolute(self.locs)
if self.offset:
oom = math.floor(math.log10(mrange))
else:
if locs[0] > locs[-1]:
val = locs[0]
else:
val = locs[-1]
if val == 0:
oom = 0
else:
oom = math.floor(math.log10(val))
if oom <= -3:
self.orderOfMagnitude = 3*(oom//3)
elif oom <= -1:
self.orderOfMagnitude = -3
elif oom >= 4:
self.orderOfMagnitude = 3*(oom//3)
else:
self.orderOfMagnitude = 0
|
|
From: Stephen G. <ste...@op...> - 2006-11-22 03:09:36
|
Thank you Pierre,
I've taken a while to get around to it, but this code worked a treat,
and taught me a little about how I can override things in matplotlib
Thanks
Steve
Pierre GM wrote:
>> One thing I cannot work out is the axis number presentation.
>> Cannot find any documentation about how to control the presentation of
>> the axis number.
>>
>
> Poke around ticker.formatter
>
>
>> However I would prefer it would present in enginering notation (10, 100,
>> 1e3, 10e3, 100e3, 1e6, 10e6 ...etc)
>>
>
> The easiest is to define your own formatter. Please try the solution below.
> You can use it as:
> gca().xaxis.set_major_formatter(EngrFormatter(3))
>
> #####
> -------------------------------------------------------------------------
> #---- --- Formatters ---
> #####
> -------------------------------------------------------------------------
> class EngrFormatter(ScalarFormatter):
> """A variation of the standard ScalarFormatter, using only multiples of
> three
> in the mantissa. A fixed number of decimals can be displayed with the optional
> parameter `ndec` . If `ndec` is None (default), the number of decimals is
> defined
> from the current ticks.
> """
> def __init__(self, ndec=None, useOffset=True, useMathText=False):
> ScalarFormatter.__init__(self, useOffset, useMathText)
> if ndec is None or ndec < 0:
> self.format = None
> elif ndec == 0:
> self.format = "%d"
> else:
> self.format = "%%1.%if" % ndec
> #........................
> def _set_orderOfMagnitude(self, mrange):
> """Sets the order of margnitude."""
> ScalarFormatter._set_orderOfMagnitude(self, mrange)
> self.orderOfMagnitude = 3*(self.orderOfMagnitude//3)
> #........................
> def _set_format(self):
> """Sets the format string to format all ticklabels."""
> # set the format string to format all the ticklabels
> locs = (N.array(self.locs)-self.offset) /
> 10**self.orderOfMagnitude+1e-15
> sigfigs = [len(str('%1.3f'% loc).split('.')[1].rstrip('0')) \
> for loc in locs]
> sigfigs.sort()
> if self.format is None:
> self.format = '%1.' + str(sigfigs[-1]) + 'f'
> if self._usetex or self._useMathText: self.format = '$%s$'%self.format
>
>
|
|
From: Stephen G. <ste...@op...> - 2006-11-22 03:07:14
|
Have a lot of data, and when looking at full view I'd like no markers, but when zoom in to see individual points I'd like to place markers on the graph. Planing on attaching some code to events to toggle markers on my line. Is there a way to change the markers a line uses after it has been plotted, or do I have to clear the plot and replot? Any suggestions appreciated Thanks Steve |
|
From: Tony M. <Ton...@jp...> - 2006-11-22 00:35:25
|
If you saw my previous post about upgrading to XDarwin 1.1.3, and breaking matplotlib, the following seems to work: Soft-linking to libfreetype.6.3.8.dylib rather than libfreetype.6.3.dylib (see below, copied from previous email). Thanks for that Apple! -Tony > >>> import numpy as N >>>> N.__version__ >'0.9.6' >>>> import matplotlib >>>> matplotlib.__version__ >'0.87.2' >>>> import pylab as PLT >Traceback (most recent call last): > File "<stdin>", line 1, in ? > File >"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pylab.py", >line 1, in ? > from matplotlib.pylab import * > File >"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/pylab.py", >line 200, in ? > from axes import Axes, PolarAxes > File >"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axes.py", >line 15, in ? > from axis import XAxis, YAxis > File >"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/axis.py", >line 25, in ? > from font_manager import FontProperties > File >"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/font_manager.py", >line 39, in ? > from matplotlib import ft2font >ImportError: Failure linking new module: >/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/ft2font.so: >Library not loaded: /usr/X11R6/lib/libfreetype.6.dylib > Referenced from: >/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/matplotlib/ft2font.so > Reason: Incompatible library version: ft2font.so requires version >10.0.0 or later, but libfreetype.6.dylib provides version 6.3.0 I note that in /usr/X11R6/lib that softlinks to the libraries mentioned above were recently changed: >/usr/X11R6/lib >jplajm:8:lib $ ll libfree* >-rwxr-xr-x 1 root wheel 1786588 Apr 28 2006 libfreetype.6.3.8.dylib >-rw-r--r-- 1 root wheel 683560 Nov 6 17:31 libfreetype.6.3.dylib >lrwxr-xr-x 1 root wheel 21 Nov 21 09:07 libfreetype.6.dylib >-> libfreetype.6.3.dylib >-rw-r--r-- 1 root wheel 1907688 Apr 28 2006 libfreetype.a >lrwxr-xr-x 1 root wheel 21 Nov 21 09:07 libfreetype.dylib >-> libfreetype.6.3.dylib >-rwxr-xr-x 1 root wheel 836 Apr 28 2006 libfreetype.la -- Tony Mannucci Supervisor, Ionospheric and Atmospheric Remote Sensing Group Mail-Stop 138-308, Tel > (818) 354-1699 Jet Propulsion Laboratory, Fax > (818) 393-5115 California Institute of Technology, Email > Ton...@jp... 4800 Oak Grove Drive, http://genesis.jpl.nasa.gov Pasadena, CA 91109 |