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

Showing 14 results of 14

From: Stephen G. <ste...@op...> - 2009年07月13日 23:01:40
Hi Christoph,
Sorry for my delay to get back to you.
The svn version seems to work fine with GTK support, at least my 
application had no problems running
The versions I tested with are as follows:
 python version: 2.6.0 final 0
 numpy version: 1.3.0
 matplotlib version: 0.98.6svn
 gtk+ version: 2.16.2
 pyGTK version: 2.12.1
Thank you
you have been a big help
Steve
Christoph Gohlke wrote:
> Hi Steve,
>
> matplotlib-0.98.5.3.win32-py2.6.exe was compiled without support for GTK.
>
> If you don't mind trying, I have a build of the matplotlib trunk 
> available on my homepage that has GTK support enabled:
>
> http://www.lfd.uci.edu/~gohlke/#pythonlibs
>
> It should work with the PyGTK 2.12 Windows binaries from 
> http://www.pygtk.org/downloads.html.
>
> SVG support seems broken: the window.set_icon_from_file() function in 
> backend_gtk.py will raise an exception, not recognizing SVG files. The 
> PNG icon works.
>
> Christoph
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge 
> This is your chance to win up to 100,000ドル in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have 
> the opportunity to enter the BlackBerry Developer Challenge. See full prize 
> details at: http://p.sf.net/sfu/blackberry
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
> 
From: Johann Cohen-T. <co...@lp...> - 2009年07月13日 21:59:37
import numpy as np
import matplotlib.pylab as plt
ROIS=["1.0","0.9","0.8","0.7","0.6","0.5","0.4","0.3","0.2","0.1"]
EMINS=["100","125","150","175","200","250","300","500","700","1000"]
d=np.array([81.820974990633303,
82.905629922471107,
79.590599078715002,
83.8076661158848,
84.340371447361704,
86.470741120340406,
86.325669295272604,
78.547789147572104,
61.234561761417801,
42.336057180561099,
79.452456461883799,
78.886459859281402,
76.101705425124905,
81.152956140890893,
79.325736080403303,
81.869315277384999,
82.334627586818499,
80.751043622934901,
63.687981070736697,
42.336057180561099,
81.561434110553193,
81.733934887474803,
77.281383826158105,
81.735026440126006,
78.759069413428506,
83.011430606978095,
83.1028280527253,
84.831802384752606,
70.310404261509206,
42.336057180561099,
79.049391539046098,
80.359440097576794,
77.772159524822001,
83.654958151325204,
79.578518689189593,
83.313224279315094,
85.904971250263898,
88.016057678182506,
72.556205760527106,
43.079858727017502,
74.014083853922003,
74.991828576951406,
72.176483952900597,
79.931150578720604,
76.810283824455198,
81.319067727368093,
82.606434816726093,
79.296669680086296,
67.530619223090795,
43.830850940183701,
78.570285512017804,
80.011420916551302,
78.048745087146898,
85.986292098240298,
83.757389242109198,
85.399220867247493,
84.378739151586601,
83.838909509599304,
72.219496155423101,
54.667696386193299,
64.771390756530494,
65.179725530642799,
65.901293578971206,
70.324974696479799,
68.229487152871201,
69.183487824467093,
72.191878118072495,
75.809844472900906,
64.968437827963001,
54.162402578714399,
57.958372971901703,
57.342923745772502,
58.459763976540003,
61.621347971812597,
56.633079601774597,
56.443549659648298,
55.463724005796699,
57.973081450418903,
48.107631297574798,
40.4952182396881,
46.761865533859897,
47.869196203907997,
47.310621469889,
47.7642158774199,
45.1306027800862,
49.647667752226802,
47.310281669050198,
48.629496015722999,
40.947773761156398,
33.032212415148798,
27.819471401269102,
28.166844457481599,
26.861003210437801,
27.875138576975701,
26.295879497460898,
31.165730874019399,
29.333496744941801,
35.518932552857997,
34.476676188903603,
30.448752651955001])
d.resize(len(EMINS),len(ROIS))
plt.pcolor(d)
.... and now I would like to have EMINS and ROIS values labelling each 
"pixel" or each square of the checkerboard if you prefer.....
thanks a lot for your help.
Johann
From: Johann Cohen-T. <co...@lp...> - 2009年07月13日 21:26:10
the example works very well, but what I have is 10 numbers that I want 
to put in between 11 ticks. Actually what I havve is a checkerboard 
(using pcolor) and I want to label the X and Y of each pixel....
and now I am confused with the API to do that... The example uses 
objects that can provide Locator and Formatter instances, but I just 
have a sequence of numbers....
Johann
Johann Cohen-Tanugi wrote:
> thanks a lot!
> Johann
>
> John Hunter wrote:
> 
>> On Sat, Jul 11, 2009 at 1:15 PM, Eric Firing<ef...@ha...> wrote:
>> 
>> 
>>> John Hunter wrote:
>>> 
>>> 
>>>> On Thu, Jul 9, 2009 at 9:44 AM, Johann Cohen-Tanugi<co...@lp...>
>>>> wrote:
>>>> 
>>>> 
>>>>> Hello, how can I center axis tick labels, so that the labels ends up at
>>>>> the center between 2 ticks.
>>>>>
>>>>> 
>>>>> 
>>>> There is no support for this, though you can left or right align a
>>>> label with a single tick::
>>>>
>>>> for label in ax.xaxis.get_xticklabels():
>>>> label.set_horizontalalignment('right')
>>>>
>>>> JDH
>>>> 
>>>> 
>>> Labels for intervals rather than ticks would be nice to have; this is
>>> commonly used for labeling months or years, for example. I don't have time
>>> to work on it now, unfortunately.
>>>
>>> The best way to fake it with present facilities might be to use no labels on
>>> the major ticks, place minor ticks half-way between the majors, set their
>>> lengths to zero, and label them.
>>> 
>>> 
>> Nice idea, just committed this example to svn as
>> examples/pylab_examples/centered_ticklabels.py
>>
>> import datetime
>> import numpy as np
>> import matplotlib
>> import matplotlib.dates as dates
>> import matplotlib.ticker as ticker
>> import matplotlib.pyplot as plt
>>
>> # load some financial data; apple's stock price
>> fh = matplotlib.get_example_data('aapl.npy')
>> r = np.load(fh); fh.close()
>> r = r[-250:] # get the last 250 days
>>
>> fig = plt.figure()
>> ax = fig.add_subplot(111)
>> ax.plot(r.date, r.adj_close)
>>
>> ax.xaxis.set_major_locator(dates.MonthLocator())
>> ax.xaxis.set_minor_locator(dates.MonthLocator(bymonthday=15))
>>
>> ax.xaxis.set_major_formatter(ticker.NullFormatter())
>> ax.xaxis.set_minor_formatter(dates.DateFormatter('%b'))
>>
>> for tick in ax.xaxis.get_minor_ticks():
>> tick.tick1line.set_markersize(0)
>> tick.tick2line.set_markersize(0)
>> tick.label1.set_horizontalalignment('center')
>>
>> imid = len(r)/2
>> ax.set_xlabel(str(r.date[imid].year))
>> plt.show()
>> 
>> 
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge 
> This is your chance to win up to 100,000ドル in prizes! For a limited time, 
> vendors submitting new applications to BlackBerry App World(TM) will have
> the opportunity to enter the BlackBerry Developer Challenge. See full prize 
> details at: http://p.sf.net/sfu/Challenge
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
From: Uri L. <las...@mi...> - 2009年07月13日 20:56:43
Hi everyone,
I am trying to create some brand new types of plots for a unique data set
that I have. My question basically boils down to getting some advice on
what is the proper way to set up a function that will act like one of the
matplotlib pyplot functions (e.g., have all the same behavior regarding
interactive stuff, resizing, etc.).
I have been looking through some of the code for the major functions like
plot, but have been having trouble parsing it. I think that some of this is
obfuscated in the complexity of the functions.
At some level, I would also like to be able to draw on the canvas in a very
explicit way, like in Processing (http://processing.org/); what is the best
way to approach this?
Another thing that could be really nice is to have some boilerplate
framework that someone could start with to quickly write functions that
integrate well into the rest of matplotlib.
(And sorry if I am sounding critical of the package. I actually love it,
and have been quite the MPL evangelist in my little section of Boston.)
Any suggestions are welcome.
Uri
-- 
Uri Laserson
PhD Candidate, Biomedical Engineering
Harvard Medical School (Genetics)
Massachusetts Institute of Technology (Mathematics)
phone +1 917 742 8019
las...@mi...
From: Chloe L. <ch...@na...> - 2009年07月13日 20:38:43
If your collection of points is a numpy array, you can use the column 
of y-coordinates as the first argument to the plotting function 
hlines. E.g, inside ipython --pylab:
ptn = array(([1,1],[3,1],[2,4],[4,4]))
hlines(ptn[:,1], -1, 1)	
But at that point the horizontal lines are on the edges of the axis, 
not visible. This forces them to show:
plot([-1, 0, 1],[0.5, 2.5, 4.5])
but perhaps you only want the hlines. What I usually do in a script or 
function is name all my axes and twiddle their limits in an aesthetic 
way, but in ipython the following isn't redrawing the plot, for me:
a = gca()
curlims = a.get_ylim()			
a.set_ylim([curlims[0] - 0.1, curlims[1] + 0.1])
half-finished, but I hope it helps,
&C
On Jul 13, 2009, at 13 Jul, 11:56 AM, Afi Welbeck wrote:
> Hi,
>
> I'm a newbie, and I'm trying to plot horizontal
> lines with the following points:
> [1,1], [3,1], [2,4] and [4,4].
>
> Also, is there a way of putting them together in
> lists, (say the pair of points that plot one horizontal line )
> for easy plotting? Could anyone please help me with the
> code? Thanks.
>
> Regards,
> Harriet A. Welbeck
>
>
> ------------------------------------------------------------------------------
> Enter the BlackBerry Developer Challenge
> This is your chance to win up to 100,000ドル in prizes! For a limited 
> time,
> vendors submitting new applications to BlackBerry App World(TM) will 
> have
> the opportunity to enter the BlackBerry Developer Challenge. See 
> full prize
> details at: http://p.sf.net/sfu/Challenge_______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
Chloe Lewis
Graduate student, Amundson Lab
Division of Ecosystem Sciences, ESPM
University of California, Berkeley
137 Mulford Hall - #3114
Berkeley, CA 94720-3114
ch...@na...
From: Jeff W. <js...@fa...> - 2009年07月13日 20:11:52
Robert Cimrman wrote:
> Hi all,
>
> I would like to use griddata() to interpolate a function given at 
> specified points of a bunch of other points. While the method works 
> well, it slows down considerably as the number of points to 
> interpolate to increases.
>
> The dependence of time/(number of points) is nonlinear (see the 
> attachment) - it seems that while the Delaunay trinagulation itself is 
> fast, I wonder how to speed-up the interpolation. The docstring says, 
> that it is based on "natural neighbor interpolation" - how are the 
> neighbors searched? Does it use the kd-trees like scipy.spatial? I 
> have a very good experience with scipy.spatial performance.
>
> Also, is there a way of reusing the triangulation when interpolating 
> several times using the same grid?
>
> cheers,
> r.
Robert: The griddata function uses the delaunay module, which is a 
straight copy of Robert Kern's delaunay scikit. No one here is that 
familiar with the internals of delaunay, so I'd suggest you either ask 
Robert, or dig into the source code yourself (which is here: 
http://scipy.org/scipy/scikits/browser/trunk/delaunay).
-Jeff
-- 
Jeffrey S. Whitaker Phone : (303)497-6313
Meteorologist FAX : (303)497-6449
NOAA/OAR/PSD R/PSD1 Email : Jef...@no...
325 Broadway Office : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web : http://tinyurl.com/5telg
From: Sandro T. <mo...@de...> - 2009年07月13日 19:24:26
Hi all,
as you might know, I'm writing a book about matplotlib. I'm
approaching the last chapter, the one I would have liked to dedicate
to "science".
Editors and I, anyhow, decided it would have been too much off-topic
for the public we are targetting, so we have instead decided to
present a series of "real world use cases" for matplotlib, situations
where graphing can be useful. Some examples could be:
- plot data from a database
- read a csv and plot its data
- webscraping to plot info on a webpage
give the wide spectrum of category I can cover, I'd like to introduce
some "scientific" examples, something every reader (and not
specifically a math/phys guy can only) can read, understand and (avove
all) appreciate :) .
I'm thinking for example at line interpolation (generate some points
and find the line/curve that better interpolate them).
But what I'd like is to hear from you what "simple" example you'd like
to propose to be in this book.
Your collaboration would be really appreciate, because it will let the
book be more "user driven" :)
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Afi W. <wel...@ya...> - 2009年07月13日 18:56:53
Hi,
I'm a newbie, and I'm trying to plot horizontal
lines with the following points: 
[1,1], [3,1], [2,4] and [4,4]. 
Also, is there a way of putting them together in
lists, (say the pair of points that plot one horizontal line )
for easy plotting? Could anyone please help me with the
code? Thanks.
Regards,
Harriet A. Welbeck
 
