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



Showing results of 174

<< < 1 2 3 4 5 6 7 > >> (Page 4 of 7)
From: Sandro T. <mat...@gm...> - 2009年09月18日 18:31:31
On Fri, Sep 18, 2009 at 17:16, John Hunter <jd...@gm...> wrote:
> I filed a report at
> https://sourceforge.net/tracker/?func=browse&group_id=80706&atid=560720.
Ok, next time I'll file a bug on SF issue tracker instead of writing here.
Cheers,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Andrew S. <str...@as...> - 2009年09月18日 16:53:05
Michael Droettboom wrote:
> Thanks. The subslicing optimization added in 0.99 was truncating the 
> polar path. Subslicing has been made more "cautious" now and will only 
> be applied when the axes are rectilinear and non-logarithmic.
>
> Interestingly, there was already a test in the test framework for this 
> bug, but the baseline image was wrong :)
I see you fixed that, too -- thanks. I can't remember the history of
this one particular test -- I think maybe I inherited it without a test
image or perhaps I just over-enthusiastically copied a broken image
without realizing it as such.
These unit tests have already shown their worth I think (fixing
non-deterministic layout, getting a grip on freetype, etc.), and their
value in preventing mistakes and regressions from creeping in is hard to
perceive but I think is also very real. As more and more tests are added
(and broken baseline images and test cases are fixed), the number of
regressions will almost certainly drop.
-Andrew
From: Michael D. <md...@st...> - 2009年09月18日 15:44:16
Thanks. The subslicing optimization added in 0.99 was truncating the 
polar path. Subslicing has been made more "cautious" now and will only 
be applied when the axes are rectilinear and non-logarithmic.
Interestingly, there was already a test in the test framework for this 
bug, but the baseline image was wrong :)
Mike
Sandro Tosi wrote:
> Hi all,
> with the simple code here below
>
> $ ipython -pylab
>
> In [1]: import numpy as np
>
> In [2]: theta = np.arange(0., 2., 1./180.)*np.pi
>
> In [3]: plt.polar(3*theta, theta/5)
>
> I obtain the attached images with 0.98.5.3 and 0.99.{0.1rc1} (didn't
> have time to test against SVN).
>
> AFAIUI, the 0.98.5.3 should be the correct behavior, so in 0.99.x
> there's a regression.
>
> Regards,
> 
>
> ------------------------------------------------------------------------
>
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2009年09月18日 15:16:37
On Fri, Sep 18, 2009 at 9:48 AM, Sandro Tosi <mat...@gm...> wrote:
> Hi all,
> with the simple code here below
>
> $ ipython -pylab
>
> In [1]: import numpy as np
>
> In [2]: theta = np.arange(0., 2., 1./180.)*np.pi
>
> In [3]: plt.polar(3*theta, theta/5)
>
> I obtain the attached images with 0.98.5.3 and 0.99.{0.1rc1} (didn't
> have time to test against SVN).
>
> AFAIUI, the 0.98.5.3 should be the correct behavior, so in 0.99.x
> there's a regression.
I filed a report at
https://sourceforge.net/tracker/?func=browse&group_id=80706&atid=560720.
JDH
From: Sandro T. <mat...@gm...> - 2009年09月18日 14:48:54
Hi all,
with the simple code here below
$ ipython -pylab
In [1]: import numpy as np
In [2]: theta = np.arange(0., 2., 1./180.)*np.pi
In [3]: plt.polar(3*theta, theta/5)
I obtain the attached images with 0.98.5.3 and 0.99.{0.1rc1} (didn't
have time to test against SVN).
AFAIUI, the 0.98.5.3 should be the correct behavior, so in 0.99.x
there's a regression.
Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Gökhan S. <gok...@gm...> - 2009年09月18日 04:14:31
Apparently usetex_demo.py and dannys_example.py are same
(matplotlib/examples).
The latter might be deleted if no reference exist for that file.
-- 
Gökhan
From: Eric F. <ef...@ha...> - 2009年09月18日 02:51:57
Jouni K. Seppänen wrote:
> I just happened to type getp(gca()) on matplotlib 0.99.0, and the output
> looks all garbled:
Fixed in r7780 (branch) and 7781 (trunk).
Eric
> 
>>>> getp(gca())
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/matplotlib/axes.py:1269: DeprecationWarning: use ax.patch instead
> warnings.warn('use ax.patch instead', DeprecationWarning)
> stable = box
> a = 1.0
> or = C
> ated = False
> ct = auto
> scale_on = True
> scalex_on = True
> scaley_on = True
> = Axes(0.125,0.1;0.775x0.8)
> _locator = None
> _bgcolor = w
> [...]
> 
> It's been a long time since I last tried this, but does anyone have an
> idea what changes could have caused this? Could it be related to the
> ReST formatting in the docstrings?
> 
> Querying single attributes as in getp(gca(), 'yscale') seems to work
> fine, it's just this listing of all attributes that seems to be broken.
> 
From: Jae-Joon L. <lee...@gm...> - 2009年09月17日 22:11:50
Hi,
add_line method sets label to something like "_line1" if not set.
def add_line(self, line):
 if not line.get_label():
 line.set_label('_line%d'%len(self.lines))
