SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

You can subscribe to this list here.

2003 Jan
Feb
Mar
Apr
May
Jun
Jul
Aug
Sep
Oct
(1)
Nov
(33)
Dec
(20)
2004 Jan
(7)
Feb
(44)
Mar
(51)
Apr
(43)
May
(43)
Jun
(36)
Jul
(61)
Aug
(44)
Sep
(25)
Oct
(82)
Nov
(97)
Dec
(47)
2005 Jan
(77)
Feb
(143)
Mar
(42)
Apr
(31)
May
(93)
Jun
(93)
Jul
(35)
Aug
(78)
Sep
(56)
Oct
(44)
Nov
(72)
Dec
(75)
2006 Jan
(116)
Feb
(99)
Mar
(181)
Apr
(171)
May
(112)
Jun
(86)
Jul
(91)
Aug
(111)
Sep
(77)
Oct
(72)
Nov
(57)
Dec
(51)
2007 Jan
(64)
Feb
(116)
Mar
(70)
Apr
(74)
May
(53)
Jun
(40)
Jul
(519)
Aug
(151)
Sep
(132)
Oct
(74)
Nov
(282)
Dec
(190)
2008 Jan
(141)
Feb
(67)
Mar
(69)
Apr
(96)
May
(227)
Jun
(404)
Jul
(399)
Aug
(96)
Sep
(120)
Oct
(205)
Nov
(126)
Dec
(261)
2009 Jan
(136)
Feb
(136)
Mar
(119)
Apr
(124)
May
(155)
Jun
(98)
Jul
(136)
Aug
(292)
Sep
(174)
Oct
(126)
Nov
(126)
Dec
(79)
2010 Jan
(109)
Feb
(83)
Mar
(139)
Apr
(91)
May
(79)
Jun
(164)
Jul
(184)
Aug
(146)
Sep
(163)
Oct
(128)
Nov
(70)
Dec
(73)
2011 Jan
(235)
Feb
(165)
Mar
(147)
Apr
(86)
May
(74)
Jun
(118)
Jul
(65)
Aug
(75)
Sep
(162)
Oct
(94)
Nov
(48)
Dec
(44)
2012 Jan
(49)
Feb
(40)
Mar
(88)
Apr
(35)
May
(52)
Jun
(69)
Jul
(90)
Aug
(123)
Sep
(112)
Oct
(120)
Nov
(105)
Dec
(116)
2013 Jan
(76)
Feb
(26)
Mar
(78)
Apr
(43)
May
(61)
Jun
(53)
Jul
(147)
Aug
(85)
Sep
(83)
Oct
(122)
Nov
(18)
Dec
(27)
2014 Jan
(58)
Feb
(25)
Mar
(49)
Apr
(17)
May
(29)
Jun
(39)
Jul
(53)
Aug
(52)
Sep
(35)
Oct
(47)
Nov
(110)
Dec
(27)
2015 Jan
(50)
Feb
(93)
Mar
(96)
Apr
(30)
May
(55)
Jun
(83)
Jul
(44)
Aug
(8)
Sep
(5)
Oct
Nov
(1)
Dec
(1)
2016 Jan
Feb
Mar
(1)
Apr
May
Jun
(2)
Jul
Aug
(3)
Sep
(1)
Oct
(3)
Nov
Dec
2017 Jan
Feb
(5)
Mar
Apr
May
Jun
Jul
(3)
Aug
Sep
(7)
Oct
Nov
Dec
2018 Jan
Feb
Mar
Apr
May
Jun
Jul
(2)
Aug
Sep
Oct
Nov
Dec
S M T W T F S



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

Showing 6 results of 6

