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
(2) |
2
(1) |
3
(17) |
4
(9) |
5
(2) |
6
(5) |
7
(8) |
8
(11) |
9
(6) |
10
(6) |
11
(21) |
12
(21) |
13
(17) |
14
(25) |
15
(15) |
16
(2) |
17
|
18
(9) |
19
(22) |
20
(25) |
21
(31) |
22
(19) |
23
(2) |
24
(5) |
25
(19) |
26
(10) |
27
(13) |
28
(14) |
29
(20) |
30
(5) |
31
(9) |
|
|
|
|
|
|
From: Michael D. <md...@st...> - 2010-01-21 13:51:16
|
You may want to play with the ps.fonttype parameter. If it's type 3 (the default) only the characters used in the plot are embedded in the file. If type 42, the entire font is embedded. That may create the editability that the publisher is asking for. Mike Sebastian Busch wrote: > Matthew Czesarski <mat...@gm...> wrote: > >> ... it seems that MPL rasterizes everything in the >> production of its EPS output. Is there any way to get around this ... > > > hi matt, > > i think i know maybe what you mean: if i save a matplotlib figure as > eps and then use pstoedit for further processing with xfig, the > ticklabels are somehow not correctly recognized as text. > > as far as i understand, this is an issue with the mathtext > capabilities. you can see what i do as workaround in > http://www.thamnos.de/repos/sebtools/sebtools.main/sebtools.py > (class 'Fig', style 'f') > > unfortunately, i do not recall all details any more. if i was to look > into that again, i would start playing with the text.usetex parameter. > i would expect this to be enough to render linear axes correctly > (although not as nicely). if you have logarithmic axes, it gets more > complicated as something like 10^5 IS a mathtext. i've therefore made > a class MyLogFormatterMathtext which outputs the labels very ugly but > as normal text. > > i hope that something along these lines can help you, i was using > pstoedit a lot to see whether the text is recognized as text or not. > > good luck, > sebastian. > > ---------------------------------------------------------------- > This message was sent using IMP, the Internet Messaging Program. > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Michael Droettboom Science Software Branch Operations and Engineering Division Space Telescope Science Institute Operated by AURA for NASA |
From: Sebastian B. <web...@th...> - 2010-01-21 13:22:50
|
Matthew Czesarski <mat...@gm...> wrote: > ... it seems that MPL rasterizes everything in the > production of its EPS output. Is there any way to get around this ... hi matt, i think i know maybe what you mean: if i save a matplotlib figure as eps and then use pstoedit for further processing with xfig, the ticklabels are somehow not correctly recognized as text. as far as i understand, this is an issue with the mathtext capabilities. you can see what i do as workaround in http://www.thamnos.de/repos/sebtools/sebtools.main/sebtools.py (class 'Fig', style 'f') unfortunately, i do not recall all details any more. if i was to look into that again, i would start playing with the text.usetex parameter. i would expect this to be enough to render linear axes correctly (although not as nicely). if you have logarithmic axes, it gets more complicated as something like 10^5 IS a mathtext. i've therefore made a class MyLogFormatterMathtext which outputs the labels very ugly but as normal text. i hope that something along these lines can help you, i was using pstoedit a lot to see whether the text is recognized as text or not. good luck, sebastian. ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. |
From: Cédrick F. <ced...@fr...> - 2010-01-21 13:21:51
|
Hello, When I try to use transData.transform on a log plot, an error occurs : ... File "E:\Python26\lib\site-packages\matplotlib\transforms.py", line 1895, in transform self._a.transform(points)) File "E:\Python26\lib\site-packages\matplotlib\transforms.py", line 1723, in transform x_points = x.transform(points[:, 0]) TypeError: tuple indices must be integers, not tuple Here is an example : #!/usr/bin/env python import matplotlib matplotlib.use('WXAgg') from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as FigureCanvas from matplotlib.figure import Figure import wx class CanvasFrame(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1, 'CanvasFrame',size=(550,350)) self.SetBackgroundColour(wx.NamedColor("WHITE")) self.figure = Figure() self.axes = self.figure.add_subplot(111) self.axes.set_xscale('log') p1 = (1,1) p2 = (2,2) _x1, _y1 = self.axes.transData.transform(p1) _x2, _y2 = self.axes.transData.transform(p2) _xy = [[_x1, _y1], [_x2, _y2]] xy = self.axes.transData.inverted().transform(_xy) self.axes.plot(xy) self.canvas = FigureCanvas(self, -1, self.figure) self.sizer = wx.BoxSizer(wx.VERTICAL) self.sizer.Add(self.canvas, 1, wx.LEFT | wx.TOP | wx.GROW) self.SetSizer(self.sizer) self.Fit() class App(wx.App): def OnInit(self): frame = CanvasFrame() frame.Show(True) return True app = App(0) app.MainLoop() If I comment the line : self.axes.set_xscale('log'), it works fine. python 2.6.4 wxpython 2.8.10 mpl 0.99 Thanks by advance for your help. Cédrick |
From: Sven K. <ma...@kl...> - 2010-01-21 10:38:34
|
Sometimes, an EPS contains a rasterised "screenshot" of the actual vector image. E.g. some office products show only the raserised image while editing the document. When printed, the vector data is used. Sven On Thursday 21 January 2010 11:10:00 Pierre de Buyl wrote: > I believe that MPL produces vector files. > > If you want to check by yourself I suggest that you zoom "at will" on > an eps file. If you cannot observe rasterization artifacts it should > be right. > > There is a "rasterized" option that will affect part of a plot but > will leave the text and axes vectorized. > > Pierre > > Le 21 janv. 10 à 10:58, Matthias Michler a écrit : > > > Hey Matt, Hello list, > > > > I'm sorry, I'm not an expert in eps-graphics. For me the final pics > > look good > > and I have no idea what is different between matplotlib eps-files and > > eps-files generated somewhere else. > > > > Maybe someone has an idea. > > > > Kind regards, > > Matthias > > > > On Thursday 21 January 2010 10:37:32 Matthew Czesarski wrote: > >> Hey Matthias, > >> > >> Oh, I can make eps files themselves no problem... > >> > >> In as much as I don't really understand the difference between > >> vector and > >> raster graphics, I was told to submit 89mm images (I can make them > >> 89mm, > >> fortunately...), with text that can be resized by the graphics > >> department. > >> For which I understand it should not be rasterized at all, but the > >> fonts, > >> sizes, coordinates, etc should be embedded in the postscript. I.e. > >> not the > >> way MPL produces .eps. Does this sound right to you? > >> > >> Thanks, > >> Matt > > > > > > > > ---------------------------------------------------------------------- > > -------- > > Throughout its 18-year history, RSA Conference consistently > > attracts the > > world's best and brightest in the field, creating opportunities for > > Conference > > attendees to learn about information security's most important > > issues through > > interactions with peers, luminaries and emerging and established > > companies. > > http://p.sf.net/sfu/rsaconf-dev2dev > > _______________________________________________ > > Matplotlib-users mailing list > > Mat...@li... > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
From: Pierre de B. <pd...@ul...> - 2010-01-21 10:10:21
|
I believe that MPL produces vector files. If you want to check by yourself I suggest that you zoom "at will" on an eps file. If you cannot observe rasterization artifacts it should be right. There is a "rasterized" option that will affect part of a plot but will leave the text and axes vectorized. Pierre Le 21 janv. 10 à 10:58, Matthias Michler a écrit : > Hey Matt, Hello list, > > I'm sorry, I'm not an expert in eps-graphics. For me the final pics > look good > and I have no idea what is different between matplotlib eps-files and > eps-files generated somewhere else. > > Maybe someone has an idea. > > Kind regards, > Matthias > > On Thursday 21 January 2010 10:37:32 Matthew Czesarski wrote: >> Hey Matthias, >> >> Oh, I can make eps files themselves no problem... >> >> In as much as I don't really understand the difference between >> vector and >> raster graphics, I was told to submit 89mm images (I can make them >> 89mm, >> fortunately...), with text that can be resized by the graphics >> department. >> For which I understand it should not be rasterized at all, but the >> fonts, >> sizes, coordinates, etc should be embedded in the postscript. I.e. >> not the >> way MPL produces .eps. Does this sound right to you? >> >> Thanks, >> Matt > > > > ---------------------------------------------------------------------- > -------- > Throughout its 18-year history, RSA Conference consistently > attracts the > world's best and brightest in the field, creating opportunities for > Conference > attendees to learn about information security's most important > issues through > interactions with peers, luminaries and emerging and established > companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Matthew C. <mat...@gm...> - 2010-01-21 09:37:41
|
Hey Matthias, Oh, I can make eps files themselves no problem... In as much as I don't really understand the difference between vector and raster graphics, I was told to submit 89mm images (I can make them 89mm, fortunately...), with text that can be resized by the graphics department. For which I understand it should not be rasterized at all, but the fonts, sizes, coordinates, etc should be embedded in the postscript. I.e. not the way MPL produces .eps. Does this sound right to you? Thanks, Matt |
From: Matthew C. <mat...@gm...> - 2010-01-21 06:50:15
|
Hi Forum, I just had an article accepted and they want to have the figures in vector EPS format with text that can be re-sized. I have produced all my figures with matplotlib. However, it seems that MPL rasterizes everything in the production of its EPS output. Is there any way to get around this without learning a new plotting package? Cheers, Matt |
From: <PH...@Ge...> - 2010-01-21 02:25:19
|
Whenever I try to build from source, I get an error saying that it can't find vcvarsall.bat. Here are the last few lines of the output from DOS: copying lib\pytz\zoneinfo\US\Pacific -> build\lib.win32-2.6\pytz\zoneinfo\US copying lib\pytz\zoneinfo\US\Pacific-New -> build\lib.win32-2.6\pytz\zoneinfo\US copying lib\pytz\zoneinfo\US\Samoa -> build\lib.win32-2.6\pytz\zoneinfo\US copying lib\dateutil\zoneinfo\zoneinfo-2008e.tar.gz -> build\lib.win32-2.6\dateutil\zoneinfo running build_ext building 'matplotlib.ft2font' extension error: Unable to find vcvarsall.bat Now I can't import pyplot. Any thoughts? Thanks, Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: 503.222.9518 www.geosyntec.com |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 22:35:47
|
On Wed, Jan 20, 2010 at 3:07 PM, Kurt Forrester <kur...@ho...> wrote: > the output from the script is: > > annotation_clip = None > checking is point is inside the axes : [ 30.875 233. ] > contains_point = 0 > _check_xy returning False > exit without drawing due to annotation_clip > > Weird. How about this one? fig = figure() ax=subplot(111) txt = ax.annotate("Test", (-0.1, 0.5), annotation_clip=False) print txt.get_annotation_clip() If it still print out None, see if the next code make any difference. fig = figure() ax=subplot(111) txt = ax.annotate("Test", (-0.1, 0.5)) txt.set_annotation_clip(False) print txt.get_annotation_clip() -JJ |
From: Ángela R. C. <riv...@in...> - 2010-01-20 21:22:19
|
Estaré ausente de la oficina desde el Vie 18/12/2009 y no volveré hasta el Mar 24/08/2010 . Ésta es una respuesta automática para avisar del cambio de correo electrónico. A partir de ahora todos los correos deben ser remitidos a ang...@in... en lugar de a esta dirección de correo. Lamento las molestias. ____________________________________________________ This is an automated reply. My email address has changed and messages sent to this address will no longer arrive. Please take notice of my new email address: ang...@in.... Sorry for any inconvenience this may cause. Angela Rivera Campos Space Enviroment and Effects Laboratory National Institute for Aerospace Technology - INTA Ctra. Ajalvir Km. 4 28850 Torrejón de Ardoz - Madrid - Spain Tel: +34 91 520 65 51 Fax: +34 91 520 20 43 e-mail: ang...@in... ********************************************************************************************** IMPORTANT: The contents of this email and any attachments are confidential. They are intended for the named recipient(s) only. If you have received this email in error, please notify the system manager or the sender immediately and do not disclose the contents to anyone or make copies thereof. *** eSafe scanned this email for viruses, vandals, and malicious content. *** ********************************************************************************************** |
From: Kurt F. <kur...@ho...> - 2010-01-20 20:07:23
|
> From: lee...@gm... > Date: Wed, 20 Jan 2010 13:50:45 -0500 > Subject: Re: [Matplotlib-users] Annotate Behaviour - Arrows Missing > To: kur...@ho... > CC: mat...@li... > > On Wed, Jan 20, 2010 at 1:13 PM, Kurt Forrester > <kur...@ho...> wrote: > > I am not too sure what the design behaviour is but it is certainly not doing > > what I expected. I do appreciate your effort in resolving this. Please do > > let me know if there are any further tests I can perform to demonstrate the > > issue or test for fixes. > > > > "annotate" is meant to annotate a data point. It does not have much > meaning to draw the annotating text when the annotated data point is > not visible (i.e. when the data point is outside the axes). And this > is the default behavior of the current matplotlib. > > As I cannot reproduce the problem, it is hard to track down what is wrong. > I'm attaching a little debugging script. Please try to run this code > and report the output. For example, I get > > annotation_clip = False > _check_xy returning True > Drawing Text > > Your output may be different. > > Regards, > > -JJ thanks for the details on the design. the output from the script is: annotation_clip = None checking is point is inside the axes : [ 30.875 233. ] contains_point = 0 _check_xy returning False exit without drawing due to annotation_clip _________________________________________________________________ Search for properties that match your lifestyle! Start searching NOW! http://clk.atdmt.com/NMN/go/157631292/direct/01/ |
From: nbv4 <cp3...@oh...> - 2010-01-20 19:57:32
|
http://pastebin.com/f7fba9f61 I wrote this little snippet to automatically format the X axis of a line plot I created with a dynamic range. It's not completely 100% perfect, but I thought Id just post this here is anyone wants to use it, or maybe even knows of another method to create the same effect more easily. here are some examples: http://yfrog.com/htnonemptyusersp http://yfrog.com/htnoratespikesp http://yfrog.com/0p96192768p -- View this message in context: http://old.nabble.com/automatic-date-formatting-of-axes-tp27247612p27247612.html Sent from the matplotlib - users mailing list archive at Nabble.com. |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 19:14:13
|
On Wed, Jan 20, 2010 at 2:04 PM, Eric Firing <ef...@ha...> wrote: > The reason for this fudge in contour is that contourf fills > lower < z <= upper > for each consecutive pair of contour levels. > When the minimum value of z coincides with the lowest level, then regions > with that minimum are left blank; so the lowest level is adjusted downward > slightly, making the lowest contour interval include the minimum value. > I understand levels can be adjusted for a better contouring, but I'm not sure whether this change needs to be visible to users. The autoleveler, initially creates following levels [0, 1.5, 3, 4.5, 6, 7.5, 9.] But due to the reason you described above, they become array([ -9.00000000e-06, 1.50000000e+00, 3.00000000e+00, 4.50000000e+00, 6.00000000e+00, 7.50000000e+00, 9.00000900e+00]) And the colorbar uses the adjusted levels for labeling. But I think it may make more sense to use the initial levels (at least for the colorbar ticks). Regards, -JJ |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 19:07:35
|
On Wed, Jan 20, 2010 at 1:36 PM, Eric Firing <ef...@ha...> wrote: > Second and related advice: don't fiddle directly with tick labels except as > a *last* resort. Instead, take care in selecting tick values, and if > necessary, customize the Formatter. > Agreed. It was a quick hack. > The fact that a default Formatter is writing -0.0 strikes me as a bug that > should be fixed in the Formatter; but it would be good to have more opinions > about this. > This is a behavior of python and I think it makes sense. In [92]: print "%2.1f" % (-9e-6,) -0.0 Regards, -JJ |
From: Eric F. <ef...@ha...> - 2010-01-20 19:04:28
|
Jae-Joon Lee wrote: > On Wed, Jan 20, 2010 at 12:12 PM, Mario Mech <me...@me...> wrote: >> the smallest value (0.0) is labeled with "-0.0". I just want to get rid of the minus sign. >> > > This is because the actual value is "-9.00000000e-06" (this inherits > from the levels of contour). The reason for this fudge in contour is that contourf fills lower < z <= upper for each consecutive pair of contour levels. When the minimum value of z coincides with the lowest level, then regions with that minimum are left blank; so the lowest level is adjusted downward slightly, making the lowest contour interval include the minimum value. The fudge could be made optional via a kwarg, e.g., include_minimum=True (default) or False (to defeat the fudge). This would not help Mario, though, assuming he is happy with the present contouring, and simply wants sane labeling of the 0-tick. For that, a Formatter adjustment is the simplest solution. Eric |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 18:51:12
|
On Wed, Jan 20, 2010 at 1:13 PM, Kurt Forrester <kur...@ho...> wrote: > I am not too sure what the design behaviour is but it is certainly not doing > what I expected. I do appreciate your effort in resolving this. Please do > let me know if there are any further tests I can perform to demonstrate the > issue or test for fixes. > "annotate" is meant to annotate a data point. It does not have much meaning to draw the annotating text when the annotated data point is not visible (i.e. when the data point is outside the axes). And this is the default behavior of the current matplotlib. As I cannot reproduce the problem, it is hard to track down what is wrong. I'm attaching a little debugging script. Please try to run this code and report the output. For example, I get annotation_clip = False _check_xy returning True Drawing Text Your output may be different. Regards, -JJ |
From: Eric F. <ef...@ha...> - 2010-01-20 18:36:57
|
Jae-Joon Lee wrote: > On Wed, Jan 20, 2010 at 12:12 PM, Mario Mech <me...@me...> wrote: >> the smallest value (0.0) is labeled with "-0.0". I just want to get rid of the minus sign. >> > > This is because the actual value is "-9.00000000e-06" (this inherits > from the levels of contour). > While I think we're fixing a wrong problem (the contour routine need > to be fixed in my view), here is a workaround you may use. Careful, that slight adjustment of the lower limit, when automatically generated, is there for a reason (though I don't recall offhand where it is arising and why). There may be a better way to do it--and we can try to figure it out and implement it--but my advice in general is: don't use automatically generated contour or contourf levels except for exploratory, interactive work, when slight imperfections are acceptable. Instead, figure out what levels you really want, and supply them explicitly as one of the arguments. Second and related advice: don't fiddle directly with tick labels except as a *last* resort. Instead, take care in selecting tick values, and if necessary, customize the Formatter. The fact that a default Formatter is writing -0.0 strikes me as a bug that should be fixed in the Formatter; but it would be good to have more opinions about this. Eric > > -JJ > > import numpy as np > from matplotlib import pyplot,mpl > > x = np.arange(10) > y = np.arange(25) > z = np.floor(10*np.random.random((25,10))) > > cntr = pyplot.contourf(x,y,z) > > cb = pyplot.colorbar(format=r"%2.1f") > > > ticklabel_seq = cb.ax.yaxis.major.formatter.seq > try: > indx = ticklabel_seq.index("-0.0") > ticklabel_seq[indx]="0.0" > except ValueError: > pass > > > pyplot.show() > > ------------------------------------------------------------------------------ > Throughout its 18-year history, RSA Conference consistently attracts the > world's best and brightest in the field, creating opportunities for Conference > attendees to learn about information security's most important issues through > interactions with peers, luminaries and emerging and established companies. > http://p.sf.net/sfu/rsaconf-dev2dev > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 18:20:49
|
On Wed, Jan 20, 2010 at 12:12 PM, Mario Mech <me...@me...> wrote: > the smallest value (0.0) is labeled with "-0.0". I just want to get rid of the minus sign. > This is because the actual value is "-9.00000000e-06" (this inherits from the levels of contour). While I think we're fixing a wrong problem (the contour routine need to be fixed in my view), here is a workaround you may use. -JJ import numpy as np from matplotlib import pyplot,mpl x = np.arange(10) y = np.arange(25) z = np.floor(10*np.random.random((25,10))) cntr = pyplot.contourf(x,y,z) cb = pyplot.colorbar(format=r"%2.1f") ticklabel_seq = cb.ax.yaxis.major.formatter.seq try: indx = ticklabel_seq.index("-0.0") ticklabel_seq[indx]="0.0" except ValueError: pass pyplot.show() |
From: <PH...@Ge...> - 2010-01-20 17:52:12
|
Hey folks, I'm plotting a simple rainfall record and when I tell the DayLocator to make sure to use 'US/Pacific' as it's time zone, it barfs on me. (US/Pacific is also set in my matplotlibrc file). When I don't specify the time zone, it doesn't barf, but the xticks are placed 8 hours off (presumably at the start of day GMT, right?). Am I not specifying the datetime.tzinfo object correctly? The code and the traceback are below. The trace back mentions some EOF in a multi-line statement, but blames it on my fig.savefig(...) command. Thanks for everything. This library is truly amazing. My mind is consistently blown as to what the developers have created. Here's some code: import numpy as np import datetime as dt import matplotlib.pyplot as pl import matplotlib.dates as md TZ = dt.tzinfo('US/Pacific') dmin = dt.datetime(2009,12,22,0,0) dmax = dt.datetime(2010,1,31,0,0) delta = dt.timedelta(5/(24*60.)) dr = md.drange(dmin, dmax, delta) y1 = np.zeros(len(dr)) + 1 fig = pl.figure(figsize=(7,4)) ax = fig.add_axes([0.10,0.13,0.85,0.82]) #~ --- this is where the error happens ------- #~ leave it as is for the point to be off #~ OR #~ uncomment the next line to produce the error days = md.DayLocator(interval=4) # days = md.DayLocator(interval=4, tz=TZ) # verify xtick locations a = dt.datetime(2009,12,26,0,0,0) b = 4.5 L1 = ax.plot(dr, y1, 'b-', lw=1, label='Hourly') p1 = ax.plot(a,b,'g.', label='Point not @ start of day') ax.legend(loc='upper right') ax.xaxis.set_major_locator(days) ax.xaxis.set_major_formatter(md.DateFormatter('%m/%d')) fig.savefig('storm.png') # ------------------------------------------------------- The traceback: In [138]: run storm_tracker ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (550, 0)) ERROR: An unexpected error occurred while tokenizing input The following traceback may be corrupted or invalid The error message is: ('EOF in multi-line statement', (91, 0)) --------------------------------------------------------------------------- NotImplementedError Traceback (most recent call last) c:\stuff\utils\py\storm_tracker.py in <module>() 59 ax.set_ylim([0,5]) 60 ax.set_xlim([dmin, dmax]) ---> 61 fig.savefig('storm.png') 62 63 C:\Python26\lib\site-packages\matplotlib\figure.pyc in savefig(self, *args, **kwargs) 1030 patch.set_alpha(0.0) 1031 -> 1032 self.canvas.print_figure(*args, **kwargs) 1033 1034 if transparent: C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4agg.pyc in print_figure(self, *args, **kwargs) 142 143 def print_figure(self, *args, **kwargs): --> 144 FigureCanvasAgg.print_figure(self, *args, **kwargs) 145 self.draw() 146 C:\Python26\lib\site-packages\matplotlib\backend_bases.pyc in print_figure(self, filename, dpi, facecolor, edg ecolor, orientation, format, **kwargs) 1474 orientation=orientation, 1475 bbox_inches_restore=_bbox_inches_restore, -> 1476 **kwargs) 1477 finally: 1478 if bbox_inches and restore_bbox: C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.pyc in print_png(self, filename_or_obj, *args, * *kwargs) 356 357 def print_png(self, filename_or_obj, *args, **kwargs): --> 358 FigureCanvasAgg.draw(self) 359 renderer = self.get_renderer() 360 original_dpi = renderer.dpi C:\Python26\lib\site-packages\matplotlib\backends\backend_agg.pyc in draw(self) 312 313 self.renderer = self.get_renderer() --> 314 self.figure.draw(self.renderer) 315 316 def get_renderer(self): C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl) 44 def draw_wrapper(artist, renderer, *kl): 45 before(artist, renderer) ---> 46 draw(artist, renderer, *kl) 47 after(artist, renderer) 48 C:\Python26\lib\site-packages\matplotlib\figure.pyc in draw(self, renderer) 771 772 # render the axes --> 773 for a in self.axes: a.draw(renderer) 774 775 # render the figure text C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl) 44 def draw_wrapper(artist, renderer, *kl): 45 before(artist, renderer) ---> 46 draw(artist, renderer, *kl) 47 after(artist, renderer) 48 C:\Python26\lib\site-packages\matplotlib\axes.pyc in draw(self, renderer, inframe) 1733 1734 for zorder, i, a in dsu: -> 1735 a.draw(renderer) 1736 1737 renderer.close_group('axes') C:\Python26\lib\site-packages\matplotlib\artist.pyc in draw_wrapper(artist, renderer, *kl) 44 def draw_wrapper(artist, renderer, *kl): 45 before(artist, renderer) ---> 46 draw(artist, renderer, *kl) 47 after(artist, renderer) 48 C:\Python26\lib\site-packages\matplotlib\axis.pyc in draw(self, renderer, *args, **kwargs) 734 renderer.open_group(__name__) 735 interval = self.get_view_interval() --> 736 for tick, loc, label in self.iter_ticks(): 737 if tick is None: continue 738 if not mtransforms.interval_contains(interval, loc): continue C:\Python26\lib\site-packages\matplotlib\axis.pyc in iter_ticks(self) 675 Iterate through all of the major and minor ticks. 676 """ --> 677 majorLocs = self.major.locator() 678 majorTicks = self.get_major_ticks(len(majorLocs)) 679 self.major.formatter.set_locs(majorLocs) C:\Python26\lib\site-packages\matplotlib\dates.pyc in __call__(self) 476 def __call__(self): 477 # if no data have been set, this will tank with a ValueError --> 478 try: dmin, dmax = self.viewlim_to_dt() 479 except ValueError: return [] 480 C:\Python26\lib\site-packages\matplotlib\dates.pyc in viewlim_to_dt(self) 452 def viewlim_to_dt(self): 453 vmin, vmax = self.axis.get_view_interval() --> 454 return num2date(vmin, self.tz), num2date(vmax, self.tz) 455 456 def _get_unit(self): C:\Python26\lib\site-packages\matplotlib\dates.pyc in num2date(x, tz) 247 """ 248 if tz is None: tz = _get_rc_timezone() --> 249 if not cbook.iterable(x): return _from_ordinalf(x, tz) 250 else: return [_from_ordinalf(val, tz) for val in x] 251 C:\Python26\lib\site-packages\matplotlib\dates.pyc in _from_ordinalf(x, tz) 177 dt = datetime.datetime( 178 dt.year, dt.month, dt.day, int(hour), int(minute), int(second), --> 179 microsecond, tzinfo=UTC).astimezone(tz) 180 181 if microsecond>999990: # compensate for rounding errors NotImplementedError: a tzinfo subclass must implement utcoffset() WARNING: Failure executing file: <storm_tracker.py> Paul M. Hobson Senior Staff Engineer -- Geosyntec Consultants 55 SW Yamhill St, Ste 200 Portland, OR 97204 Phone: 503.222.9518 www.geosyntec.com |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 17:19:05
|
On Tue, Jan 19, 2010 at 3:08 PM, Kurt Forrester <kur...@ho...> wrote: > Additional information that I forgot to supply was that on python > 2.5/windows/matplotlib 0.98.xxx (my work machine, not accessible at the > moment for the subversion number) this worked fine and there may have been a > regression from this to the current 0.99.0 (in the ubuntu repository). > The "annotation_clip" feature is introduced in 0.99.0, and annotations are not clipped before that version. Again, your script works fine if I add annotation_clip parameter. So, I'm not sure what's going on. Can anyone else reproduce this problem? Just in case, with the following code, do you see label "Test"? It should be seen near where the xlabel is seen. fig = figure() ax=subplot(111) ax.annotate("Test", (-0.1, 0.5), annotation_clip=False) Regards, -JJ |
From: Mario M. <me...@me...> - 2010-01-20 17:12:22
|
> Can you elaborate why you need to do this? As you can see in my example: #------ import numpy as np from matplotlib import pyplot,mpl x = np.arange(10) y = np.arange(25) z = np.floor(10*np.random.random((25,10))) pyplot.contourf(x,y,z) cb = pyplot.colorbar() pyplot.show() #------ the smallest value (0.0) is labeled with "-0.0". I just want to get rid of the minus sign. Cheers Mario > This is a general behavior of Axes in matplotlib (i.e., not colorbar > specific). There are things that are evaluated later when the figure > gets drawn. > You may use iter_ticks method if it fits your need. > > for j, p, l in cb.ax.yaxis.iter_ticks(): > print l > > To change the ticklabels of colorbar, they need to be set when the > colorbar is created, as Scott suggested. This is a limitation of the > current colobar implementation. Changing ticklabels (or locations) > after colorbar is created is quite tricky. > > Regards, > > -JJ -- Dr. Mario Mech Institute for Geophysics and Meteorology University of Cologne Zuelpicher Str. 49a 50674 Cologne Germany t: +49 (0)221 - 470 - 1776 f: +49 (0)221 - 470 - 5198 e: me...@me... w: http://www.meteo.uni-koeln.de/~mmech/ |
From: Jae-Joon L. <lee...@gm...> - 2010-01-20 17:06:29
|
On Wed, Jan 20, 2010 at 9:17 AM, Mario Mech <me...@me...> wrote: > cl = cb.ax.get_yticklabels() > > results in a list of Text objects like Text(0,0,''). So my problem is more to get the TickLabels for vertical colorbars. > Can you elaborate why you need to do this? This is a general behavior of Axes in matplotlib (i.e., not colorbar specific). There are things that are evaluated later when the figure gets drawn. You may use iter_ticks method if it fits your need. for j, p, l in cb.ax.yaxis.iter_ticks(): print l To change the ticklabels of colorbar, they need to be set when the colorbar is created, as Scott suggested. This is a limitation of the current colobar implementation. Changing ticklabels (or locations) after colorbar is created is quite tricky. Regards, -JJ |
From: Sebastian B. <web...@th...> - 2010-01-20 16:15:59
|
Mario Mech wrote: > ... > #------ > import numpy as np > from matplotlib import pyplot,mpl > > x = np.arange(10) > y = np.arange(25) > z = np.floor(10*np.random.random((25,10))) > > pyplot.contourf(x,y,z) > > cb = pyplot.colorbar() > > for j in cb.ax.get_yticklabels(): > print(j) > #---- > > results in: > > Text(0,0,'') > ... I think you have to pyplot.show() or pyplot.savefig("deleteme.ps") in order to have the ticklabels populated. best, sebastian. |
From: Mario M. <me...@me...> - 2010-01-20 15:18:19
|
> This works for me. > >> But >> >> cl = cb.ax.get_yticklabels() >> >> results in a list of Text objects like Text(0,0,''). > > I have no idea what's happening then. I see: > > for l in cl: > print(l) > > Text(0,0,'bla') > Text(0.166667,0.166667,'1.5') > Text(0.333333,0.333333,'3.0') > Text(0.5,0.5,'4.5') > Text(0.666667,0.666667,'6.0') > Text(0.833333,0.833333,'7.5') > Text(1,1,'9.0') > > Cheers, > Scott Has it anything to do with my matplotlib version (0.99.0) and python (2.6.4) on ubuntu karmic? following code: #------ import numpy as np from matplotlib import pyplot,mpl x = np.arange(10) y = np.arange(25) z = np.floor(10*np.random.random((25,10))) pyplot.contourf(x,y,z) cb = pyplot.colorbar() for j in cb.ax.get_yticklabels(): print(j) #---- results in: Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') Text(0,0,'') That's not what i expected and makes it hard to change single ticklabels. Cheers, Mario -- Dr. Mario Mech Institute for Geophysics and Meteorology University of Cologne Zuelpicher Str. 49a 50674 Cologne Germany t: +49 (0)221 - 470 - 1776 f: +49 (0)221 - 470 - 5198 e: me...@me... w: http://www.meteo.uni-koeln.de/~mmech/ |
From: Scott S. <sco...@gm...> - 2010-01-20 14:43:17
|
>2010/1/20 Mario Mech <me...@me...>: > Ok, something like > > cl = cb.ax.get_yticklabels() > cl[0].set_text('bla') > cb.ax.set_yticklabels([elem.get_text() for elem in cl]) This works for me. > But > > cl = cb.ax.get_yticklabels() > > results in a list of Text objects like Text(0,0,''). I have no idea what's happening then. I see: for l in cl: print(l) Text(0,0,'bla') Text(0.166667,0.166667,'1.5') Text(0.333333,0.333333,'3.0') Text(0.5,0.5,'4.5') Text(0.666667,0.666667,'6.0') Text(0.833333,0.833333,'7.5') Text(1,1,'9.0') Cheers, Scott |