From: Robert C. <cim...@nt...> - 2009年07月13日 18:39:18
Attachments: times.png
Hi all,
I would like to use griddata() to interpolate a function given at 
specified points of a bunch of other points. While the method works 
well, it slows down considerably as the number of points to interpolate 
to increases.
The dependence of time/(number of points) is nonlinear (see the 
attachment) - it seems that while the Delaunay trinagulation itself is 
fast, I wonder how to speed-up the interpolation. The docstring says, 
that it is based on "natural neighbor interpolation" - how are the 
neighbors searched? Does it use the kd-trees like scipy.spatial? I have 
a very good experience with scipy.spatial performance.
Also, is there a way of reusing the triangulation when interpolating 
several times using the same grid?
cheers,
r.
ps: no natgrid
In [9]: mpl.__version__
Out[9]: '0.98.5.3'
From: Davide S. <dav...@gm...> - 2009年07月13日 12:00:36
ehm ehm... maybe bar() ? :-)
-- 
Davide Setti
blog: http://blog.flatlandia.eu
home: http://www.flatlandia.eu
From: Davide S. <dav...@gm...> - 2009年07月13日 11:57:55
Hi all,
i need to plot an histogram from already calculated data. I think an
example can be helpful :-)
I have a list:
[ (22, 0),
 (19, 1),
 (15, 0),
 ...
]
while in each tuple the first number is the height of the bar (the
first bar has value 22, the second has value 19...) the second is the
"group". I wish to plot every column in a different color, but i think
i know how to do this.
What i'm not able to do is to plot the histogram in log-log scale,
because hist() groups the values into bins, while with vlines i'm not
able to set the proper line width with the log scale.
Suggestions?
Thanks
-- 
Davide Setti
blog: http://blog.flatlandia.eu
home: http://www.flatlandia.eu
From: vehemental <jim...@gm...> - 2009年07月13日 11:50:40
Let me give some results of experience regarding these issues....
On the same dataset of 600 *7500 points, with the simple plot function,
(from the example, embedding in wxagg)
WxAgg was much faster than Wx... on a linux machine, while the WxAgg drawing
appeared close to a second or 2 after launch..., the Wx drawing was
displayed after 20 seconds. Same on Windows...
Same pattern for GTK vs GTKAgg, though less dramatic...
In a small app I wrote, containing 5 plotting windows (each containing
around 500 datapoints)
on linux, GTK take 1.2 - 1.3 sec to update the plots...GTKAgg took 0.7 - 0.8
sec...
on windows, the difference is even larger, GTK is in average 3 times slower
than GtKAgg...
As for direct comparisons between TkAgg, GTKAgg, WxAgg... it's a bit tricky
to time this stuff properly, so it's only my feelings that said that there
was no extraordinary performance difference between the different backends
(on the same datasets 600*7500 points). They pretty much felt the same, only
thing is TkAgg having drawing problems when busy and the window being
manipulated... 
jimmy
>
> There is some detail along these lines at
>
> http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
>
> but not the feature-by-feature comparison you suggest. But for WX vs
> WXAgg, definitely WXAgg.
>
It would be really nice to have some info regarding "speed".
I don't know if one has to distinguish let's say the time it take to
draw a line with 100k points and the "general" felling of interactive
responsiveness !?
(E.g. I thought that wx was much faster than wxAgg ... just uglier )
-
Sebastian Haase
------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge 
This is your chance to win up to 100,000ドル in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize 
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Matplotlib-users mailing list
Mat...@li...
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-- 
View this message in context: http://www.nabble.com/Backend-Comparison-tp24444974p24460335.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Eli B. <eb...@gm...> - 2009年07月13日 01:13:01
The problem is gone after upgrade to 0.98.5
On Sat, Jul 11, 2009 at 6:02 PM, Eli Brosh <eb...@gm...> wrote:
> My version is 0.98.3
> This is what comes with ubuntu intrepid.
> I will try to upgrade from svn.
>
> Eli
>
>
> On Sat, Jul 11, 2009 at 4:15 PM, John Hunter <jd...@gm...> wrote:
>
>> On Sat, Jul 11, 2009 at 6:06 AM, Eli Brosh<eb...@gm...> wrote:
>> > Hello,
>> > I encountered a problem when trying to draw a legend outside the axes.
>> > For some reason, when the legend is placed outside the axes, the markers
>> are
>> > not drawn near the labels.
>> >
>> > I attach two scripts and two corresponding figures.
>> > the only differences between the scripts is the location of the legend.
>> > When the legend is placed inside the axes, everything is OK.
>> > However, when the legend is outside the markers are gone.
>> >
>> > Is this a bug ?
>> > Is there a way around it ?
>>
>> I am not seeing this problem in mpl svn (what version are you using).
>> perhaps you can upgrade to svn?
>>
>> http://matplotlib.sourceforge.net/faq/installing_faq.html#install-from-svn
>>
>> JDH
>>
>
>
From: Eli B. <eb...@gm...> - 2009年07月13日 01:09:40
Thanks John,
Sorry, this is too heavy for my programming skills.
I hope to be able to contribute some time later.
Eli
On Sat, Jul 11, 2009 at 7:55 PM, John Hunter <jd...@gm...> wrote:
> On Sat, Jul 11, 2009 at 9:55 AM, Eli Brosh<eb...@gm...> wrote:
> > Thanks John,
> > A kwarg fillstyle with options 'full|top|bottom|left|right' for any
> marker
> > is certainly better than what i have done.
> > I just did not have an idea how to program this kwarg.
> > Further, I can't see an easy way of generalizing the half-filling of
> > markers.
> > is there a better way than just programming each half-filled marker
> > separately ?
> > Perhaps if you can give me some hints, I can try to do the rest of the
> work.
>
>
> Sure, first take a look at the coding guide, in particular these two
> sections which introduce kwarg processing and documentation
> conventions.
>
>
> http://matplotlib.sourceforge.net/devel/coding_guide.html#keyword-argument-processing
>
> http://matplotlib.sourceforge.net/devel/coding_guide.html#documentation-and-docstrings
>
> Basically, any new "property", where I use quotes because mpl
> properties are not the same as python properties, needs a setter and
> getter. The setter must also have an ACCEPTS flag, which gives the
> acceptable arguments. mpl uses these in the setp and getp
> introspection facilities, as well as in the auto-table building of
> kwargs in the docs. The artist.ArtistInspector is used to insepct the
> functions and docs to extract the properties:
>
> http://matplotlib.sourceforge.net/api/artist_api.html#matplotlib.artist.ArtistInspector
>
>
>
> I've committed a patch to svn that implements the fillstyle property
> for Line2D, and implemented it for draw_square. The other filled
> markers raise a NotImplementedError if the fillstyle is not 'full',
> and that is where you come in. The basic implementation is to draw
> two half markers, one filled and one unfilled, and use the rotation
> property of the transformation to support the various
> left|right|bottom|top. Here is the reference implementation for
> draw_square::
>
> def _draw_square(self, renderer, gc, path, path_trans):
> gc.set_snap(renderer.points_to_pixels(self._markersize) >= 2.0)
> side = renderer.points_to_pixels(self._markersize)
> transform = Affine2D().translate(-0.5, -0.5).scale(side)
> rgbFace = self._get_rgb_face()
> fs = self.get_fillstyle()
> if fs=='full':
> renderer.draw_markers(gc, Path.unit_rectangle(), transform,
> path, path_trans, rgbFace)
> else:
> # build a bottom filled square out of two rectangles, one
> # filled. Use the rotation to support left, right, bottom
> # or top
> if fs=='bottom': rotate = 0.
> elif fs=='top': rotate = 180.
> elif fs=='left': rotate = 270.
> else: rotate = 90.
>
> bottom = Path([[0.0, 0.0], [1.0, 0.0], [1.0, 0.5], [0.0,
> 0.5], [0.0, 0.0]])
> top = Path([[0.0, 0.5], [1.0, 0.5], [1.0, 1.0], [0.0,
> 1.0], [0.0, 0.05]])
> transform = transform.rotate_deg(rotate)
> renderer.draw_markers(gc, bottom, transform,
> path, path_trans, rgbFace)
> renderer.draw_markers(gc, top, transform,
> path, path_trans, None)
>
>
> See examples/pylab_examples/fillstyle_demo.py in svn, and the attached
> patch (although this is already committed, it might be instructional
> so you can see the steps needed to add a new property). When you
> finish the others, send along an svn diff and some more examples in
> the fillstyle_demo and I'll commit it.
>
> Thanks!
> JDH
>

Showing 14 results of 14

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