From: Anton A. <ant...@gm...> - 2012年08月27日 19:24:10
Michael Droettboom <mdroe@...> writes:
> 
> On 08/26/2012 05:33 AM, Anton Akhmerov wrote:
> > Michael Droettboom <mdroe@...> writes:
> >
> >>
> >> 
> >> Working with the documentation this past week has me a little
> >> frustrated with the state of it. Enough to write a MEP.
> > https://github.com/matplotlib/matplotlib/wiki/Mep10
> >> In particular, it would be nice to compile a list of concerns about
> >> the docstrings and documentation layout so that we can address as
> >> much as possible in a single pass. Also, let me know if there are
> >> any relevant PRs and Issues.
> >> In particular, I think PR #1032, as it is a large structural
> >> reorganization, my dovetail well with the proposed reorganization of
> >> the docs.
> >> Mike
> > The proposal looks great. I would like to comment on one issue that it 
touches,
> > and which I found very uncomfortable to work with as a newcomer. I think 
that
> > matplotlib style of using *args and **kwargs for delegation of arguments is 
a
> > rather bad practice, which is hard to solve by just updating documentation. 
It
> > breaks many rules of pep 20: it is implicit, since it is not allowing
> > introspection, it is nested, since it always involves nested calls, it 
allows
> > for alternative ways to do things, and I also don't think it's anyhow 
beautiful.
> > Most of the things passed with *args, **kwargs can be done with an added
> > function call, like:
> >
> > points = ax.scatter(data)
> > points.update(*args, **kwargs)
> >
> > What would be the disadvantage of abolishing this practice?
> >
> I understand the comments about the difficulty of introspection. The 
> reason it works the way it does is so that additional parameters can be 
> added to the artist layer without needing to update every single 
> plotting function. A real world example of this is when hatching was 
> added -- that feature only had to be added in one place and most artists 
> were able to use it. In that sense, I think this approach is very 
> beautiful in terms of code maintainability and extensibility.
First of all, to be clear, I am not trying to be negative about the current 
situation, I rather search for ways to improve on it. I also realize that any 
changes like this would be very serious and require a lot of thinking and of 
course work. Let me first point some drawbacks of the current kwargs usage 
before discussing the solution. Let me know if you agree.
1. Currenly the aims of extensibility and maintainability are not completely 
reached, as seen from this part of Axes.scatter docstring:
 Optional kwargs control the
 :class:`~matplotlib.collections.Collection` properties; in
 particular:
 *edgecolors*:
 The string 'none' to plot faces with no outlines
 *facecolors*:
 The string 'none' to plot unfilled outlines
