SourceForge logo
SourceForge logo
Menu

matplotlib-users — Discussion related to using matplotlib

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
(3)
Jun
Jul
Aug
(12)
Sep
(12)
Oct
(56)
Nov
(65)
Dec
(37)
2004 Jan
(59)
Feb
(78)
Mar
(153)
Apr
(205)
May
(184)
Jun
(123)
Jul
(171)
Aug
(156)
Sep
(190)
Oct
(120)
Nov
(154)
Dec
(223)
2005 Jan
(184)
Feb
(267)
Mar
(214)
Apr
(286)
May
(320)
Jun
(299)
Jul
(348)
Aug
(283)
Sep
(355)
Oct
(293)
Nov
(232)
Dec
(203)
2006 Jan
(352)
Feb
(358)
Mar
(403)
Apr
(313)
May
(165)
Jun
(281)
Jul
(316)
Aug
(228)
Sep
(279)
Oct
(243)
Nov
(315)
Dec
(345)
2007 Jan
(260)
Feb
(323)
Mar
(340)
Apr
(319)
May
(290)
Jun
(296)
Jul
(221)
Aug
(292)
Sep
(242)
Oct
(248)
Nov
(242)
Dec
(332)
2008 Jan
(312)
Feb
(359)
Mar
(454)
Apr
(287)
May
(340)
Jun
(450)
Jul
(403)
Aug
(324)
Sep
(349)
Oct
(385)
Nov
(363)
Dec
(437)
2009 Jan
(500)
Feb
(301)
Mar
(409)
Apr
(486)
May
(545)
Jun
(391)
Jul
(518)
Aug
(497)
Sep
(492)
Oct
(429)
Nov
(357)
Dec
(310)
2010 Jan
(371)
Feb
(657)
Mar
(519)
Apr
(432)
May
(312)
Jun
(416)
Jul
(477)
Aug
(386)
Sep
(419)
Oct
(435)
Nov
(320)
Dec
(202)
2011 Jan
(321)
Feb
(413)
Mar
(299)
Apr
(215)
May
(284)
Jun
(203)
Jul
(207)
Aug
(314)
Sep
(321)
Oct
(259)
Nov
(347)
Dec
(209)
2012 Jan
(322)
Feb
(414)
Mar
(377)
Apr
(179)
May
(173)
Jun
(234)
Jul
(295)
Aug
(239)
Sep
(276)
Oct
(355)
Nov
(144)
Dec
(108)
2013 Jan
(170)
Feb
(89)
Mar
(204)
Apr
(133)
May
(142)
Jun
(89)
Jul
(160)
Aug
(180)
Sep
(69)
Oct
(136)
Nov
(83)
Dec
(32)
2014 Jan
(71)
Feb
(90)
Mar
(161)
Apr
(117)
May
(78)
Jun
(94)
Jul
(60)
Aug
(83)
Sep
(102)
Oct
(132)
Nov
(154)
Dec
(96)
2015 Jan
(45)
Feb
(138)
Mar
(176)
Apr
(132)
May
(119)
Jun
(124)
Jul
(77)
Aug
(31)
Sep
(34)
Oct
(22)
Nov
(23)
Dec
(9)
2016 Jan
(26)
Feb
(17)
Mar
(10)
Apr
(8)
May
(4)
Jun
(8)
Jul
(6)
Aug
(5)
Sep
(9)
Oct
(4)
Nov
Dec
2017 Jan
(5)
Feb
(7)
Mar
(1)
Apr
(5)
May
Jun
(3)
Jul
(6)
Aug
(1)
Sep
Oct
(2)
Nov
(1)
Dec
2018 Jan
Feb
Mar
Apr
(1)
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2020 Jan
Feb
Mar
Apr
May
(1)
Jun
Jul
Aug
Sep
Oct
Nov
Dec
2025 Jan
(1)
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
Nov
Dec
S M T W T F S

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




Showing 19 results of 19