add_collection sets label to "collection1" if not set.
def add_collection(self, collection, autolim=True):
 label = collection.get_label()
 if not label:
 collection.set_label('collection%d'%len(self.collections))
add_patch does nothing.
Can someone enlighten me why add_line and add_collection method sets the label?
Actually, my issue here is that collections without empty label show
up in the legend as "collection1" etc., instead of being ignored.
Regards,
-JJ
From: Michael D. <md...@st...> - 2009年09月17日 20:01:23
Good point. A test based on Sandro's example has been committed to SVN.
Mike
Andrew Straw wrote:
> Michael Droettboom wrote:
> 
>> Yes -- a bug was introduced where non-finite values were no longer being 
>> ignored by the data extents finder. This has now been fixed on the 
>> 0.99.x branch (r7774) and the trunk.
>> 
>> 
> Hi Mike,
>
> This would seem like something useful to write a test for to make sure
> these regressions don't slip in in the future. Would it be easy to write
> a test (image based or non image based)? If so, would you mind doing it
> and checking it into the trunk? You can look at
> lib/matplotlib/tests/test_axes.py and lib/matplotlib/tests/test_basic.py
> for examples.
>
> Also, apologies about the buildbot master being down last night and this
> morning. It's back online now.
>
> -Andrew
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Andrew S. <str...@as...> - 2009年09月17日 18:47:47
Michael Droettboom wrote:
> Yes -- a bug was introduced where non-finite values were no longer being 
> ignored by the data extents finder. This has now been fixed on the 
> 0.99.x branch (r7774) and the trunk.
> 
Hi Mike,
This would seem like something useful to write a test for to make sure
these regressions don't slip in in the future. Would it be easy to write
a test (image based or non image based)? If so, would you mind doing it
and checking it into the trunk? You can look at
lib/matplotlib/tests/test_axes.py and lib/matplotlib/tests/test_basic.py
for examples.
Also, apologies about the buildbot master being down last night and this
morning. It's back online now.
-Andrew
From: Fernando P. <fpe...@gm...> - 2009年09月17日 18:02:14
2009年9月17日 John Hunter <jd...@gm...>:
> On Thu, Sep 17, 2009 at 9:30 AM, Michael Droettboom <md...@st...> wrote:
>> Looks fine to me. We were offering to commit this to matplotlib, or
>> should I?
>
> You should let Fernando, so he can survive the annual purge of
> developers no longer committing :-)
Thanks :) I'll take care of it later then, I'll try to fix a warning
we're seeing as well because it lacks a setup.py.
Cheers,
f
From: Michael D. <md...@st...> - 2009年09月17日 14:57:05
Yes -- a bug was introduced where non-finite values were no longer being 
ignored by the data extents finder. This has now been fixed on the 
0.99.x branch (r7774) and the trunk.
Mike
Sandro Tosi wrote:
> Hello,
> with 0.99.{0, 1rc1} I have problem with this code:
>
> In [1]: import matplotlib.pyplot as plt
>
> In [2]: import numpy as np
>
> In [3]: x = np.arange(0., np.e, 0.01)
>
> In [4]: y = np.log(x)
>
> In [5]: print y[:2], y[-2:]
> [ -Inf -4.60517019] [ 0.99325177 0.99694863]
>
> In [6]: plt.plot(x, y);
>
> In [7]: plt.show()
>
> that generates the image attached, that's clearly wrong :)
>
> I works fine with 0.98.5.3, so there's something in the 0.99.* that broke.
>
> Regards,
> 
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> ------------------------------------------------------------------------
>
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2009年09月17日 14:36:17
On Thu, Sep 17, 2009 at 9:30 AM, Michael Droettboom <md...@st...> wrote:
> Looks fine to me. We were offering to commit this to matplotlib, or
> should I?
You should let Fernando, so he can survive the annual purge of
developers no longer committing :-)
From: Michael D. <md...@st...> - 2009年09月17日 14:30:54
Looks fine to me. We were offering to commit this to matplotlib, or 
should I?
Mike
Fernando Perez wrote:
> Howdy,
>
> this fixes the ipython console sphinx extension to mark up output
> prompts as well. Mind if I put it in?
>
> Thanks,
>
> f
>
> maqroll[sphinxext]> diff -u ipython_console_highlighting.py
> ~/research/papers/nitime/sphinxext/ipython_console_highlighting.py
> --- ipython_console_highlighting.py	2009年08月26日 00:03:06.000000000 -0700
> +++ /home/fperez/research/papers/nitime/sphinxext/ipython_console_highlighting.py	2009年09月11日
> 18:03:19.000000000 -0700
> @@ -77,8 +77,11 @@
> [(0, Generic.Prompt,
> continue_prompt.group())]))
> curcode += line[continue_prompt.end():]
> elif output_prompt is not None:
> + # Use the 'error' token for output. We should probably make
> + # our own token, but error is typicaly in a bright color like
> + # red, so it works fine for our Output prompts.
> insertions.append((len(curcode),
> - [(0, Generic.Output,
> output_prompt.group())]))
> + [(0, Generic.Error,
> output_prompt.group())]))
> curcode += line[output_prompt.end():]
> else:
> if curcode:
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
> http://p.sf.net/sfu/devconf
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Sandro T. <mo...@de...> - 2009年09月17日 14:14:34
Attachments: log_graph.png
Hello,
with 0.99.{0, 1rc1} I have problem with this code:
In [1]: import matplotlib.pyplot as plt
In [2]: import numpy as np
In [3]: x = np.arange(0., np.e, 0.01)
In [4]: y = np.log(x)
In [5]: print y[:2], y[-2:]
[ -Inf -4.60517019] [ 0.99325177 0.99694863]
In [6]: plt.plot(x, y);
In [7]: plt.show()
that generates the image attached, that's clearly wrong :)
I works fine with 0.98.5.3, so there's something in the 0.99.* that broke.
Regards,
-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi
From: Fernando P. <fpe...@gm...> - 2009年09月17日 03:49:00
Howdy,
this fixes the ipython console sphinx extension to mark up output
prompts as well. Mind if I put it in?
Thanks,
f
maqroll[sphinxext]> diff -u ipython_console_highlighting.py
~/research/papers/nitime/sphinxext/ipython_console_highlighting.py
--- ipython_console_highlighting.py	2009年08月26日 00:03:06.000000000 -0700
+++ /home/fperez/research/papers/nitime/sphinxext/ipython_console_highlighting.py	2009年09月11日
18:03:19.000000000 -0700
@@ -77,8 +77,11 @@
 [(0, Generic.Prompt,
continue_prompt.group())]))
 curcode += line[continue_prompt.end():]
 elif output_prompt is not None:
