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

Showing 9 results of 9

From: John H. <jdh...@ac...> - 2006年03月30日 23:52:22
>>>>> "Malte" == Malte Marquarding <Mal...@cs...> writes:
 Malte> You are looking for matplotlib.axes.Subplot.set_position
That will work, but what you are really looking for is to not use
subplot at all, but rather axes; a Subplot is just an Axes that happens
to lie on a regular grid
 axes_top = fig.add_axes([0.1, 0.3, 0.8, 0.6])
 axes_bottom = fig.add_axes([0.1, 0.1, 0.8, 0.15])
If you want the two axes to touch and share and xaxis, see
examples/ganged_plots.py. There are nice tricks you can do to share
an xaxis so for example when you pan/zoom in one the xaxis in both
plots move together; see examples/shared_axis_demo.py
JDH
From: Malte M. <Mal...@cs...> - 2006年03月30日 23:42:20
You are looking for
matplotlib.axes.Subplot.set_position
set_position(self, pos) method of matplotlib.axes.Subplot instance
 Set the axes position with pos = [left, bottom, width, height]
 in relative 0,1 coords
 ACCEPTS: len(4) sequence of floats
axes_top.set_position([left, bottom, width, height])
etc.
On Friday 31 March 2006 08:38, Andrew B. Young wrote:
> Hello:
>
> How does one go about controlling the size of a subplot?
> I've got--
>
> figure = matplotlib.pylab.Figure()
> canvas = FigureCanvas( figure )
> axes_top = figure.add_subplot(211)
> axes_bottom = figure.add_subplot(212)
>
> and I want the _top to occupy 4/5 of the png
> and the _bottom to occupy the remaining 1/5.
>
> Thanks!
> Andrew
From: John H. <jdh...@ac...> - 2006年03月30日 15:04:56
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
 Darren> I dont think that can work, since
 Darren> set_xticklabels(['foo',...]) makes its own call to
 Darren> set_text('foo').
ax.set_xticklabels calls ax.xaxis.set_ticklabels which creates a new
Formatter with 
 self.set_major_formatter( FixedFormatter(ticklabels) )
ticklabels are kind of funny, and this is related to the question on
the user's list about setting the location of ticklabels. The
location and string are determined at draw time by the Locator and
Formatter class, which is why well-intentioned but naive attempts to
control their location and text directly often fail. One has to set
the locator and formatter, and this is highly configurable and
customizable. For the most part, I think it works fine.
The one use case brought up on the users list that the framework
doesn't address is the "centering" issue of ticklabels, trying to get
the labels centered between ticks. I'm mostly -1 on this, and I think
the major/minor hack I suggested can solve this use case fairly
cleanly, but I'm open to counter arguments. What might be nice,
however, is to add a padx, pady properties to text instances in
general or maybe just ticklabels in specific, that will shift their
horizontal and vertical position by a fixed amount in points.
JDH
From: John H. <jdh...@ac...> - 2006年03月30日 14:57:03
>>>>> "Eric" == Eric Firing <ef...@ha...> writes:
 Eric> John, At >4600 lines, axes.py is getting unwieldy, as is the
 Eric> Axes class that makes up the bulk of it. I propose to
 Eric> reorganize it and split it into at least two files.
 Eric> The main organizational change would separate the
 Eric> functionality that is directly involved in manipulating the
 Eric> axes from the more specific plotting methods. This could be
 Eric> done, for example, by putting the former in an AxesBase
 Eric> class, and then letting Axes inherit that. At the very
 Eric> least it would be nice to rearrange the methods so that all
 Eric> the pure Axes manipulation methods are together at the
 Eric> beginning.
 Eric> What do you think?
