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

Showing 13 results of 13

From: Uri L. <las...@mi...> - 2010年12月14日 22:16:31
Strangely, it appears to find the correct numpy.
More strangely, I picked a random order of doing things and suddenly it all
works. I think what I ended up doing is this:
Following builds using default setting without changing anything except:
MACOSX_DEPLOYMENT_TARGET=10.6
python 2.7
numpy 1.5.1 with the flag --fcompiler=gnu95
mpl from github, setting the flags as I have posted earlier
then set these flags:
export MACOSX_DEPLOYMENT_TARGET=10.6
export CFLAGS="-arch i386 -arch x86_64"
export FFLAGS="-m32 -m64"
export LDFLAGS="-Wall -undefined dynamic_lookup -bundle -arch i386 -arch
x86_64 -framework Accelerate"
then build scipy 0.8.0 with --fcompiler=gnu95
Then it all worked. Honestly, I don't understand why it should work because
of this voodoo, but I am happily making figures now...
Also of note, supposedly scipy 0.8 has problems with python 2.7. Version
0.9 should solve these problems (currently in beta).
Thanks for the help!
Uri
...................................................................................
Uri Laserson
Graduate Student, Biomedical Engineering
Harvard-MIT Division of Health Sciences and Technology
M +1 917 742 8019
las...@mi...
On Tue, Dec 14, 2010 at 17:03, Benjamin Root <ben...@ou...> wrote:
> On Mon, Dec 13, 2010 at 5:54 PM, Uri Laserson <las...@mi...> wrote:
>
>>
>>> Well, on my Linux system, when I get that error, it happens when I do
>>> an update of numpy, but fail to rebuild mpl. Here is the order how I
>>> build things: numpy, scipy, matplotlib. I would imagine ipython goes
>>> last.
>>>
>>>
>> That has been my order as well. How can I track down why the import of
>> numpy.core.multiarray is causing the problem? And why would it cause a
>> problem only when MPL is being imported, but not if I import it manually?
>>
>> Originally, I tried to build the GitHub trunk version of numpy, but then
>> abandoned that. Since MPL is saying that it was built against the 20000...
>> ABI rather than the 10000... ABI, is it possible the MPL is finding some
>> other version of numpy lying around? However, I'm pretty sure I deleted
>> everything from the git numpy build. How could I pinpoint which numpy
>> libraries are being linked against in the MPL build?
>>
>> Uri
>>
>
> Uri,
>
>
> "is it possible the MPL is finding some other version of numpy lying
> around?"
>
> Yes, this is really the only remaining explanation. To find out which
> numpy is being used for the build process, I think if you save the output of
> the build process for mpl, I am fairly sure that that information is
> somewhere near the beginning of the build log.
>
> Ben Root
>
From: Benjamin R. <ben...@ou...> - 2010年12月14日 22:04:26
On Mon, Dec 13, 2010 at 5:54 PM, Uri Laserson <las...@mi...> wrote:
>
>> Well, on my Linux system, when I get that error, it happens when I do
>> an update of numpy, but fail to rebuild mpl. Here is the order how I
>> build things: numpy, scipy, matplotlib. I would imagine ipython goes
>> last.
>>
>>
> That has been my order as well. How can I track down why the import of
> numpy.core.multiarray is causing the problem? And why would it cause a
> problem only when MPL is being imported, but not if I import it manually?
>
> Originally, I tried to build the GitHub trunk version of numpy, but then
> abandoned that. Since MPL is saying that it was built against the 20000...
> ABI rather than the 10000... ABI, is it possible the MPL is finding some
> other version of numpy lying around? However, I'm pretty sure I deleted
> everything from the git numpy build. How could I pinpoint which numpy
> libraries are being linked against in the MPL build?
>
> Uri
>
Uri,
"is it possible the MPL is finding some other version of numpy lying
around?"
Yes, this is really the only remaining explanation. To find out which numpy
is being used for the build process, I think if you save the output of the
build process for mpl, I am fairly sure that that information is somewhere
near the beginning of the build log.
Ben Root
From: Benjamin R. <ben...@ou...> - 2010年12月14日 21:46:34
On Tue, Dec 14, 2010 at 2:29 PM, Skip Montanaro <sk...@po...> wrote:
> I am plotting a time series, a handful of moving averages and the
> standard deviation of one of the moving averages. The first crop of
> data are all in an overlapping range so are plotted using the
> left-hand y axis. The standard deviation range falls way outside the
> ranges of the other data streams, so I plot it on the right- hand
> axis.
>
> Since legends are associated with an axis how do I create one legend
> which covers all lines in the graph? I keep getting a complaint from
> mpl about the number of labels not matching the number of arrays being
> plotted (one v. five if I get the legend associated with the
> right-hand axis, four v. five if I get the legend associated with the
> left-hand axis).
>
> Thanks,
>
> Skip Montanaro
> sk...@po...
>
>
>
Skip,
You can call figlegend() and build a legend for the figure, irrespectively
of any axes. With this function, you can explicitly pass it a list of the
line objects and the labels.
http://matplotlib.sourceforge.net/api/pyplot_api.html?highlight=legend#matplotlib.pyplot.figlegend
I don't think it can automatically know about all of the lines in your graph
(then again, I haven't tried and maybe it does).
I hope this helps!
Ben Root
From: Skip M. <sk...@po...> - 2010年12月14日 20:29:57
I am plotting a time series, a handful of moving averages and the
standard deviation of one of the moving averages. The first crop of
data are all in an overlapping range so are plotted using the
left-hand y axis. The standard deviation range falls way outside the
ranges of the other data streams, so I plot it on the right- hand
axis.
Since legends are associated with an axis how do I create one legend
which covers all lines in the graph? I keep getting a complaint from
mpl about the number of labels not matching the number of arrays being
plotted (one v. five if I get the legend associated with the
right-hand axis, four v. five if I get the legend associated with the
left-hand axis).
Thanks,
Skip Montanaro
sk...@po...
From: vt603800 <vt6...@ba...> - 2010年12月14日 20:29:37
I tried to upgrade to version 1.0 but without success. Could anybody tell
where it went wrong?
I downloaded the package matplotlib-1.0.0.tar.gz from 
http://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0/
First I tried a easy install, doing
easy_install -m matplotlib-1.0.0.tar.gz
from the command line but after this I checked the current version in Idle
and it still was 0.99
So I manually removed all the matplotlib files from /usr/lib/pymodules/
and did the easy install again from the command line
but now I can't import matplotlib anymore in Idle.
This was the installation report:
install_dir /usr/local/lib/python2.6/dist-packages/
Processing matplotlib-1.0.0.tar.gz
Running matplotlib-1.0.0/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-dWh4_f/matplotlib-1.0.0/egg-dist-tmp-ohZvCJ
basedirlist is: ['/usr/local', '/usr']
============================================================================
BUILDING MATPLOTLIB
 matplotlib: 1.0.0
 python: 2.6.6 (r266:84292, Sep 15 2010, 16:22:56) [GCC
 4.4.5]
 platform: linux2
REQUIRED DEPENDENCIES
 numpy: 1.3.0
 freetype2: found, but unknown version (no pkg-config)
 * WARNING: Could not find 'freetype2' headers in
any
 * of '/usr/local/include', '/usr/include', '.',
 * '/usr/local/include/freetype2',
 * '/usr/include/freetype2', './freetype2'.
OPTIONAL BACKEND DEPENDENCIES
 libpng: found, but unknown version (no pkg-config)
 * Could not find 'libpng' headers in any of
 * '/usr/local/include', '/usr/include', '.'
 Tkinter: no
 * Using default library and include directories
for
 * Tcl and Tk because a Tk window failed to open.
 * You may need to define DISPLAY for Tk to work so
 * that setup can determine where your libraries
are
 * located. Tkinter present, but header files are
not
 * found. You may need to install development
 * packages.
 wxPython: 2.8.11.0
 * WxAgg extension not required for wxPython >= 2.8
 pkg-config: looking for pygtk-2.0 gtk+-2.0
 * Package pygtk-2.0 was not found in the
pkg-config
 * search path. Perhaps you should add the
directory
 * containing `pygtk-2.0.pc' to the PKG_CONFIG_PATH
 * environment variable No package 'pygtk-2.0'
found
 * Package gtk+-2.0 was not found in the pkg-config
 * search path. Perhaps you should add the
directory
 * containing `gtk+-2.0.pc' to the PKG_CONFIG_PATH
 * environment variable No package 'gtk+-2.0' found
 * You may need to install 'dev' package(s) to
 * provide header files.
 Gtk+: no
 * Could not find Gtk+ headers in any of
 * '/usr/local/include', '/usr/include', '.'
 Mac OS X native: no
 Qt: no
 Qt4: no
 Cairo: 1.8.8
OPTIONAL DATE/TIMEZONE DEPENDENCIES
 datetime: present, version unknown
 dateutil: 1.4.1
 pytz: 2010b
OPTIONAL USETEX DEPENDENCIES
 dvipng: no
 ghostscript: 8.71
 latex: no
 pdftops: 0.14.3
[Edit setup.cfg to suppress the above messages]
============================================================================
pymods ['pylab']
packages ['matplotlib', 'matplotlib.backends',
'matplotlib.backends.qt4_editor', 'matplotlib.projections',
'matplotlib.testing', 'matplotlib.testing.jpl_units', 'matplotlib.tests',
'mpl_toolkits', 'mpl_toolkits.mplot3d', 'mpl_toolkits.axes_grid',
'mpl_toolkits.axes_grid1', 'mpl_toolkits.axisartist',
'matplotlib.sphinxext', 'matplotlib.numerix', 'matplotlib.numerix.mlab',
'matplotlib.numerix.ma', 'matplotlib.numerix.linear_algebra',
'matplotlib.numerix.random_array', 'matplotlib.numerix.fft',
'matplotlib.tri', 'matplotlib.delaunay']
warning: no files found matching 'MANIFEST'
warning: no files found matching 'examples/data/*'
warning: no files found matching 'lib/mpl_toolkits'
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: Setup script exited with error: command 'gcc' failed with exit
status 1
Hans R
On 2010年12月13日 14:13:32 -0600, Ryan May <rm...@gm...> wrote:
> On Mon, Dec 13, 2010 at 2:07 PM, vt603800 <vt6...@ba...> wrote:
>> I get this error:
>> AttributeError: 'module' object has no attribute 'subplot2grid'
>>
>> Are some modules not installed? or is there another problem, I'm a
newby
>> in
>> matplotlib, it might be something very obvious...
>>
>> Running Matplotlib version 0.99.3 (python 2.6.6) on Ubuntu 10.10
> 
> I'm 90% certain that the subplot2grid feature was added in 1.0. You
> could build and install from source:
> 
>
https://sourceforge.net/projects/matplotlib/files/matplotlib/matplotlib-1.0/
> 
> Ryan
From: Daniel H. <dh...@gm...> - 2010年12月14日 19:24:55
I'm using it too, with excellent results. Thanks JJ!
On Tue, Dec 14, 2010 at 2:13 PM, C M <cmp...@gm...> wrote:
>
>>
>>
>> On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee...@gm...>wrote:
>>
>>> On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> wrote:
>>> > Until a more permanent solution is figured out, can anyone recommend
>>> > any workarounds, even if they are a little clunky? I'm embedding mpl
>>> > plots in wxPython and am also finding this issue suboptimal.
>>> >
>>> > Che
>>> >
>>>
>>> A (partial) workaround is possible using the axes_grid1 toolkit (i.e.,
>>> you need matplotlib 1.0).
>>> Attached is a module I just cooked up (based on my previous attempt @
>>>
>>> http://www.mail-archive.com/mat...@li.../msg18129.html
>>> ),
>>> and it seems to work quite well.
>>> The usage is simple.
>>>
>>>
>>> ax = plt.axes([0,0,1,1])
>>>
>>> ax.set_yticks([0.5])
>>> ax.set_yticklabels(["very long label"])
>>>
>>> make_axes_area_auto_adjustable(ax) # This is where axes_grid1
>>> comes in
>>>
>>> Then, the axes area(including ticklabels and axis label) will be
>>> automatically adjusted to fit in the given extent ([0, 0, 1, 1] in the
>>> above case).
>>>
>>> While this is mainly for a single axes plot, you may use it with
>>> multi-axes plot (but somewhat trickier to use). A few examples are
>>> included in the module.
>>>
>>> Regards,
>>>
>>> -JJ
>>>
>>
>> This thread is a few months old now, but I just wanted to mention that I
>> am using JJ's workaround (thanks!) in my app--with either one or two y
>> axes--and it is just excellent.
>>
>> This should definitely be at least an option for matplotlib users--the
>> quality of the appearance of the plots now is like night and day, because,
>> to me, seeing a plot without its axes labels (I'm talking about in a
>> resizable plot embedded in an application, not a static graph for inclusion
>> in a publication) is a *major* look and feel demerit.
>>
>> Che
>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Lotusphere 2011
>> Register now for Lotusphere 2011 and learn how
>> to connect the dots, take your collaborative environment
>> to the next level, and enter the era of Social Business.
>> http://p.sf.net/sfu/lotusphere-d2d
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
>
>
> --
> Daniel Hyams
> dh...@gm...
>
-- 
Daniel Hyams
dh...@gm...
From: C M <cmp...@gm...> - 2010年12月14日 19:13:40
On Thu, Sep 30, 2010 at 7:55 AM, Jae-Joon Lee <lee...@gm...> wrote:
> On Thu, Sep 23, 2010 at 10:31 AM, C M <cmp...@gm...> wrote:
> > Until a more permanent solution is figured out, can anyone recommend
> > any workarounds, even if they are a little clunky? I'm embedding mpl
> > plots in wxPython and am also finding this issue suboptimal.
> >
> > Che
> >
>
> A (partial) workaround is possible using the axes_grid1 toolkit (i.e.,
> you need matplotlib 1.0).
> Attached is a module I just cooked up (based on my previous attempt @
>
> http://www.mail-archive.com/mat...@li.../msg18129.html
> ),
> and it seems to work quite well.
> The usage is simple.
>
>
> ax = plt.axes([0,0,1,1])
>
> ax.set_yticks([0.5])
> ax.set_yticklabels(["very long label"])
>
> make_axes_area_auto_adjustable(ax) # This is where axes_grid1 comes
> in
>
> Then, the axes area(including ticklabels and axis label) will be
> automatically adjusted to fit in the given extent ([0, 0, 1, 1] in the
> above case).
>
> While this is mainly for a single axes plot, you may use it with
> multi-axes plot (but somewhat trickier to use). A few examples are
> included in the module.
>
> Regards,
>
> -JJ
>
This thread is a few months old now, but I just wanted to mention that I am
using JJ's workaround (thanks!) in my app--with either one or two y
axes--and it is just excellent.
This should definitely be at least an option for matplotlib users--the
quality of the appearance of the plots now is like night and day, because,
to me, seeing a plot without its axes labels (I'm talking about in a
resizable plot embedded in an application, not a static graph for inclusion
in a publication) is a *major* look and feel demerit.
Che
From: C M <cmp...@gm...> - 2010年12月14日 19:07:52
> It will work if you explicitly set its transform.
>
> star, = ax.plot([xdata[ind]], [ydata[ind]], '*',
> ms=40, mfc='y', mec='b',
> transform=thisline.get_transform())
>
>
JJ, thank you, this worked in my app as well.
> > I also use the identity of the picked line in my code, since I provide
> > additional information about that data series to the user based on which
> > line (and point) they picked. So if reparenting the line loses that
> > information, that's going to be a problem.
> >
>
> I believe that reparenting only changes the "axes" attribute of the
> line, so it might not be a problem.
>
Yes, it turns out it doesn't seem to cause any problem, which is great.
> > When I was using matplotlib 0.98.5.2, I had the same code as I have now,
> > with two different axes, and pick events were picked up on lines
> belonging
> > to either of the axes. Unless I'm misunderstanding, something has
> changed
> > and this used to be possible. Is that correct?
>
> Yes, I believe this used to be possible. While I'm not sure why it
> changed, I'm also not sure if we need to revert this change as I
> personally prefer the current simple behavior (although there could be
> a room for improvement). And I want to hear what others think. You may
> file a new feature request (or a bug if you want) issue regarding
> this.
>
I don't know if the other developers have weighed in on this in some other
forum or in personal communication, but as a user my vote is to keep the old
behavior. I don't know how much of a simplicity benefit the developer team
gets, but as a user I doubt I would have been able to figure out your
suggestions based on Matplotlib documentation alone, unless maybe I am
missing something. The previous way it worked strikes me as the
user-intuitive way; this new way requires you to move a line to an axis that
it doesn't match but then use its transform to "decode" what it really
should be (if I understand it about right). And then one has to do that for
every line. That seems complex from the user's perspective. Now that it is
all in place it is no problem, but getting here was tough and un-doable
without help. I guess I will file a feature request or bug report about it.
So thank you very much, JJ, for all your help on at least three key details
that massively improve the user experience of the app I am trying to put
together.
And thanks to John and the rest of the developers for Matplotlib!
Che
From: Michael D. <md...@st...> - 2010年12月14日 17:28:59
You can create an class to store these values with a method to handle 
the callback, eg. (untested code):
class KeyHandler:
 def __init__(self):
 self.ImageNumber = 0
 def OnKeyPress(self, event):
 self.ImageNumber += 1
key_handler = KeyHandler()
plt.connect('key_press_event', key_handler.OnKeyPress)
Mike
On 12/11/2010 07:24 PM, John wrote:
> Hi all,
> I have set up an event handler and function to perform actions when a
> user presses certain keys in the plot window. The function needs access
> to variables that are in the main function. How do I pass these
> variables to the function.
>
> In OnKeyPress, ImageNumber and Li are objects in the main program. Any
> ideas on how to pass them? Thanks
>
> plt.connect('key_press_event',OnKeyPress)
>
> def OnKeyPress(self,event):
> print 'button= ',event.key, event.xdata, event.ydata
> if event.key == 'm':
> ImageNumber = ImageNumber + 1
> if event.key == 'n':
> ImageNumber = ImageNumber - 1
>
> rawimage = Li.GetImage(ImageNumber)
> plt.imshow(rawimage)
> plt.title("Image number %3d" % (ImageNumber))
> plt.draw()
>
>
> ------------------------------------------------------------------------------
> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
> new data types, scalar functions, improved concurrency, built-in packages,
> OCI, SQL*Plus, data movement tools, best practices and more.
> http://p.sf.net/sfu/oracle-sfdev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: Michael D. <md...@st...> - 2010年12月14日 16:19:19
Only nearest and bilinear are supported for NonUniformImage.
As you suggested, due to a small bug, an exception was not being raised 
when the interpolation is not one of those two options. This has now 
been fixed in SVN.
Mike
On 12/13/2010 01:47 PM, Nicolas Bigaouette wrote:
> Hi all,
>
> I'm using matplotlib.image.NonUniformImage() to plot a 2D rectilinear 
> grid (non uniform spacing between points):
>
> im = matplotlib.image.NonUniformImage(grid, extent=extent,
> origin='lower', cmap = matplotlib.cm.jet, interpolation = "nearest")
>
> im.set_data(x, y, z)
>
> ax.images.append(im)
>
> ax.set_xlim(extent_x)
>
> ax.set_ylim(extent_z)
>
> I have tried using a different interpolation value as in imshow(), but 
> only "nearest" and "bilinear" gives expected results. All others 
> ('bicubic', 'spline16', 'spline36', 'hanning', 'hamming', 'hermite', 
> 'kaiser', 'quadric', 'catrom', 'gaussian', 'bessel', 'mitchell', 
> 'sinc' and 'lanczos') show garbage instead of my data.
>
> If the other interpolations are not implemented, there should be at 
> least an assert somewhere...
>
> Thanx
>
>
> ------------------------------------------------------------------------------
> Lotusphere 2011
> Register now for Lotusphere 2011 and learn how
> to connect the dots, take your collaborative environment
> to the next level, and enter the era of Social Business.
> http://p.sf.net/sfu/lotusphere-d2d
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
-- 
Michael Droettboom
Science Software Branch
Space Telescope Science Institute
Baltimore, Maryland, USA
From: gary r. <gr...@bi...> - 2010年12月14日 05:40:52
Thanks for the workaround JJ. I've filed a feature request,
Gary
On Mon, Dec 13, 2010 at 9:54 PM, Jae-Joon Lee <lee...@gm...> wrote:
> It seems that there is no option to change join and cap style for
> patches (only lines have them).
> While there could be other ways, one workaround is to use patheffect.
>
> Below is a modified version of your example.
>
> Meanwhile, I think the situation needs to be fixed, i.e., Patches
> should implement set_capstyle and set_joinstyle. Can you file a
> feature request on the tracker?
>
> Regards,
>
> -JJ
>
>
>
> import matplotlib.pyplot as plt
> from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
>
> from matplotlib.patheffects import Stroke
>
> def add_sizebar(ax, size):
> asb = AnchoredSizeBar(ax.transData,
>  size,
>  str(size),
>  loc=8,
>  pad=0.1, borderpad=0.5, sep=5,
>  frameon=False)
> ax.add_artist(asb)
>
> mypatch = asb.size_bar.get_children()[0]
> mypatch.set_path_effects([Stroke(joinstyle='miter',
>                 capstyle='butt')]) # override
> joinstyle and capstyle
>
> add_sizebar(plt.gca(), 0.5)
>
>
> plt.draw()
> plt.show()
>
>
>
>
> On Mon, Dec 13, 2010 at 9:16 AM, gary ruben <gr...@bi...> wrote:
>> Is it possible to control the join and cap styles of lines and
>> patches? Is there an example for this? I'm trying to add a scale
>> marker to a plot, but lines have rounded ends by default, so I'm
>> currently changing these manually in Inkscape to miter join and butt
>> cap. Here is a minimal example, based on the code here:
>>
>> import matplotlib.pyplot as plt
>> from mpl_toolkits.axes_grid1.anchored_artists import AnchoredSizeBar
>>
>> def add_sizebar(ax, size):
>> asb = AnchoredSizeBar(ax.transData,
>>   size,
>>   str(size),
>>   loc=8,
>>   pad=0.1, borderpad=0.5, sep=5,
>>   frameon=False)
>> ax.add_artist(asb)
>>
>> add_sizebar(plt.gca(), 0.5)
>>
>> plt.draw()
>> plt.show()
>>
>>
>> What I'd like is a 2pt wide line with butt-style cap ends,
>>
>> thanks,
>> Gary
>>
>> ------------------------------------------------------------------------------
>> Oracle to DB2 Conversion Guide: Learn learn about native support for PL/SQL,
>> new data types, scalar functions, improved concurrency, built-in packages,
>> OCI, SQL*Plus, data movement tools, best practices and more.
>> http://p.sf.net/sfu/oracle-sfdev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>
From: Xunchen L. <xun...@gm...> - 2010年12月14日 03:10:42
Hello,
I'm plotting some experimental data and found my x axis variable are
displayed like 1, 2, 3, +1000. It seems depend on how you set a stopper or
something.
I'm wondering how to make it display just 1001, 1002, 1003?
thanks!
From: Xunchen L. <xun...@gm...> - 2010年12月14日 02:58:53
Hello,
I'm plotting some experimental data and found my x axis variable are
displayed like 1, 2, 3, +1000. It seems depend on how you set a stopper or
something.
I'm wondering how to make it display just 1001, 1002, 1003?
thanks!

Showing 13 results of 13

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 によって変換されたページ (->オリジナル) /