So the explicit descriptions of useful **kwargs are provided. If a new useful 
property of collections appears, it stays unknown.
2. Yet another problem that **kwargs cause is that it is sometimes completely 
unclear where an argument ends up. `Axes` methods have a reasonably well-
documented kwargs, while, e.g. axis module often fails to mention what happens 
to kwargs. Another example of misuse is figure.add_axes, where the docstring 
declares:
"""...kwargs are legal Axes kwargs plus projection which sets the projection 
type of the axes. (For backward compatibility, polar=True may also be provided, 
which is equivalent to projection='polar'). Valid values for projection are: 
[‘aitoff’, ‘hammer’, ‘lambert’, ‘mollweide’, ‘polar’, ‘rectilinear’]. Some of 
these projections support additional kwargs, which may be provided to 
add_axes()."""
Despite this is an extensible interface, I still wouldn't call it user-friendly; 
kwargs are passed to at least two places: Axes and projection.
3. About the hatching: I think this is solved in a rather elegant fashion with 
symbols for scatter plot: the interpretation of the format is deferred to 
`mmarkers.MarkerStyle(marker)`. This means that `marker` is in fact already 
effectively a style object, corresponding to the style object format that you 
suggested. One can also easily refer to the MarkerStyle docstring in order to 
make the description complete.
4. The idea behind kwargs, if I understand it correctly, is to let high-level 
functions, such as all the plot functions handle low-level objects in full 
generality. This aim cannot be achieved anyway, because high-level functions 
often generate more than one low-level object. This is why something like this:
axis.label.set_text(r"$\theta = 60^{\circ}$")
Is still provided as a separate command, and cannot be done via kwargs to 
scatter. So the user already doesn't have a situation where a single function 
call is sufficient.
---------------------
These altogether seem serious enough to consider changing the behavior in one or 
another way. They are often also directly related to documentation quality.
Best,
Anton
From: Michael W. <miw...@us...> - 2012年08月27日 19:21:19
> Michael,
>
> Thank you, this sounds good. Although we can deal with it as a patch if
> necessary, it would be greatly preferable to see it as a github PR:
> http://matplotlib.sourceforge.net/devel/gitwash/git_development.html#git-development
>
> Are you willing to give that a try?
>
> Eric
Yes i suppose so. Give me a couple of days. I will post a note when done.
cheers,
Michael
From: Phil E. <pel...@gm...> - 2012年08月27日 18:48:26
>>> right angles are no longer right angles: noob error. Apologies.
Forgiven; on the basis that you provided such an entertainingly colourful
initial report! :-)
From: Damon M. <dam...@gm...> - 2012年08月27日 17:35:02
On Mon, Aug 27, 2012 at 01:26:49PM -0400, Michael Droettboom wrote:
> I'm not sure this is a bug. The transformation is being applied in data 
> space, and then the mapping to physical space is not square in the x and 
> y dimensions.
> 
> I think calling set_aspect('equal') on the axes should fix this -- if it 
> doesn't, that's indeed a bug.
>
Awesome, it worked. Honestly, I probably should have realised that when
you don't have square axes, right angles are no longer right angles:
noob error. Apologies.
> 
> Mike
> 
> On 08/27/2012 01:05 PM, Damon McDougall wrote:
> > My cherubs,
> >
> > With my new found free time, I may have discovered a sneaky bug to which
> > you are not aware. Unless, of course, my example code is incorrect.
> >
> > I do normal setup:
> >
> > from matplotlib.backends.backend_pdf import FigureCanvasPdf as FigureCanvas
> > from matplotlib.figure import Figure
> > from matplotlib.patches import Rectangle
> > from matplotlib.transforms import Affine2D
> >
> > fig = Figure()
> > canvas = FigureCanvas(fig)
> > ax = fig.add_subplot(1, 1, 1)
> >
> > # Make a sexy rectangle at the origin
> > r = Rectangle((0.0, 0.0), 0.6, 0.4)
> >
> > # Construct a mind-blowing transformation: rotation by 30 degrees
> > t = Affine2D().rotate_deg(30.0)
> >
> > # Make sure to add in the already-known axes data transformation
> > t += ax.transData
> >
> > # Rotate that shizzle
> > r.set_transform(t)
> >
> > # Plottify
> > ax.add_patch(r)
> >
> > fig.savefig('my_awesome_TRAPEZIUM.pdf')
> >
> > Or you can look at my output here: http://i.imgur.com/2l439.png
> >
> > Rotation by 30 degrees is an angle-preserving linear transformation. So
> > this shouldn't happen.
> >
> > Here's what's messing shiz up: the figure dimensions are not square.
> > Look what happens when I use a square figure and make the axes fit
> > exactly to the figure dimensions:
> >
> > ...
> > fig = Figure((4, 4))
> > ...
> > ax = fig.add_axes([0, 0, 1, 1])
> > ...
> > ...
> > fig.savefig('my_awesome_RECTANGLE.pdf')
> >
> > You can see the output here: http://i.imgur.com/baXiH.png
> >
> > Boom.
> >
> > I have no idea how to fix it. I came across it while trying to address
> > https://github.com/matplotlib/matplotlib/issues/987 but it may or may
> > not also be related to
> > https://github.com/matplotlib/matplotlib/issues/1113
> >
> > Let me know if it's worth putting in github issue. I'm dont want to
> > create a duplicate ticket should it transpire that this problem is
> > actually #1113 in disguise.
> >
> > Best,
> > Damon
> >
> 
> 
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and 
> threat landscape has changed and how IT managers can respond. Discussions 
> will include endpoint security, mobile security and the latest in malware 
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Michael D. <md...@st...> - 2012年08月27日 17:26:59
I'm not sure this is a bug. The transformation is being applied in data 
space, and then the mapping to physical space is not square in the x and 
y dimensions.
I think calling set_aspect('equal') on the axes should fix this -- if it 
doesn't, that's indeed a bug.
Mike
On 08/27/2012 01:05 PM, Damon McDougall wrote:
> My cherubs,
>
> With my new found free time, I may have discovered a sneaky bug to which
> you are not aware. Unless, of course, my example code is incorrect.
>
> I do normal setup:
>
> from matplotlib.backends.backend_pdf import FigureCanvasPdf as FigureCanvas
> from matplotlib.figure import Figure
> from matplotlib.patches import Rectangle
> from matplotlib.transforms import Affine2D
>
> fig = Figure()
> canvas = FigureCanvas(fig)
> ax = fig.add_subplot(1, 1, 1)
>
> # Make a sexy rectangle at the origin
> r = Rectangle((0.0, 0.0), 0.6, 0.4)
>
> # Construct a mind-blowing transformation: rotation by 30 degrees
> t = Affine2D().rotate_deg(30.0)
>
> # Make sure to add in the already-known axes data transformation
> t += ax.transData
>
> # Rotate that shizzle
> r.set_transform(t)
>
> # Plottify
> ax.add_patch(r)
>
> fig.savefig('my_awesome_TRAPEZIUM.pdf')
>
> Or you can look at my output here: http://i.imgur.com/2l439.png
>
> Rotation by 30 degrees is an angle-preserving linear transformation. So
> this shouldn't happen.
>
> Here's what's messing shiz up: the figure dimensions are not square.
> Look what happens when I use a square figure and make the axes fit
> exactly to the figure dimensions:
>
> ...
> fig = Figure((4, 4))
> ...
> ax = fig.add_axes([0, 0, 1, 1])
> ...
> ...
> fig.savefig('my_awesome_RECTANGLE.pdf')
>
> You can see the output here: http://i.imgur.com/baXiH.png
>
> Boom.
>
> I have no idea how to fix it. I came across it while trying to address
> https://github.com/matplotlib/matplotlib/issues/987 but it may or may
> not also be related to
> https://github.com/matplotlib/matplotlib/issues/1113
>
> Let me know if it's worth putting in github issue. I'm dont want to
> create a duplicate ticket should it transpire that this problem is
> actually #1113 in disguise.
>
> Best,
> Damon
>
From: Damon M. <dam...@gm...> - 2012年08月27日 17:05:19
My cherubs,
With my new found free time, I may have discovered a sneaky bug to which
you are not aware. Unless, of course, my example code is incorrect.
I do normal setup:
from matplotlib.backends.backend_pdf import FigureCanvasPdf as FigureCanvas
from matplotlib.figure import Figure
from matplotlib.patches import Rectangle
from matplotlib.transforms import Affine2D
fig = Figure()
canvas = FigureCanvas(fig)
ax = fig.add_subplot(1, 1, 1)
# Make a sexy rectangle at the origin
r = Rectangle((0.0, 0.0), 0.6, 0.4)
# Construct a mind-blowing transformation: rotation by 30 degrees
t = Affine2D().rotate_deg(30.0)
# Make sure to add in the already-known axes data transformation
t += ax.transData
# Rotate that shizzle
r.set_transform(t)
# Plottify
ax.add_patch(r)
fig.savefig('my_awesome_TRAPEZIUM.pdf')
Or you can look at my output here: http://i.imgur.com/2l439.png
Rotation by 30 degrees is an angle-preserving linear transformation. So
this shouldn't happen.
Here's what's messing shiz up: the figure dimensions are not square.
Look what happens when I use a square figure and make the axes fit
exactly to the figure dimensions:
...
fig = Figure((4, 4))
...
ax = fig.add_axes([0, 0, 1, 1])
...
...
fig.savefig('my_awesome_RECTANGLE.pdf')
You can see the output here: http://i.imgur.com/baXiH.png
Boom.
I have no idea how to fix it. I came across it while trying to address
https://github.com/matplotlib/matplotlib/issues/987 but it may or may
not also be related to
https://github.com/matplotlib/matplotlib/issues/1113
Let me know if it's worth putting in github issue. I'm dont want to
create a duplicate ticket should it transpire that this problem is
actually #1113 in disguise.
Best,
Damon
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

Showing 6 results of 6

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