I don't want overarching ambitions to get in the way of a simple
refactor, but....
I've discussed this with Fernando and Perry on a couple of occasions,
and I think it would be useful to create high level Artists like
LinePlot, ScatterPlot, BarChart, etc, that carried the lines, etc, etc
around with them with useful configuration methods. The pylab.plot
would be a thin wrapper to Axes.plot which would instantiate a
LinePlot. A bit like what you recently did for the contour function.
High level plot objects like this would allow us to easily support
things like a FunctionPlot, which always returns the sin(x) at any
given scale, with some configurable, intelligent way to determine the
granularity of sampling at a given scale.
So that is background on the general topic of refactoring axes.py. As
for your specific suggestion, I have no problem with it. I have never
had a problem with one large file since emacs and judicious use of
search-forward and search-backward work fine for me. But I know that
code better than most, and I think your proposed changes would make it
much easier for people approaching the code for the first time to
understand what is going on. It might also make it clearer how to
pursue the grand refactor down the road. But I mention it now so you
can think about it while you are working :-)
JDH
From: Darren D. <dd...@co...> - 2006年03月30日 11:13:54
On Thursday 30 March 2006 3:44 am, Jouni K Seppanen wrote:
> John Hunter <jdh...@ac...> writes:
> > Jouni> label: any string
> > Jouni> text: string
> >
> > a 'label' is a property of any matplotlib.artist.Artist (the base
> > class for Line2D, Patch, Text, etc), and is used to attach a string to
> > any object that renders into a figure (including the Figure itself).
> > This is most used for auto-legending
>
> Oh, of course. I was confused by the name "tick labels" for the text
> that accompanies tick marks.
>
> > matplotlib.text.Text.set_text, however, does set the to-be-rendered
> > string for the Text instance.
>
> It doesn't seem to work for tick labels. E.g.
>
> gca().get_xticklabels()[0].set_text('foo')
>
> has no effect. This is quite understandable, since the text comes from
> a Formatter object. It might be a neat hack to have set_text('foo')
> automatically call set_xticklabels(['foo',...]).
I dont think that can work, since set_xticklabels(['foo',...]) makes its own 
call to set_text('foo').
From: Jouni K S. <jk...@ik...> - 2006年03月30日 09:03:54
Eric Firing <ef...@ha...> writes:
> The main organizational change would separate the functionality that
> is directly involved in manipulating the axes from the more specific
> plotting methods. This could be done, for example, by putting the
> former in an AxesBase class, and then letting Axes inherit that.
IMHO, it would make sense in the long term to make Axes a low-level
class with a well-defined interface, and implement high-level plotting
methods such as bar, boxplot, cohere, hist, specgram and what have you
using that interface outside of Axes. Currently at least some of these
methods "peek under the hood" by doing things like
 if not self._hold: self.cla()
This looks like it will be a pain to maintain if the implementation
details ever change. self._hold could probably be easily replaced by
self.ishold(), but moving the methods to another class would help
ensure that they stay kosher.
-- 
Jouni
From: Jouni K S. <jk...@ik...> - 2006年03月30日 08:45:12
John Hunter <jdh...@ac...> writes:
> Jouni> label: any string 
> Jouni> text: string
>
> a 'label' is a property of any matplotlib.artist.Artist (the base
> class for Line2D, Patch, Text, etc), and is used to attach a string to
> any object that renders into a figure (including the Figure itself).
> This is most used for auto-legending
Oh, of course. I was confused by the name "tick labels" for the text
that accompanies tick marks.
> matplotlib.text.Text.set_text, however, does set the to-be-rendered
> string for the Text instance.
It doesn't seem to work for tick labels. E.g.
 gca().get_xticklabels()[0].set_text('foo')
has no effect. This is quite understandable, since the text comes from
a Formatter object. It might be a neat hack to have set_text('foo')
automatically call set_xticklabels(['foo',...]).
-- 
Jouni
From: Eric F. <ef...@ha...> - 2006年03月30日 07:11:16
John,
At >4600 lines, axes.py is getting unwieldy, as is the Axes class that 
makes up the bulk of it. I propose to reorganize it and split it into 
at least two files.
The main organizational change would separate the functionality that is 
directly involved in manipulating the axes from the more specific 
plotting methods. This could be done, for example, by putting the 
former in an AxesBase class, and then letting Axes inherit that. At the 
very least it would be nice to rearrange the methods so that all the 
pure Axes manipulation methods are together at the beginning.
What do you think?
Eric
From: John H. <jdh...@ac...> - 2006年03月30日 05:38:57
>>>>> "Jouni" == Jouni K Seppanen <jk...@ik...> writes:
 Jouni> Darren Dale <dd...@co...> writes:
 >>> > OK, I refactored TextWithDash, and my changes passed
 >>> backend_driver.py. > setp(axes().get_yticklabels()) gives a
 >>> comprehensive list as of svn 2206.
 >> I fixed the bug John pointed out, and unmasked the refactored
 >> version of TextWithDash in svn 2226.
 Jouni> Yes, 'size' is listed in the output now. However, now it
 Jouni> seems that there are too many things listed:
 Jouni> label: any string 
 Jouni> text: string
If I'm reading this right, this has nothing to do with Darren's recent
refactoring.
a 'label' is a property of any matplotlib.artist.Artist (the base
class for Line2D, Patch, Text, etc), and is used to attach a string to
any object that renders into a figure (including the Figure itself).
This is most used for auto-legending
 plot(x1, y1, 'go', label='label x')
 plot(x1, y1, 'rs', label='label y')
 legend()
and legend will "to the right thing"(TM)
In other cases, we might use the label in outputting group information
in SVG output for instance, where we have open and close tags
associated with polygons, etc..
So the label is not necessarily rendered into the figure, although it
might be as the legend example illustrates, but is useful to tag
objects with strings.
matplotlib.text.Text.set_text, however, does set the to-be-rendered
string for the Text instance. It is right and good that the text
instance has a separate label and text property, though I agree this
might be confusing on a cursory 'setp' or 'getp' introspection.
JDH

Showing 9 results of 9

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