From: unij <jda...@un...> - 2010年11月10日 21:12:47
I'm trying to use mplot3d in a Wx based application, and most things seem to
be working fine. The one issue that keeps tripping me up is that the axes
labels are drawn at a weird angle. If I do the same type of plot without
using wx, then this problem goes away. I am completely stumped as to where
to even begin looking to fix this problem, so I would appreciate any
pointers you can give me.
I've attached a screenshot showing what I am talking about - a simple plot
where the axes labels look strange.
http://old.nabble.com/file/p30184616/mplot3d.jpg 
-- 
View this message in context: http://old.nabble.com/Axes-labels-crooked-using-mplot3d-in-WX-tp30184616p30184616.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Christian M. <mee...@im...> - 2010年11月10日 19:13:33
Thanks! Alas, this raises a NotImplementedError and although I'm still
running version 0.99 of mpl, it seems like this is not yet implemented
in the 'errorbar'-function to handle this - or am I mistaken?
I won't find the time to implement this.
Anyway, thanks again for your help. It would have been nice, but I can
live without it.
Christian
I won't find the time to implement this. 
On Wed, 2010年11月10日 at 09:18 -0600, Benjamin Root wrote:
> On Wed, Nov 10, 2010 at 7:44 AM, Christian Meesters
> <mee...@im...> wrote:
> Hi,
> 
> Honestly, I neglected my mpl skills lately, so I don't know
> whether docs
> on this topic are available, but I couldn't find them either.
> 
> I would like to create a forest plot using horizontal
> errorbars.
> Currently my marker is simply 'kd' in pylab.errorbar, where
> 'd' is
> similar to LaTeX's \blacklozenge.
> 
> Is there a way to rotate the marker such that long cross
> section is
> horizontal (rotation by 90 degree) and not vertical anymore?
> 
> TIA
> Christian
> 
> 
> 
> Christian,
> 
> Looking through the code for drawing the "thin diamond", I think you
> might be able to get what you want by specifying the fillstyle. It
> appears that different rotations are applied when the fillstyle is set
> to one of "bottom", "top", or "left". "full" is another available
> fillstyle, which appears to take a unit rectangle and rotates that 45
> degrees.
> 
> Probably your best bet would be the 'top' fillstyle, which looks like
> it does a 90 degree rotation.
> 
> I hope this helps,
> Ben Root
> 
> 
From: Michael D. <md...@st...> - 2010年11月10日 17:02:07
On 11/10/2010 10:41 AM, Benjamin Root wrote:
>
>
> On Tue, Nov 9, 2010 at 8:44 PM, Jae-Joon Lee <lee...@gm... 
> <mailto:lee...@gm...>> wrote:
>
> On Wed, Nov 10, 2010 at 1:01 AM, Jason Grout
> <jas...@cr... <mailto:jas...@cr...>>
> wrote:
> > Is the tip of the arrow (after the miter join) supposed to hit
> (1,1), or is
> > the center of the line supposed to hit (1,1)? Or maybe the tip
> of the
> > joinstyle='round' arrow (the default) is supposed to hit (1,1)?
> >
>
> The tip of the arrow is meant to hit (1,1), which is done by the
> underlying arrow class adjusting the end point of the path during the
> drawing time. This only happens for arrowstyle "->" and etc.
> However, there was an incorrect arithmetic which I think is fixed now.
> The patch is attached (it also fixes dpi-related issues).
> I'm not sure it would be better if this could be optionally turned
> off. Any suggestion?
> Let me know of any (persisting or other) issues.
>
> FYI, path is shortened by small amount by default. This is controlled
> by *shrink* parameter (shrinkA and shrinkB shortens the line begin and
> the line end respectively.)
>
>
> aa = ax.annotate('', (1,1), (0,0),
> arrowprops=dict(arrowstyle="-|>",
> fc="k", ec="k",lw=50,
> shrinkB=0,
> 
> path_effects=[Stroke(joinstyle='miter')]
> )
>
> Also, I noticed that the arrow head is not correctly filled when
> path_effects are in use. This is now fixed.
>
> Regards,
>
> -JJ
>
>
> I just seem to break things...
>
> I am not 100% sure if the tip is placed correctly, but it does appear 
> much better than before. I now see a tiny bit of the red line 
> southwest of the vertex. Before, the issue was that the arrow tip was 
> northeast of the vertex. In addition, I found that I was still able 
> to produce the distortion after zooming in sufficiently (it took a few 
> extra zooms to make it happen).
>
> I then did one more zoom, and then tried resizing the window, and I 
> think I broke the Agg renderer. Two exceptions were raised. First, 
> an overflow error occurred while rendering the path (complexity 
> exceeded). Then, an "SystemError: error return without exception set" 
> exception was raised from the same spot. I am wondering if zooming 
> into the arrow distortion and/or resizing the figure window triggered 
> the complexity issue, and then the error handling routines weren't 
> properly handling the raised exception. Here was my traceback:
The reason for the rendering complexity problem is that the arrow 
extends way, way, way off the edge of the image such that the values 
overflow (in pixel units) -- Agg uses 24.8 fixed-point arithmetic 
internally. The exception throwing itself in this case was broken 
(since fixed). Once the exception is thrown, it will always need to be 
thrown in subsequent calls into Agg, since there doesn't seem to be a 
clean way to recover from the exception. (There might be, but it gets 
down into a much hairier patch to Agg than I've been able to work through).
matplotlib currently supports clipping paths to the bounds of the image 
which prevents these huge values from getting passed to the Agg layer 
and blowing it up. Unfortunately, this algorithm only works on 
un-filled paths. Arrows are implemented as filled shapes, so this 
clipping functionality is turned off for them. The solution seems to be 
to implement a more sophisticated algorithm that would clip the path to 
the rectangle correctly. Certainly such algorithms exist.
Mike
>
> Traceback (most recent call last):
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtk.py", 
> line 394, in expose_event
> self._render_figure(self._pixmap, w, h)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtkagg.py", 
> line 75, in _render_figure
> FigureCanvasAgg.draw(self)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py", 
> line 394, in draw
> self.figure.draw(self.renderer)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py", 
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/figure.py", 
> line 874, in draw
> func(*args)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py", 
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/axes.py", 
> line 1954, in draw
> a.draw(renderer)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py", 
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/text.py", 
> line 1986, in draw
> self.arrow_patch.draw(renderer)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/patches.py", 
> line 3930, in draw
> path_effect.draw_path(renderer, gc, p, affine, None)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/patheffects.py", 
> line 121, in draw_path
> renderer.draw_path(gc0, tpath, affine, None)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py", 
> line 117, in draw_path
> self._renderer.draw_path(gc, path, transform, rgbFace)
> OverflowError: Agg rendering complexity exceeded. Consider 
> downsampling or decimating your data.
> Traceback (most recent call last):
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtk.py", 
> line 394, in expose_event
> self._render_figure(self._pixmap, w, h)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtkagg.py", 
> line 75, in _render_figure
> FigureCanvasAgg.draw(self)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py", 
> line 394, in draw
> self.figure.draw(self.renderer)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py", 
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/figure.py", 
> line 814, in draw
> if self.frameon: self.patch.draw(renderer)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py", 
> line 55, in draw_wrapper
> draw(artist, renderer, *args, **kwargs)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/patches.py", 
> line 411, in draw
> renderer.draw_path(gc, tpath, affine, rgbFace)
> File 
> "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py", 
> line 117, in draw_path
> self._renderer.draw_path(gc, path, transform, rgbFace)
> SystemError: error return without exception set
>
>
> ------------------------------------------------------------------------------
> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
> David G. Thomson, author of the best-selling book "Blueprint to a
> Billion" shares his insights and actions to help propel your
> business during the next growth cycle. Listen Now!
> http://p.sf.net/sfu/SAP-dev2dev
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Gianfranco D. <g....@in...> - 2010年11月10日 16:50:11
Dear mpl users,
I have the following problem to solve. Imagine to have the simple example reported on website plotting the errorbars of some x,y data:
#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
# example data
x = np.arange(0.1, 4, 0.5)
y = np.exp(-x)
# example variable error bar values
yerr = 0.1 + 0.2*np.sqrt(x)
xerr = 0.1 + yerr
# First illustrate basic pyplot interface, using defaults where possible.
plt.figure()
plt.errorbar(x, y, xerr=0.2, yerr=0.4)
================================================
Now I change the last line into:
p = plt.errorbar(x, y, xerr=0.2, yerr=0.4)
and if I change, for instance, y:
y = y/2.
I can easily replace the x,y with:
p[0].set_data(x,y)
but I do not know how to do the same for the errorbars.
I need to do this as I am implementing a code with a GUI written in PyQt4, and I need to quickly replot some data.
Can anyone help me?
Many thanks in advance
Gianfranco Durin
From: John H. <jd...@gm...> - 2010年11月10日 15:59:32
On Wed, Nov 10, 2010 at 9:48 AM, Michiel de Hoon <mjl...@ya...> wrote:
> Garry, if the bug still exists in matplotlib 1.0 could you open a bug report for it?
I think Gary doesn't have easy access to 1.0. Here is the relevant
example if anyone has 1.0 on macosx to test with
 http://matplotlib.sourceforge.net/examples/pylab_examples/image_origin.html
JDH
From: Michiel de H. <mjl...@ya...> - 2010年11月10日 15:48:39
Garry, if the bug still exists in matplotlib 1.0 could you open a bug report for it?
Thanks,
--Michiel.
--- On Wed, 11/10/10, John Hunter <jd...@gm...> wrote:
> From: John Hunter <jd...@gm...>
> Subject: Re: [Matplotlib-users] python v ipython problem in imshow()
> To: "Garry Willgoose" <Gar...@ne...>, "Michiel de Hoon" <mjl...@ya...>
> Cc: mat...@li...
> Date: Wednesday, November 10, 2010, 8:28 AM
> On Wed, Nov 10, 2010 at 5:43 AM,
> Garry Willgoose
> <Gar...@ne...>
> wrote:
> > John,
> >
> > OK by looking at matplotlib.rcParams['backend'] I've
> been able to diagnose this a little more.
> >
> > When the backend is 'WXAgg' everything looks fine.
> The axes have (0,0) where you would expect and the data is
> plotted correctly.
> >
> > However, when the backend is 'MacOSX' the axes again
> have (0,0) where you would expect but the data is plotted so
> it is flipped vertically (i.e. what is at the top is at the
> bottom, and vice versa).
> >
> > It doesn't look like an issue between python and
> ipython, or at least I don't seem to have been able to
> reproduce it tonight
> >
> > I'm using matplotlib version 0.99.1.1. Is this likely
> to be fixed in V1.0? I haven't upgraded to the latest
> enthought distribution because I had some problems with the
> binary extension libraries I have written ... I ought to
> sort it out but I've got a bit of deadline approaching and
> I'd prefer to leave it til later
> 
> It looks like the macosx backend has not implemented
> support for the
> image origin parameter. I'm CC-ing Michiel, the
> macosx author, to see
> if this is something he can add support for.
> 
> Thanks,
> JDH
> 
 
From: Benjamin R. <ben...@ou...> - 2010年11月10日 15:42:18
On Tue, Nov 9, 2010 at 8:44 PM, Jae-Joon Lee <lee...@gm...> wrote:
> On Wed, Nov 10, 2010 at 1:01 AM, Jason Grout
> <jas...@cr...> wrote:
> > Is the tip of the arrow (after the miter join) supposed to hit (1,1), or
> is
> > the center of the line supposed to hit (1,1)? Or maybe the tip of the
> > joinstyle='round' arrow (the default) is supposed to hit (1,1)?
> >
>
> The tip of the arrow is meant to hit (1,1), which is done by the
> underlying arrow class adjusting the end point of the path during the
> drawing time. This only happens for arrowstyle "->" and etc.
> However, there was an incorrect arithmetic which I think is fixed now.
> The patch is attached (it also fixes dpi-related issues).
> I'm not sure it would be better if this could be optionally turned
> off. Any suggestion?
> Let me know of any (persisting or other) issues.
>
> FYI, path is shortened by small amount by default. This is controlled
> by *shrink* parameter (shrinkA and shrinkB shortens the line begin and
> the line end respectively.)
>
>
> aa = ax.annotate('', (1,1), (0,0),
> arrowprops=dict(arrowstyle="-|>",
> fc="k", ec="k",lw=50,
> shrinkB=0,
> path_effects=[Stroke(joinstyle='miter')]
> )
>
> Also, I noticed that the arrow head is not correctly filled when
> path_effects are in use. This is now fixed.
>
> Regards,
>
> -JJ
>
I just seem to break things...
I am not 100% sure if the tip is placed correctly, but it does appear much
better than before. I now see a tiny bit of the red line southwest of the
vertex. Before, the issue was that the arrow tip was northeast of the
vertex. In addition, I found that I was still able to produce the
distortion after zooming in sufficiently (it took a few extra zooms to make
it happen).
I then did one more zoom, and then tried resizing the window, and I think I
broke the Agg renderer. Two exceptions were raised. First, an overflow
error occurred while rendering the path (complexity exceeded). Then, an
"SystemError: error return without exception set" exception was raised from
the same spot. I am wondering if zooming into the arrow distortion and/or
resizing the figure window triggered the complexity issue, and then the
error handling routines weren't properly handling the raised exception.
Here was my traceback:
Traceback (most recent call last):
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtk.py",
line 394, in expose_event
 self._render_figure(self._pixmap, w, h)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtkagg.py",
line 75, in _render_figure
 FigureCanvasAgg.draw(self)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py",
line 394, in draw
 self.figure.draw(self.renderer)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/figure.py",
line 874, in draw
 func(*args)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/axes.py",
line 1954, in draw
 a.draw(renderer)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/text.py",
line 1986, in draw
 self.arrow_patch.draw(renderer)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/patches.py",
line 3930, in draw
 path_effect.draw_path(renderer, gc, p, affine, None)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/patheffects.py",
line 121, in draw_path
 renderer.draw_path(gc0, tpath, affine, None)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py",
line 117, in draw_path
 self._renderer.draw_path(gc, path, transform, rgbFace)
OverflowError: Agg rendering complexity exceeded. Consider downsampling or
decimating your data.
Traceback (most recent call last):
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtk.py",
line 394, in expose_event
 self._render_figure(self._pixmap, w, h)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_gtkagg.py",
line 75, in _render_figure
 FigureCanvasAgg.draw(self)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py",
line 394, in draw
 self.figure.draw(self.renderer)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/figure.py",
line 814, in draw
 if self.frameon: self.patch.draw(renderer)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/artist.py",
line 55, in draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/patches.py",
line 411, in draw
 renderer.draw_path(gc, tpath, affine, rgbFace)
 File
"/home/bvr/Programs/matplotlib/matplotlib/lib/matplotlib/backends/backend_agg.py",
line 117, in draw_path
 self._renderer.draw_path(gc, path, transform, rgbFace)
SystemError: error return without exception set
From: Benjamin R. <ben...@ou...> - 2010年11月10日 15:26:21
On Wed, Nov 10, 2010 at 7:44 AM, Christian Meesters <
mee...@im...> wrote:
> Hi,
>
> Honestly, I neglected my mpl skills lately, so I don't know whether docs
> on this topic are available, but I couldn't find them either.
>
> I would like to create a forest plot using horizontal errorbars.
> Currently my marker is simply 'kd' in pylab.errorbar, where 'd' is
> similar to LaTeX's \blacklozenge.
>
> Is there a way to rotate the marker such that long cross section is
> horizontal (rotation by 90 degree) and not vertical anymore?
>
> TIA
> Christian
>
>
>
Christian,
Looking through the code for drawing the "thin diamond", I think you might
be able to get what you want by specifying the fillstyle. It appears that
different rotations are applied when the fillstyle is set to one of
"bottom", "top", or "left". "full" is another available fillstyle, which
appears to take a unit rectangle and rotates that 45 degrees.
Probably your best bet would be the 'top' fillstyle, which looks like it
does a 90 degree rotation.
I hope this helps,
Ben Root
From: Christian M. <mee...@im...> - 2010年11月10日 14:00:15
Hi,
Honestly, I neglected my mpl skills lately, so I don't know whether docs
on this topic are available, but I couldn't find them either.
I would like to create a forest plot using horizontal errorbars.
Currently my marker is simply 'kd' in pylab.errorbar, where 'd' is
similar to LaTeX's \blacklozenge. 
Is there a way to rotate the marker such that long cross section is
horizontal (rotation by 90 degree) and not vertical anymore?
TIA
Christian
That works great.
Never would have looked there.
Thanks!
Mark
On Wed, Nov 10, 2010 at 2:27 PM, John Hunter <jd...@gm...> wrote:
> axes.unicode_minus : False
From: John H. <jd...@gm...> - 2010年11月10日 13:29:14
On Wed, Nov 10, 2010 at 5:43 AM, Garry Willgoose
<Gar...@ne...> wrote:
> John,
>
> OK by looking at matplotlib.rcParams['backend'] I've been able to diagnose this a little more.
>
> When the backend is 'WXAgg' everything looks fine. The axes have (0,0) where you would expect and the data is plotted correctly.
>
> However, when the backend is 'MacOSX' the axes again have (0,0) where you would expect but the data is plotted so it is flipped vertically (i.e. what is at the top is at the bottom, and vice versa).
>
> It doesn't look like an issue between python and ipython, or at least I don't seem to have been able to reproduce it tonight
>
> I'm using matplotlib version 0.99.1.1. Is this likely to be fixed in V1.0? I haven't upgraded to the latest enthought distribution because I had some problems with the binary extension libraries I have written ... I ought to sort it out but I've got a bit of deadline approaching and I'd prefer to leave it til later
It looks like the macosx backend has not implemented support for the
image origin parameter. I'm CC-ing Michiel, the macosx author, to see
if this is something he can add support for.
Thanks,
JDH
On Wed, Nov 10, 2010 at 6:38 AM, Mark Bakker <ma...@gm...> wrote:
> I have a pretty wacky problem.
> I create a figure which includes negative values along the y-axis:
> plot([-1,1]) for example.
> I save the figure as EPS.
> When I look at the figure with preview on my Mac it looks fine.
> When I import the figure in my Latex document the negative values disappear.
> My solution has been to use eps2eps on the eps file created by mpl, and this
> solves the problem. So apparently there is something not quite standard on
> the EPS file created by MPL.
> Is this a bug?
> I am running version 0.99.3 (Enthought dis) on a Mac running Leopard.
mpl by default uses the unicode minus symbol rather than the hyphen to
indicate negative numbers. It looks like your system may not be
recognizing it. The easiest solution is to set
 axes.unicode_minus : False
in your matplotlib rc.
JDH
From: Stefan M. <ste...@mn...> - 2010年11月10日 13:17:09
Hello everyone, 
I have a question regarding the formatting of ticks in a curved
coordinate system. To create my plots I am useing the
mpl_toolkits.axisartist.floating_axes.GridHelperCurveLinear() function.
This works quite well but I have difficulties with formatting the axis.
I am working in a polar coordinate system. To format the longitudinal
axis I found the function
mpl_toolkits.axisartist.angle_helper.FormatterDMS() and it works good.
But I want to chance the formatting of the radius too. For this I need
to pass something to the kwargs tick_formatter2 of the function
GridHelperCurveLinear but I do not know what. 
Could you give me some advice?
Regards
Stefan
Here is the code I use:
import matplotlib.pyplot as plt
import mpl_toolkits.axisartist.floating_axes as floating_axes
from matplotlib.projections import PolarAxes
fig = plt.figure()
tr = PolarAxes.PolarTransform()
grid_helper = floating_axes.GridHelperCurveLinear( tr, extremes=( 1, 2,
1000, 2000 ), tick_formatter1 = None, tick_formatter2 = None )
ax1 = floating_axes.FloatingSubplot( fig, 111, grid_helper=grid_helper )
fig.add_subplot( ax1 )
ax1.grid( True )
plt.show()
Hello List,
I have a pretty wacky problem.
I create a figure which includes negative values along the y-axis:
plot([-1,1]) for example.
I save the figure as EPS.
When I look at the figure with preview on my Mac it looks fine.
When I import the figure in my Latex document the negative values disappear.
My solution has been to use eps2eps on the eps file created by mpl, and this
solves the problem. So apparently there is something not quite standard on
the EPS file created by MPL.
Is this a bug?
I am running version 0.99.3 (Enthought dis) on a Mac running Leopard.
Thanks for any suggestions,
Mark
From: Garry W. <Gar...@ne...> - 2010年11月10日 11:43:30
John,
OK by looking at matplotlib.rcParams['backend'] I've been able to diagnose this a little more.
When the backend is 'WXAgg' everything looks fine. The axes have (0,0) where you would expect and the data is plotted correctly. 
However, when the backend is 'MacOSX' the axes again have (0,0) where you would expect but the data is plotted so it is flipped vertically (i.e. what is at the top is at the bottom, and vice versa). 
It doesn't look like an issue between python and ipython, or at least I don't seem to have been able to reproduce it tonight
I'm using matplotlib version 0.99.1.1. Is this likely to be fixed in V1.0? I haven't upgraded to the latest enthought distribution because I had some problems with the binary extension libraries I have written ... I ought to sort it out but I've got a bit of deadline approaching and I'd prefer to leave it til later
> On Tue, Nov 9, 2010 at 4:33 PM, Garry Willgoose
> <Gar...@ne...> wrote:
>> I'm using the following code to plot some grided data
>> 
>> fig1=pylab.figure()
>> contents1=fig1.add_subplot(111)
>> stuff=contents1.imshow(mydata,origin='lower',aspect='equal')
>> 
>> and I find that if I launch the code with 'ipython' the data looks as expected but if I use 'python' then the x-axis annotations are OK but the data is still plotted with the origin in the top left hand corner. I'm using the enthought 6.1 distribution and the version of matplotlib and pylab imported in both cases is the same. I guess one indicator of a major difference is that ipython has the icon bar for the plot at the bottom of the screen but python has the icon bar at the top of the screen. Any clues ... I'd happily just use ipython but I distribute the code to others so I'd like to get it sorted.
> 
> Sounds like a backend problem (see
> http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
> and http://matplotlib.sourceforge.net/users/customizing.html)
> 
> First thing you'll want to do is put
> 
> import matplotlib
> print matplotlib.rcParams['backend']
> 
> at the top of your script and run it in both environments and report
> what you find. My guess is one of the environments has a backend that
> does not support the image origin argument.
> 
> JDH
From: Jason G. <jas...@cr...> - 2010年11月10日 04:41:27
On 11/9/10 8:44 PM, Jae-Joon Lee wrote:
> On Wed, Nov 10, 2010 at 1:01 AM, Jason Grout
> <jas...@cr...> wrote:
>> Is the tip of the arrow (after the miter join) supposed to hit (1,1), or is
>> the center of the line supposed to hit (1,1)? Or maybe the tip of the
>> joinstyle='round' arrow (the default) is supposed to hit (1,1)?
>>
>
> The tip of the arrow is meant to hit (1,1), which is done by the
> underlying arrow class adjusting the end point of the path during the
> drawing time. This only happens for arrowstyle "->" and etc.
> However, there was an incorrect arithmetic which I think is fixed now.
> The patch is attached (it also fixes dpi-related issues).
> I'm not sure it would be better if this could be optionally turned
> off. Any suggestion?
> Let me know of any (persisting or other) issues.
Wow. You're amazing. Thanks for all the work you put into this right 
away! When I set shrinkB to zero, that arrow is right on the money.
>
> FYI, path is shortened by small amount by default. This is controlled
> by *shrink* parameter (shrinkA and shrinkB shortens the line begin and
> the line end respectively.)
>
Right. In Sage, we're using the shrinkA and shrinkB options quite a 
bit. For example, we use it in drawing vertex-and-edge graphs (so the 
arrows go to the edges of the vertex circles), and right now we use it 
by default to shrink by the linewidth (though I think I'm going to turn 
off Sage's default shrinking and just leave that up to the user).
This latest patch seems to take care of the problems I was seeing.
Thanks again!
Jason
--
Jason Grout
From: Jae-Joon L. <lee...@gm...> - 2010年11月10日 02:45:21
Attachments: arrow.patch
On Wed, Nov 10, 2010 at 1:01 AM, Jason Grout
<jas...@cr...> wrote:
> Is the tip of the arrow (after the miter join) supposed to hit (1,1), or is
> the center of the line supposed to hit (1,1)? Or maybe the tip of the
> joinstyle='round' arrow (the default) is supposed to hit (1,1)?
>
The tip of the arrow is meant to hit (1,1), which is done by the
underlying arrow class adjusting the end point of the path during the
drawing time. This only happens for arrowstyle "->" and etc.
However, there was an incorrect arithmetic which I think is fixed now.
The patch is attached (it also fixes dpi-related issues).
I'm not sure it would be better if this could be optionally turned
off. Any suggestion?
Let me know of any (persisting or other) issues.
FYI, path is shortened by small amount by default. This is controlled
by *shrink* parameter (shrinkA and shrinkB shortens the line begin and
the line end respectively.)
aa = ax.annotate('', (1,1), (0,0),
 arrowprops=dict(arrowstyle="-|>",
 fc="k", ec="k",lw=50,
 shrinkB=0,
 path_effects=[Stroke(joinstyle='miter')]
 )
Also, I noticed that the arrow head is not correctly filled when
path_effects are in use. This is now fixed.
Regards,
-JJ
From: Jeff W. <js...@fa...> - 2010年11月10日 01:55:34
On 11/5/10 5:08 AM, Basedow Sünnje Linnéa wrote:
>
> Hi!
> I try to plot some interpolated data on a map and get an error saying 
> there are too many indices. When I use contour in matplotlib without 
> basemap I don't get the error. Also the map without a contour plot on 
> it works. Maybe some of you know what I do wrong?
>
> Here is my code:
> -------------
> import numpy as np
> import matplotlib.pyplot as plt
> from matplotlib.mlab import griddata
> from mpl_toolkits.basemap import Basemap
>
> yi = np.linspace(min(Lat),max(Lat),100)
> xi = np.linspace(min(Lon),max(Lon),50)
> lon,lat,var = np.array(Lon), np.array(Lat), np.array(Var)
> zi = griddata(lon,lat,var,xi,yi)
>
> map = Basemap(projection='cyl', llcrnrlat=67, urcrnrlat=73,\
> llcrnrlon=4, urcrnrlon=20, resolution='h')
>
> map.drawcoastlines()
>
> map.drawmeridians(np.arange(0,360,1))
> map.drawparallels(np.arange(-90,90,1))
>
> xlon, ylat = map(xi,yi)
> cs = map.contour(xlon,ylat,zi)
>
> plt.show()
> ---------------
>
> and this is the error message:
>
> cs = map.contour(xlon,ylat,zi)
> File 
> "/usr/local/lib/python2.6/dist-packages/mpl_toolkits/basemap/__init__.py", 
> line 2820, in contour
> xx = x[x.shape[0]/2,:]
> IndexError: too many indices
>
> Any help appreciated!
> Sünnje
>
Sunnje: xlon, xlat must be 2d arrays (with the same shape as zi) when 
used with the contourf basemap method. You can make them into 2d arrays 
with meshgrid.
-Jeff
From: Jae-Joon L. <lee...@gm...> - 2010年11月10日 00:57:35
On Wed, Nov 10, 2010 at 12:21 AM, Benjamin Root <ben...@ou...> wrote:
> On Tue, Nov 9, 2010 at 7:24 AM, Jae-Joon Lee <lee...@gm...> wrote:
>>
>> Thanks for tracking down this.
>> It turned out to be a silly error while adjusting the line end-point.
>> I'm attaching the patch. Please test the patch if you can.
>> I'll commit the change sometime tomorrow.
>>
Thanks. I can reproduce the problem.
aa = ax.annotate('', (1,1),
 (-10,-10),
 arrowprops=dict(arrowstyle="-|>",
 fc="w", ec="k",lw=30,
 path_effects=[Stroke(joinstyle='miter')])
 )
The erroneous behavior happens when one tries to draw a path that
connects points far outside of the canvas (point 10,10 in above
example). And this is a AGG-specific issue. The erroneous behavior
goes away if we clip the path.
aa.arrow_patch.set_clip_box(ax.figure.bbox)
I try to reproduce the problem with simple plot command, but couldn't.
Maybe this happens only for rendering bezier splines?
Michael, any idea?
One thing I may do to prevent it is to set the clip_path of the arrow
to the figure.bbox by default.
I'll think about it.
Regards,
-JJ
>> Regards,
>>
>> -JJ
>>
>>
>> On Tue, Nov 9, 2010 at 9:15 PM, Jason Grout <jas...@cr...>
>> wrote:
>>>
>>> I've been trying to track down a problem in the arrows where the arrow
>>> seems to be off by a little bit. I've narrowed down the problem to a
>>> small example:
>>>
>>> import matplotlib.patches as mpatches
>>> import matplotlib.pyplot as plt
>>> fig=plt.figure()
>>> ax = fig.add_subplot(111, xlim=(.98,1.02),
>>> ylim=(.98,1.02),aspect='equal')
>>> from matplotlib.patheffects import Stroke
>>>
>>> ax.annotate('', (1,1),
>>>       (0,0),
>>>       arrowprops=dict(arrowstyle="-|>",
>>>               fc="w", ec="k",lw=30,
>>>               path_effects=[Stroke(joinstyle='miter')]),)
>>> ax.plot([0,1],[1,1])
>>> ax.plot([1,1],[0,1])
>>> ax.plot([0,1.02],[0,1.02])
>>>
>>> fig.savefig('test.png')
>>>
>>>
>>> I've used a miter join above because it illustrates the problem better.
>>> Notice that the arrowhead tip is just below the line, but should be
>>> right on the line. Any clue about what the problem is?
>>>
>>> Thanks,
>>>
>>> Jason
>>>
>>> --
>>> Jason Grout
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
>>> David G. Thomson, author of the best-selling book "Blueprint to a
>>> Billion" shares his insights and actions to help propel your
>>> business during the next growth cycle. Listen Now!
>>> http://p.sf.net/sfu/SAP-dev2dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>>
>> ------------------------------------------------------------------------------
>> The Next 800 Companies to Lead America's Growth: New Video Whitepaper
>> David G. Thomson, author of the best-selling book "Blueprint to a
>> Billion" shares his insights and actions to help propel your
>> business during the next growth cycle. Listen Now!
>> http://p.sf.net/sfu/SAP-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
> Jae-Joon,
>
> I just tested out the patch, and while it did seem to fix the problem for me
> on the test script, I am not 100% certain that it is properly lined up
> (maybe an off-by-one-pixel error?). Anyway, I tried zooming in to see which
> kind of error it was and I got a very weird image. I am not certain exactly
> what triggers it, but I think if the rubber-banding does not incorporate the
> entire arrow-head, then the distortion appears. I was also able to
> reproduce the distortion without the patch (although I think it was easier
> to cause with the patch).
>
> Ben Root
>
>

Showing 19 results of 19

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





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

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

More information about our ad policies

Ad destination/click URL:

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