+ # Use the 'error' token for output. We should probably make
+ # our own token, but error is typicaly in a bright color like
+ # red, so it works fine for our Output prompts.
 insertions.append((len(curcode),
- [(0, Generic.Output,
output_prompt.group())]))
+ [(0, Generic.Error,
output_prompt.group())]))
 curcode += line[output_prompt.end():]
 else:
 if curcode:
From: Jae-Joon L. <lee...@gm...> - 2009年09月15日 19:57:31
Hi,
The backend_base in the trunk now has the draw_text_as_path method
which draws the text using the textpath module. The draw_text and the
draw_tex method calls it by default. This will enable a primitive
support for text and tex for all the backend which implements
draw_path method. This should not affect the functionality of existing
backends. The draw_text_as_path in the backend_base is a very basic
implementation. It simply calls draw_path for rendering. A special
version of the draw_tex method for the svg backend is implemented,
which caches the glyph paths of characters to reduces the output size.
So, here are examples.
usetex w/ svg backend : http://dl.getdropbox.com/u/178748/mpl/tex_demo.svg
text with html5 canvas backend : http://dl.getdropbox.com/u/178748/mpl/test.html
Well, the quality of the rendered text is not best, but seems good
enough for me.
Regards,
-JJ
From: Fernando P. <fpe...@gm...> - 2009年09月15日 17:53:58
Hi Michael,
On Sat, Aug 29, 2009 at 9:45 AM, John Hunter <jd...@gm...> wrote:
> On Sat, Aug 29, 2009 at 10:58 AM, Michael Sarahan<mcs...@uc...> wrote:
>> Here you go. If you can think of anything else to include, I'll work
>> on it. I think the next thing I'll add is something on embedding
>> images in the corners of plots. figimage is the way to do this,
>> right?
This is very nice, many thanks! If you are interested, I think that a
presentation on this would be very well received at the informal
scientific computing in python group that I coordinate at UC Berkeley:
https://cirl.berkeley.edu/view/Py4Science
I don't know how convenient it is for you to make the trip, but if
it's possible, we'd love to have you do a presentation on image
processing. Just let me know any time, it's best if you write
directly to my work address:
Fer...@be...
in case I miss a message on the mailing lists (I monitor that address
much more closely).
Cheers,
f
From: Erik T. <eri...@gm...> - 2009年09月15日 17:41:50
I was looking through this, and have a suggestion as well:
You have a line that reads
In[10]: plt.hist(lum_img)
This should probably be
plt.hist(lum_img.ravel(),bins=<some larger number>)
As it is right now, you are making a histogram of each line
individually, and my experience has been that this tends to cause
issues (memory and confusion-related) with relatively large images.
On Wed, Sep 2, 2009 at 6:42 AM, Michael Sarahan <mcs...@uc...> wrote:
> Great suggestions. I'll find time to work on them in the near future,
> hopefully.
>
> -Mike
>
> On Sat, Aug 29, 2009 at 6:06 PM, Gary Ruben<gr...@bi...> wrote:
>> Very nice addition Michael.
>>
>> I note that the plt.colormap() line must have gotten lost. It's referred to
>> but not there.
>> I'll add some ideas to John's list:
>>
>> * Demonstrate the imsave() command.
>> * Rather than show 50 lines or so of array data, just show a few lines, but
>> demonstrate what img.shape is before and after slicing out the B channel
>> with img[:,:,0]
>> * It may be worth mentioning explicitly that img[:,:,0] will give you the
>> blue channel for an RGB and an RGBA image.
>> * Demonstrate the "upper" and "lower" keywords where relevant.
>> * Add a pointer to the scipy.ndimage module
>> * Extend the examples with RGB and RGBA images.
>> * You might like to show how to recarrays and views on the individual colour
>> channels. There are examples in the mailing list archives or maybe on the
>> scipy website - I can't remember where.
>> * If you want to get more advanced, talk about higher bit depth images than
>> 8 bits per channel.
>> * If you want to get even more advanced, show how to change the UI to probe
>> the pixel value (I wish matplotlib did this by default).
>>
>> Gary R.
>>
>> John Hunter wrote:
>>>
>>> On Sat, Aug 29, 2009 at 10:58 AM, Michael Sarahan<mcs...@uc...>
>>> wrote:
>>>>
>>>> Here you go. If you can think of anything else to include, I'll work
>>>> on it. I think the next thing I'll add is something on embedding
>>>> images in the corners of plots. figimage is the way to do this,
>>>> right?
>>
>>
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now. http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
From: Fernando P. <fpe...@gm...> - 2009年09月15日 17:21:02
On Tue, Sep 15, 2009 at 7:57 AM, Michael Droettboom <md...@st...> wrote:
> Yeah, I have the same "not quite right" feeling about it. What about
> putting the caption in an "option" such as:
>
> .. plot:: foo.py
>  :caption: This is my caption
>
> I don't know if the caption can have newlines in this mode, though. I will
> have to experiment.
Not possible, as far as I could tell. This was my first reflex and
all of my experiments ended losing the other lines, and I couldn't
find by searching the lists whether there was any way to do it. But I
admit I didn't go as far as asking on the docutils or sphinx lists.
> It's not possible now. The tricky part of this is that currently we don't
> keep the module around after it's done plotting. This is actually very much
> on purpose since keeping all that data around for all of the example plots
> in the matplotlib documentation would quickly consume a lot of memory.
> Perhaps when used in this mode (with a function argument) we could. Alas,
> again that's api-by-inputs :)
Well, even if the module isn't kept in memory, from an api perspective
I think it would still be useful to have this
.. plot:: script.py func
mode. It would make it easier to organize scripts for plot generation
in papers.
But don't worry too much about it. The real problem was having
figures with captions, and at least we have that done. Hopefully some
time in the future these extensions can be cleaned up a little bit
(the code is indeed a bit messy).
In the meantime, we have something very useful that we need *today*,
so I'm happy :)
Cheers,
f
From: Michael D. <md...@st...> - 2009年09月15日 14:57:47
Fernando Perez wrote:
> Hi Michael,
>
> On Mon, Sep 14, 2009 at 6:57 AM, Michael Droettboom <md...@st...> wrote:
> 
>> I'm not sure it's that bad. It's certainly possible to do all these things
>> with a single directive, since providing a path or providing source code is
>> mutually exclusive. The thing one can't do is provide inline source *and* a
>> caption. I applied your patch, renaming the directive back to "plot" and
>> ran it over the matplotlib docs, and it doesn't seem to break anything.
>> 
>
> Well, if you're OK with the api-by-inputs approach (name+text =
> caption, text only=code), then I have no qualms using it. It felt a
> bit hackish so I was perhaps overly cautious, but I'd much rather:
>
> - have this in upstream mpl than in my own projects
> - have a single directive to remember
>
> So many thanks for integrating it!
> 
Yeah, I have the same "not quite right" feeling about it. What about 
putting the caption in an "option" such as:
 .. plot:: foo.py
 :caption: This is my caption
