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
(28) |
2
(11) |
3
(15) |
4
(11) |
5
(13) |
6
(33) |
7
(13) |
8
(9) |
9
(2) |
10
(9) |
11
(27) |
12
(5) |
13
(10) |
14
(6) |
15
(9) |
16
(4) |
17
(2) |
18
(19) |
19
(11) |
20
(9) |
21
(16) |
22
(16) |
23
(5) |
24
(2) |
25
(8) |
26
(2) |
27
(11) |
28
(10) |
29
(5) |
30
(1) |
31
(2) |
|
|
|
|
|
|
Hi, maybe I've misunderstood something concerning quiver plots: I want to exclude some data from a quiver plot. Here's an example: --------------------8<---- import numpy as N import pylab as pl import matplotlib.numerix.ma as ma # prepare data X,Y = pl.meshgrid(range(5),range(5)) angles = pl.rand(5,5) U = N.cos(angles) V = N.sin(angles) # prepare mask M = N.zeros((5,5), dtype='bool') M[2,2] = True # apply mask Um = ma.masked_array(U,mask=M) Vm = ma.masked_array(V,mask=M) # plot pl.quiver(X,Y,Um,Vm) # pl.plot(range(5),Um[2],'x') pl.show() ---------------------->8---- Using the commented 'plot' command works as expected, but 'quiver' results in empty axes. If I take U,V instead of Um,Vm, the arrows are drawn .. What am I doing wrong or is there another way to exclude arrows from being plotted? Thank you in advance, Michael
Hello again, I'm really sorry for not having written for such a long time, but I've been on vacation. I've been trying to figure out what is happening with the import pylab thing and why it makes the rounding to my data. I've found that the problem might be related with some conflict between two different imports. To read my data from the files, I'm using a set of libraries that are produced by a swig wrapper to the C++ original libraries and somewhere through the handling of the data it collides with the pylab importing. Up till now these libraries have worked just fine and have given me no problem. Anyway, for skipping the problem and make everything work I've changed the import of the pylab module to the function where it is being used, I know it's ugly, and I don't like it but as it works I think I'll leave it like that and make a little research on the subject in my spare time. Thanks a lot for you time and attention. ARC
Hi, Here is a piece of code I recently used for plotting 2 different legends. This is not the most sexy code in the world but it works. #axis and legend axis([-0.1, 3.1, 0, 1], font) xlabel(r'\textrm{relative error}', font) ylabel(r'\textrm{cdf}', font) rc('legend', numpoints=1) leg1 = figlegend((lrep20[0], lrep50[0], lrep70[0]), (r'\textrm {reputation - 20\%}', r'\textrm{reputation - 50\%}', r'\textrm {reputation - 70\%}'), loc=(0.25, 0.11), prop=FontProperties (size='45', weight='bold')) leg1.draw_frame(False) rc('legend', numpoints=3) leg2 = figlegend((lwithout20[0], lwithout50[0], lwithout70[0], lref [0]), (r'\textrm{20\%}', r'\textrm{50\%}', r'\textrm{70\%}', r'\textrm {reference}'), loc=(0.68, 0.08), prop=FontProperties(size='45', weight='bold')) leg2.draw_frame(False) Keep on Rockin' Benoit Le 20-août-08 à 12:17, Yves Revaz a écrit : > Hi, > > How is it possible to add two legends in the same plot ? > > Of course, if I try : > pt.legend(crv_lst,labels1,loc='upper right',shadow=True) > pt.legend(crv_lst,labels2,loc='upper left',shadow=True) > > the first one is erased by the second one... :-( > > Thanks in advance, > > yves > > > > -- > (o o) > --------------------------------------------oOO--(_)--OOo------- > Yves Revaz > Laboratory of Astrophysics EPFL > Observatoire de Sauverny Tel : ++ 41 22 379 24 28 > 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 > 1290 Sauverny e-mail : Yve...@ep... > SWITZERLAND Web : http://www.lunix.ch/revaz/ > ---------------------------------------------------------------- > > > ---------------------------------------------------------------------- > --- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Dr. Benoit Donnet Université catholique de Louvain (UCL) Ecole Polytechnique de Louvain (EPL) - Département d'Ingénierie Informatique (INGI) Place Sainte Barbe, 2 1348 Louvain-la-Neuve Belgium Phone: +32 10 47 87 18 Home page: http://inl.info.ucl.ac.be/donnet
I'm drawing several hundred lines at a time, each consisting of 10-100 points, and it takes a couple of minutes for them all to display, which makes me think I must be doing something stupid. The function that does the drawing looks like this: def plotlinmap(lins, map=None): if map is None: map = Basemap() map.drawmapboundary(fill_color="white") map.drawmeridians(range(-180,181,30)), labels=[1,0,0,1]) map.drawparallels(range(-90,91,30)), labels=[1,0,0,1]) for lin in lins: x,y = map(degrees(lin.longitudes()),degrees(lin.latitudes())) map.plot(x,y) return(map) It displays one line at a time, whenever map.plot() is called. Really I'd like it to just do all the drawing at the end (assuming that would make the whole process much faster). Is there some way to cleanly pass map.plot() a big list of lines to draw? I'm sure there is and I'm just being dense. Argh. -- Zane Selvans Amateur Earthling http://zaneselvans.org za...@id... 303/815-6866 PGP Key: 55E0815F
Hi there, I'm using matplotlib version 0.98.3 and I'm switching the scale between linear and log in my application. This worked with matplotlib 0.91.3. I get the following error: ------------- Traceback (most recent call last): File "/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py", line 333, in expose_event self._render_figure(self._pixmap, w, h) File "/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gtk.py", line 321, in _render_figure self.figure.draw (self._renderer) File "/usr/lib64/python2.5/site-packages/matplotlib/figure.py", line 759, in draw for a in self.axes: a.draw(renderer) File "/usr/lib64/python2.5/site-packages/matplotlib/axes.py", line 1523, in draw a.draw(renderer) File "/usr/lib64/python2.5/site-packages/matplotlib/axis.py", line 718, in draw tick.draw(renderer) File "/usr/lib64/python2.5/site-packages/matplotlib/axis.py", line 193, in draw self.label1.draw(renderer) File "/usr/lib64/python2.5/site-packages/matplotlib/text.py", line 771, in draw Text.draw(self, renderer) File "/usr/lib64/python2.5/site-packages/matplotlib/text.py", line 329, in draw ismath=self.is_math_text(line)) File "/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gdk.py", line 150, in draw_text self._draw_mathtext(gc, x, y, s, prop, angle) File "/usr/lib64/python2.5/site-packages/matplotlib/backends/backend_gdk.py", line 195, in _draw_mathtext array[:,:,3]=Xs ValueError: shape mismatch: objects cannot be broadcast to a single shape -------------- I've attached a modified example file to reproduce the error. Any clue what's wrong with set_xscale('log'), set_yscale('log') Regards Werner
Hi, The legend of an axes instance is stored in axes.legend_ attribute. And your second legend call will simply rebind this attribute to the new legend object, and the first one is never drawn. You may make a custom Axes class which can hold multiple legends. But if you want something quick, first_legend = pt.legend(crv_lst,labels1,loc='upper right',shadow=True) pt.legend(crv_lst,labels2,loc='upper left',shadow=True) gca().add_artist(first_legend) draw() It works for my quick test. -JJ On Wed, Aug 20, 2008 at 6:17 AM, Yves Revaz <yve...@ep...> wrote: > Hi, > > How is it possible to add two legends in the same plot ? > > Of course, if I try : > pt.legend(crv_lst,labels1,loc='upper right',shadow=True) > pt.legend(crv_lst,labels2,loc='upper left',shadow=True) > > the first one is erased by the second one... :-( > > Thanks in advance, > > yves > > > > -- > (o o) > --------------------------------------------oOO--(_)--OOo------- > Yves Revaz > Laboratory of Astrophysics EPFL > Observatoire de Sauverny Tel : ++ 41 22 379 24 28 > 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 > 1290 Sauverny e-mail : Yve...@ep... > SWITZERLAND Web : http://www.lunix.ch/revaz/ > ---------------------------------------------------------------- > > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users >
Yves Revaz wrote: > Hi all, > > How is it possible to display by default the minor ticks with an > interval 5 times > smaller than the major ticks. > > I can do that for a known range of data : for example : > > ax = pt.gca() > ax.xaxis.set_major_locator(MultipleLocator(10)) > ax.xaxis.set_minor_locator(MultipleLocator(10/5.)) > > > but I would like to have the major still set by default, i.e. : > ax.xaxis.set_major_locator(AutoLocator()) > > and now the minor automatically set to 1/5. of the value used for the major. > > How can I do that ? > Dear Yves, Here is the trick : ax = gca() ax.xaxis.set_major_locator(AutoLocator()) x_major = ax.xaxis.get_majorticklocs() dx_minor = (x_major[-1]-x_major[0])/(len(x_major)-1) /5. ax.xaxis.set_minor_locator(MultipleLocator(dx_minor)) Cheers ! yves > > Thanks for your help, > > yves > > > > > -- > (o o) > --------------------------------------------oOO--(_)--OOo------- > Yves Revaz > Laboratory of Astrophysics EPFL > Observatoire de Sauverny Tel : ++ 41 22 379 24 28 > 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 > 1290 Sauverny e-mail : Yve...@ep... > SWITZERLAND Web : http://www.lunix.ch/revaz/ > ---------------------------------------------------------------- > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by the 2008 JavaOne(SM) Conference > Don't miss this year's exciting event. There's still time to save 100ドル. > Use priority code J8TL2D2. > http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ----------------------------------------------------------------
Hi, How is it possible to add two legends in the same plot ? Of course, if I try : pt.legend(crv_lst,labels1,loc='upper right',shadow=True) pt.legend(crv_lst,labels2,loc='upper left',shadow=True) the first one is erased by the second one... :-( Thanks in advance, yves -- (o o) --------------------------------------------oOO--(_)--OOo------- Yves Revaz Laboratory of Astrophysics EPFL Observatoire de Sauverny Tel : ++ 41 22 379 24 28 51. Ch. des Maillettes Fax : ++ 41 22 379 22 05 1290 Sauverny e-mail : Yve...@ep... SWITZERLAND Web : http://www.lunix.ch/revaz/ ----------------------------------------------------------------
family define font name here. sa6113 wrote: > > I use this code to set plot legend font : > > font = FontProperties(family ='monospace',style = 'italic',size='large', > weight='bold') > self.ax.legend( line, label, legend , prop = font ) > > but font style dosen't effect while other properties set properly. > what is the problem?? > -- View this message in context: http://www.nabble.com/font-style-problem%21-tp19045196p19063479.html Sent from the matplotlib - users mailing list archive at Nabble.com.
On Fri, Aug 15, 2008 at 1:52 PM, Mathieu Leplatre <lep...@gm...> wrote: >> There is a FAQ showing how to do this for tick labels using the >> bounding boxes of the labels. You could do something similar with the >> title bounding box >> >> http://matplotlib.sourceforge.net/doc/html/faq/howto_faq.html#how-do-i-automatically-make-room-for-my-tick-labels >> >> JDH >> > > Thank you very much for pointing me this out. I must confess I hadn't seen it. > > I am trying to modify the given snipplet so that it could work with > something more general like : > > for label in fig.findobj(matplotlib.text.Text): > > Apart from the missing renderer exceptions that are raised, I can't > figure out how to split the resulting union box into left, right, > bottom, top as required by fig.subplots_adjust() > > If this is obvious, I am very sorry to be tiresome... > > Thanks a lot for your help. > I figured it out, just had to test xmin/ymin < 0.0 and xmax/ymax > 1.0. I could compute easily the new margins values and it works well. *However*, I noticed that the SVG renderer does not take in account the self.fig.subplots_adjust() commands called within on_draw(self, event). The FAQ example mentionned above does not work when invoking matplotlib.use("svg"). I am using matplotlib 0.98.3, it could be a bug ? Thanks for your feedback ! (should I start a new thread ?)
My last response was sent before reading this. I think you've found the reason why it's not as easy as it seems... I think your suggestion (to manually adjust) is good for now. I'll see if I can find time to look at this when I get back. Cheers, Mike
I'm out of town, so it's hard for me to look deeply into this now, but 0.91 and later supports "baseline" vertical alignment, but the legend layout code doesn't use it by default. It may be as simple as setting valign to "baseline" in the legend text -- or there may be a subtle interaction with something else. But maybe that's a hint about where to start. Cheers, Mike
Hi Jochen, Yes. I also can see some misalignment. I personally think that it is very hard to get a perfect baseline alignment if you have usetex=True. And as far as I know, if you have something like $\frac{1}{2}$ in your string, then the baseline is not well respected. Anyhow, The current misalignment we see seems mostly due to being "top"-alignment. And I don't think the current matplotlib has an easy way to adjust the alignment. The attached is a custom Axes class you may use to get baseline-aligned xticklabels. If I use this class, their baselines seems to align well as far as I can see. An example to use this axes class is included in the file, and for your script, you may add following lines before your plot() command. from BaselineAlignedXticklabelsAxes import Subplot ax = Subplot(h_f1, 1, 1, 1) h_f1.add_subplot(ax) I hope this solves your problem, but if not, I'm afraid there is nothing I can help. Regards, -JJ On Tue, Aug 19, 2008 at 1:22 PM, Jochen Schaab <sc...@fs...> wrote: > Hi, > your fix solves my problem mostly. > > Attached is my pdf output, now created with the fixed pdf-backend. The fix > works, however the label "Heavy" is still a tiny little bit misaligned (you > need to zoom in to see the misalignment). All other labels seem to share a > common baseline now. Can you reproduce that with the script I posted > earlier? > > If xticklabels are "top"-aligned by default, is there an option to make them > "baseline"-aligned? > > Thanks for your help. > > Regards > Jochen > > > Am 19.08.2008 um 18:44 schrieb Jae-Joon Lee: > >> Hi, >> >> As far as I know, xticklabels in matplotlib are "top"-aligned, so you >> may see misaligned baseline sometimes. Still, the problem you reported >> seems to be a bug in the pdf-backend. I posted a simple bug fix of the >> pdf backend >> >> http://article.gmane.org/gmane.comp.python.matplotlib.general/14041 >> >> and I guess this will also solve your problem. Although this fix is >> not yet picked up by matplotlib developers, can you apply it by >> yourself and see how it works? >> >> Regards, >> >> -JJ >> >> >> >> >> >> On Wed, Aug 13, 2008 at 3:56 AM, Jochen Schaab >> <sc...@fs...> wrote: >>> >>> Hello >>> >>> I have a problem with manually set plot labels. >>> The baseline of the labels is not aligned when using the PDF output. It >>> works fine for PS or PNG. >>> Attached is a script which demonstrates my problem. >>> >>> Running >>> python test_baseline.py -dPDF >>> gives me a corrupted baseline for the x-labels. >>> >>> I am using >>> py25-matplotlib @0.98.3_0+tkinter >>> installed using MacPorts. >>> The config file matplotlibrc is unchanged. >>> >>> Thanks >>> Jochen >>> >>> ------------------------------------------------------------------------- >>> This SF.Net email is sponsored by the Moblin Your Move Developer's >>> challenge >>> Build the coolest Linux based applications with Moblin SDK & win great >>> prizes >>> Grand prize is a trip for two to an Open Source event anywhere in the >>> world >>> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> >>> > > > — > Dipl.-Ing. Jochen Schaab > > Technische Universität Darmstadt > Institute of Flight Systems and Automatic Control > Petersenstraße 30, 64287 Darmstadt, Germany > > Phone: +49 (0) 6151 16-2290 > Fax: +49 (0) 6151 16-5434 > E-Mail: sc...@fs... > URL: www.fsr.maschinenbau.tu-darmstadt.de >
Hi, your fix solves my problem mostly. Attached is my pdf output, now created with the fixed pdf-backend. The fix works, however the label "Heavy" is still a tiny little bit misaligned (you need to zoom in to see the misalignment). All other labels seem to share a common baseline now. Can you reproduce that with the script I posted earlier? If xticklabels are "top"-aligned by default, is there an option to make them "baseline"-aligned? Thanks for your help. Regards Jochen Am 19.08.2008 um 18:44 schrieb Jae-Joon Lee: > Hi, > > As far as I know, xticklabels in matplotlib are "top"-aligned, so you > may see misaligned baseline sometimes. Still, the problem you reported > seems to be a bug in the pdf-backend. I posted a simple bug fix of the > pdf backend > > http://article.gmane.org/gmane.comp.python.matplotlib.general/14041 > > and I guess this will also solve your problem. Although this fix is > not yet picked up by matplotlib developers, can you apply it by > yourself and see how it works? > > Regards, > > -JJ > > > > > > On Wed, Aug 13, 2008 at 3:56 AM, Jochen Schaab > <sc...@fs...> wrote: >> Hello >> >> I have a problem with manually set plot labels. >> The baseline of the labels is not aligned when using the PDF >> output. It >> works fine for PS or PNG. >> Attached is a script which demonstrates my problem. >> >> Running >> python test_baseline.py -dPDF >> gives me a corrupted baseline for the x-labels. >> >> I am using >> py25-matplotlib @0.98.3_0+tkinter >> installed using MacPorts. >> The config file matplotlibrc is unchanged. >> >> Thanks >> Jochen >> >> ------------------------------------------------------------------------- >> This SF.Net email is sponsored by the Moblin Your Move Developer's >> challenge >> Build the coolest Linux based applications with Moblin SDK & win >> great >> prizes >> Grand prize is a trip for two to an Open Source event anywhere in >> the world >> http://moblin-contest.org/redirect.php?banner_id=100&url=/ >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> >> — Dipl.-Ing. Jochen Schaab Technische Universität Darmstadt Institute of Flight Systems and Automatic Control Petersenstraße 30, 64287 Darmstadt, Germany Phone: +49 (0) 6151 16-2290 Fax: +49 (0) 6151 16-5434 E-Mail: sc...@fs... URL: www.fsr.maschinenbau.tu-darmstadt.de
Hi, As far as I know, xticklabels in matplotlib are "top"-aligned, so you may see misaligned baseline sometimes. Still, the problem you reported seems to be a bug in the pdf-backend. I posted a simple bug fix of the pdf backend http://article.gmane.org/gmane.comp.python.matplotlib.general/14041 and I guess this will also solve your problem. Although this fix is not yet picked up by matplotlib developers, can you apply it by yourself and see how it works? Regards, -JJ On Wed, Aug 13, 2008 at 3:56 AM, Jochen Schaab <sc...@fs...> wrote: > Hello > > I have a problem with manually set plot labels. > The baseline of the labels is not aligned when using the PDF output. It > works fine for PS or PNG. > Attached is a script which demonstrates my problem. > > Running > python test_baseline.py -dPDF > gives me a corrupted baseline for the x-labels. > > I am using > py25-matplotlib @0.98.3_0+tkinter > installed using MacPorts. > The config file matplotlibrc is unchanged. > > Thanks > Jochen > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
You may use the "errorbar" function to draw lines (including errorbars) and then hide (and show again) errorbars. From the errorbar documentation, Return value is a length 3 tuple. The first element is the :class:`~matplotlib.lines.Line2D` instance for the *y* symbol lines. The second element is a list of error bar cap lines, the third element is a list of :class:`~matplotlib.collections.LineCollection` instances for the horizontal and vertical error ranges. so, something like below will work. l, ec, el = errorbar(x, y, yerr, marker='s') setp(ec, visible=False) setp(el, visible=False) # when you want to show the errorbars again setp(ec, visible=True) setp(el, visible=True) -JJ On Tue, Aug 19, 2008 at 3:30 AM, Søren Nielsen <sor...@gm...> wrote: > Is it possible to add errorbars to existing line2D plots? I'd like the user > to be able to enable/disable errorbars by pushing a button. > > Cheers, > Soren > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > >
On Aug 19, 2008, at 11:37 AM, Ben Axelrod wrote: > When I try using axes.add_artist() to add an Annotation object, it > does not work. Adding a Text object in this manner works fine. > Shouldn’t Annotation also work since it inherits from Text? The > sample code below demonstrates. I am using version 0.98.3. > > from matplotlib.pyplot import figure, show > from matplotlib.text import Text > from matplotlib.text import Annotation > > fig = figure() > ax = fig.add_subplot(111) > > text = Text(0, 0, 'This is Text') > ann = Annotation('This is an Annotation', (1, 1)) > ax.annotate('This is another Annotation', (2, 2)) I looked at the annotate method in axes.py and the key difference is that it sets the transform keyword arg to the IdentityTransform. In otherwords, you can add something like this: >>> import matplotlib.transforms as mtransforms >>> ann = Annotation('This is an Annotation', (1, 1), ... transform=mtransforms.IdentityTransform()) Strangely, `ann.get_transform()` returns `IdentityTransform()` even if you *don't specify the transform keyword*. I don't understand why this (setting the transform kwarg) works, but it does change *final* transform. In other words, if you check the artist transforms *after adding the artists*, you'll notice when the transform is explicitly set (as above), the transform remains the IdentityTransform; otherwise it will be changed to the same transform as the Text instance. I don't understand why the IdentityTransform would be the correct transform for annotations or why Text and Annotation should have different transforms. Maybe a developer could enlighten us. Best, -Tony > > ax.add_artist(text) > ax.add_artist(ann) #this does not work PS. To check the final transform, add the following code after adding artists: >>> for a in ax.artists: ... print a ... print a.get_transform() > > ax.set_xlim(-1, 5) > ax.set_ylim(-1, 5) > show() > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win > great prizes > Grand prize is a trip for two to an Open Source event anywhere in > the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users
I thought of a way to side step the problem. Is it possible to have a Line2D object that only has a marker on one end? ________________________________ From: mat...@li... [mailto:mat...@li...] On Behalf Of Ben Axelrod Sent: Thursday, August 14, 2008 5:54 PM To: Matplotlib Subject: [Matplotlib-users] Arrow Questions I am trying to implement a dynamic graph in mpl, where users can drag around the nodes, and the edges follow the nodes like rubber bands. I have this working with regular edges, but I want to give the option of putting arrows on the edges. I am running into some issues with the Arrow classes. With my Text, Rectangle, and Line2D objects I can get and set their locations with methods such as get_position(), get_x(), and get_xdata() respectively. But there are no such methods for any of the Arrow classes. (By the way, it seems like these sorts of things would be in the base classes, and much more standard). What is the difference between Arrow, YAArrow, and FancyArrow anyway? (Besides drastically different scales). Some other features of the Arrow class that I would like very much are: * double headed arrows (one line with an arrow head on each end) * the ability to turn the arrow head on and off easily (Boolean parameter function) Does anyone have any ideas on how to work around these issues? Thanks, -Ben
When I try using axes.add_artist() to add an Annotation object, it does not work. Adding a Text object in this manner works fine. Shouldn't Annotation also work since it inherits from Text? The sample code below demonstrates. I am using version 0.98.3. from matplotlib.pyplot import figure, show from matplotlib.text import Text from matplotlib.text import Annotation fig = figure() ax = fig.add_subplot(111) text = Text(0, 0, 'This is Text') ann = Annotation('This is an Annotation', (1, 1)) ax.annotate('This is another Annotation', (2, 2)) ax.add_artist(text) ax.add_artist(ann) #this does not work ax.set_xlim(-1, 5) ax.set_ylim(-1, 5) show()
> but font style dosen't effect while other properties set properly. > what is the problem?? Did you try using a font name ?
Is it possible to add errorbars to existing line2D plots? I'd like the user to be able to enable/disable errorbars by pushing a button. Cheers, Soren
I use this code to set plot legend font : font = FontProperties(family ='monospace',style = 'italic',size='large', weight='bold') self.ax.legend( line, label, legend , prop = font ) but font style dosen't effect while other properties set properly. what is the problem?? -- View this message in context: http://www.nabble.com/font-style-problem%21-tp19045196p19045196.html Sent from the matplotlib - users mailing list archive at Nabble.com.
RendererPdf.get_text_width_height_descent() uses dviread to figure out the text extent. It seems that the text height returned by dviread is a height with descent not being included. Therefore, by manually adding the amount of the descent to its height, problem seems to be solved. At line 1652 of "lib/backends/backend_pdf.py" - return page.width, page.height, page.descent + return page.width, page.height+page.descent, page.descent By the way, agg and ps backends do not respect baselines when usetex=True. get_text_width_height_descent() method in these backends just returns 0 for the descent value and baseline alignment is not properly done. It seems that this can be fixed with the same method as in the pdf backend (using the dviread module). Is there any reason not doing this? While using the dviread seems to slow things down a bit, I guess it is better being correct than being fast. Regards, -JJ On Mon, Aug 18, 2008 at 6:09 PM, Jae-Joon Lee <lee...@gm...> wrote: > Hi, > > The pdf backend seems to return incorrect window extent (i.e., return > value of get_window_extent()) when usetex==True. > I'm attaching a small script to test this. > >> python test_text_window_extent.py -dPdf > > Its results for the pdf backend with usetex==True is attached. For > comparison, results for the Agg backend with usetex==False (which > seems correct) is also attached. > > I guess this bug is related with > > http://article.gmane.org/gmane.comp.python.matplotlib.general/13997 > > -JJ >
I've installed the Enthought Python Distribution for Mac OS on my MacOS 10.4 Intel machine. when i try to install basemap-0.99.1 I get this error: gcc: unrecognized option '-no-cpp-precomp' cc1: error: unrecognized command line option "-mno-fused-madd" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-arch" cc1: error: unrecognized command line option "-Wno-long-double" error: Command "gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/ MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Isrc -I/Library/ Frameworks/Python.framework/Versions/4.0.30001/lib/python2.5/site- packages/numpy-1.1.1.0001-py2.5-macosx-10.3-fat.egg/numpy/core/ include -I/Library/Frameworks/Python.framework/Versions/4.0.30001/ include/python2.5 -c src/PJ_gn_sinu.c -o build/temp.macosx-10.3- i386-2.5/src/PJ_gn_sinu.o" failed with exit status 1 Any ideas? lisa tauxe
Hi, The pdf backend seems to return incorrect window extent (i.e., return value of get_window_extent()) when usetex==True. I'm attaching a small script to test this. > python test_text_window_extent.py -dPdf Its results for the pdf backend with usetex==True is attached. For comparison, results for the Agg backend with usetex==False (which seems correct) is also attached. I guess this bug is related with http://article.gmane.org/gmane.comp.python.matplotlib.general/13997 -JJ