I don't know if the caption can have newlines in this mode, though. I 
will have to experiment.
>> Of course, we can also provide two directives, "plot" and "figplot" based on
>> essentially the same source code. I'm kind of neutral on the matter.
>> 
>
> I'm pretty neutral too, though perhaps it might be worth thinking
> about this a little more, to get a really good long-term solution.
> 
> 2. An extended version of today's support for files, that can handle
> entry points:
>
> .. plot:: script.py func1
>
> Caption for figure 1
>
> .. plot:: script.py func2
>
> Caption for figure 2
>
> This would *import* script only once, and then for each figure it
> would call the given function (argumentless, to keep things simple for
> now). Basically each call would be the equivalent of
>
> import script; script.funcN() # N=1,2
>
> This would make it easy to compute expensive data in script once, and
> then render multiple plots out of it without re-executing the script
> in full each time.
>
> Or is this already possible with today's plot()?
> 
It's not possible now. The tricky part of this is that currently we 
don't keep the module around after it's done plotting. This is actually 
very much on purpose since keeping all that data around for all of the 
example plots in the matplotlib documentation would quickly consume a 
lot of memory. Perhaps when used in this mode (with a function 
argument) we could. Alas, again that's api-by-inputs :)
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Fernando P. <fpe...@gm...> - 2009年09月15日 03:55:35
Hi Michael,
On Mon, Sep 14, 2009 at 6:57 AM, Michael Droettboom <md...@st...> wrote:
> I'm not sure it's that bad. It's certainly possible to do all these things
> with a single directive, since providing a path or providing source code is
> mutually exclusive. The thing one can't do is provide inline source *and* a
> caption. I applied your patch, renaming the directive back to "plot" and
> ran it over the matplotlib docs, and it doesn't seem to break anything.
Well, if you're OK with the api-by-inputs approach (name+text =
caption, text only=code), then I have no qualms using it. It felt a
bit hackish so I was perhaps overly cautious, but I'd much rather:
- have this in upstream mpl than in my own projects
- have a single directive to remember
So many thanks for integrating it!
> Of course, we can also provide two directives, "plot" and "figplot" based on
> essentially the same source code. I'm kind of neutral on the matter.
I'm pretty neutral too, though perhaps it might be worth thinking
about this a little more, to get a really good long-term solution.
Basically, what I'd like to have is a directive that can cover these
two scenarios:
1. Like today, plot with code:
.. plot::
 plot(x,y)
2. An extended version of today's support for files, that can handle
entry points:
.. plot:: script.py func1
 Caption for figure 1
.. plot:: script.py func2
 Caption for figure 2
This would *import* script only once, and then for each figure it
would call the given function (argumentless, to keep things simple for
now). Basically each call would be the equivalent of
import script; script.funcN() # N=1,2
This would make it easy to compute expensive data in script once, and
then render multiple plots out of it without re-executing the script
in full each time.
Or is this already possible with today's plot()?
I think this would cover all the use cases I have in mind, from years
of using a similar approach but with Makefiles.
Cheers,
f
From: Michael D. <md...@st...> - 2009年09月14日 14:02:53
Fernando Perez wrote:
> I renamed it because there's a bit of a conflict with the current
> 'plot' directive, which allows a filename *or* a content block, but in
> that case the content block is meant to be the source code, as
> illustrated in sampledoc:
>
> http://matplotlib.sourceforge.net/sampledoc/extensions.html#inserting-matplotlib-plots
>
> Since I'm not sure if we can find a clean solution to:
>
> - path to script: goes into arg list
> - inlined (multiline) code: goes into content block
> - inlined (possibly multiline) caption: goes into content block
> 
I'm not sure it's that bad. It's certainly possible to do all these 
things with a single directive, since providing a path or providing 
source code is mutually exclusive. The thing one can't do is provide 
inline source *and* a caption. I applied your patch, renaming the 
directive back to "plot" and ran it over the matplotlib docs, and it 
doesn't seem to break anything.
Of course, we can also provide two directives, "plot" and "figplot" 
based on essentially the same source code. I'm kind of neutral on the 
matter.
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2009年09月14日 13:58:07
Fernando Perez wrote:
> I renamed it because there's a bit of a conflict with the current
> 'plot' directive, which allows a filename *or* a content block, but in
> that case the content block is meant to be the source code, as
> illustrated in sampledoc:
>
> http://matplotlib.sourceforge.net/sampledoc/extensions.html#inserting-matplotlib-plots
>
> Since I'm not sure if we can find a clean solution to:
>
> - path to script: goes into arg list
> - inlined (multiline) code: goes into content block
> - inlined (possibly multiline) caption: goes into content block
> 
I'm not sure it's that bad. It's certainly possible to do all these 
things with a single directive, since providing a path or providing 
source code is mutually exclusive. The thing one can't do is provide 
inline source *and* a caption. I applied your patch, renaming the 
directive back to "plot" and ran it over the matplotlib docs, and it 
doesn't seem to break anything.
Of course, we can also provide two directives, "plot" and "figplot" 
based on essentially the same source code. I'm kind of neutral on the 
matter.
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Ariel R. <ar...@be...> - 2009年09月13日 17:37:45
Hi Fernando and all,
>
> Speaking of sphinx for books, as I've mentioned before to John, the
> last big problem is being able to cross-reference arbitrary text
> elements like you can in latex, be they chapters or sections or
> whatever, and get a number or something that's meaningful in print.
>
> I looked around, and apparently it's on the main docutils todo list:
>
> http://docutils.sourceforge.net/docs/dev/todo.html#object-numbering-and-object-references
>
> I hope we don't have to be the ones fixing that one...
>
I should also mention bibliography - using a bibtex bibliography is
also still quite impossible at the moment, without going in and
editing the .tex and running the tex (latex=>bibtex=>latex=>latex)
commands on it yourself. Does anyone of the Sphinx mavens around here
know anything about how to get Sphinx to do that for you? I am
starting to believe that Sphinx can be made to do just about anything
we would want it to for these kinds of uses.
Cheers,
Ariel

Showing results of 174

<< < 1 2 3 4 5 6 7 > >> (Page 4 of 7)
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 によって変換されたページ (->オリジナル) /