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



Showing results of 355

<< < 1 .. 9 10 11 12 13 .. 15 > >> (Page 11 of 15)
From: Jianbao T. <jia...@gm...> - 2012年10月05日 16:44:27
Hi,
I am working on a time-series data browser based on matplotlib. In general,
it shows a N_row x 1_col stack of axes, which share the x axis, the time
axis. It is nice that matplotlib offers the sharex option so that the data
can be zoomed simultaneously in time. However, one problem with the sharex
option is that it not only shares the axis range (or limits, if you will),
but also the axis appearance, which is not always desirable. In my case, I
want the tick labels to be shown only on the bottom subplot. However, that
doesn't seem to be achievable with sharex.
The follow snippet demonstrates my example:
#------------------------- code --------------------------------------------
import matplotlib.pyplot as plt
fig = plt.figure()
ax1 = fig.add_subplot(211)
ax2 = fig.add_subplot(212, sharex=ax1)
ax1.get_xaxis().set_ticklabels([]) # This also suppresses x tick labels of
ax2.
fig.canvas.draw()
#-------------------------- end of code ------------------------------------
Is there a workaround, hopefully simple and straightforward, to share range
(or limits) only among axes? Better yet, can this feature be added, like a
keyword sharexrange, in the future, if it is not already there? Of course,
the situation should be similar for y axis, too.
Thank you very much.
Jianbao
From: Fernando P. <fpe...@gm...> - 2012年10月05日 16:27:26
On Fri, Oct 5, 2012 at 6:52 AM, Michael Droettboom <md...@st...> wrote:
> This is a great idea. Anything to raise the level of perceived "legitimacy"
> in the academic community would be great. We can definitely add content like
> this to the documentation and/or website.
Our strategy:
- Prominent display on the main page of a citation request, along with
links on our top nav-bar:
http://ipython.org/#citing-ipython
- A copy/paste ready citation entry: http://ipython.org/citing.html
Matplotlib has a 'canonical' paper back in the same CISE issue that
can be used, here's the bibtex entry for it (should probably be
trimmed only to the main fields):
@Article{Hunter:2007,
 Author = {Hunter, J. D.},
 Title = {Matplotlib: A 2D graphics environment},
 Journal = {Computing In Science \& Engineering},
 Volume = {9},
 Number = {3},
 Pages = {90--95},
 abstract = {Matplotlib is a 2D graphics package used for Python
 for application development, interactive scripting, and
 publication-quality image generation across user
 interfaces and operating systems.},
 address = {10662 LOS VAQUEROS CIRCLE, PO BOX 3014, LOS ALAMITOS,
 CA 90720-1314 USA},
 bdsk-url-1 =
{http://gateway.isiknowledge.com/gateway/Gateway.cgi?GWVersion=2&SrcAuth=Alerting&SrcApp=Alerting&DestApp=WOS&DestLinkType=FullRecord;KeyUT=000245668100019},
 date-added = {2010年09月23日 12:22:10 -0700},
 date-modified = {2010年09月23日 12:22:10 -0700},
 isi = {000245668100019},
 isi-recid = {155389429},
 month = may # "/" # jun,
 publisher = {IEEE COMPUTER SOC},
 year = 2007
}
Cheers,
f
From: Usjes <ois...@ya...> - 2012年10月05日 15:15:07
Benjamin Root-2 wrote
> Actually, that is very telling... Did you restart python after editing
> the
> .py file? Python will only load a source file once in a session (unless
> explicitly forced to do a reload, but that is not intended for newbies).
> So, any changes to any source .py file will not take effect until you
> restart your python session. This is different from other languages like
> Matlab.
> 
> Ben Root
> 
> P.S. - The way I am able to deduce this is that when an exception occurs,
> the "compiled" code will tell python which lines it came from in the
> original source file so that python can display the traceback. If you
> edit
> the source file to add a line before the line that triggers a traceback,
> it
> can look like the wrong line is triggering the error because the compiled
> code doesn't know that its source has been updated.
Yes, it now works for me , thanks. 
I didn't think a restart was necessary as I could see my '[:3]' edit in the
error msg, it hadn't occurred to me that it would source the code for the
error msg from the updated file even though it was out of sync with the
'compiled' version.
Usjes 
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/EMF-output-too-many-values-to-unpack-error-tp11466p39277.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Benjamin R. <ben...@ou...> - 2012年10月05日 14:59:42
On Fri, Oct 5, 2012 at 10:47 AM, Usjes <ois...@ya...> wrote:
> Benjamin Root-2 wrote
> > On Fri, Oct 5, 2012 at 6:38 AM, Usjes <
>
> > oisin_nz@.co
>
> > > wrote:
> >
> > Does it fail for the example I originally gave?
> >
> > from pylab import *
> > plot([1, 2, 3])
> > savefig("foobar.emf")
> >
> >
> > Ben Root
>
> Yes, it fails even with the simple plot suggested; see log below. I am new
> to Python but I did also try inserting the command:
> print rgb
> preceding the offending line, to get an idea of what the dimensions of
> 'rgb'
> are but the print statement also fails due to 'too many values to unpack'
>
>
Actually, that is very telling... Did you restart python after editing the
.py file? Python will only load a source file once in a session (unless
explicitly forced to do a reload, but that is not intended for newbies).
So, any changes to any source .py file will not take effect until you
restart your python session. This is different from other languages like
Matlab.
Ben Root
P.S. - The way I am able to deduce this is that when an exception occurs,
the "compiled" code will tell python which lines it came from in the
original source file so that python can display the traceback. If you edit
the source file to add a line before the line that triggers a traceback, it
can look like the wrong line is triggering the error because the compiled
code doesn't know that its source has been updated.
From: Usjes <ois...@ya...> - 2012年10月05日 14:48:04
Benjamin Root-2 wrote
> On Fri, Oct 5, 2012 at 6:38 AM, Usjes &lt;
> oisin_nz@.co
> &gt; wrote:
> 
> Does it fail for the example I originally gave?
> 
> from pylab import *
> plot([1, 2, 3])
> savefig("foobar.emf")
> 
> 
> Ben Root
Yes, it fails even with the simple plot suggested; see log below. I am new
to Python but I did also try inserting the command:
print rgb 
preceding the offending line, to get an idea of what the dimensions of 'rgb'
are but the print statement also fails due to 'too many values to unpack'
savefig("foobar.emf")
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 363, in
savefig
 return fig.savefig(*args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 1084, in
savefig
 self.canvas.print_figure(*args, **kwargs)
 File
"C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line
144, in print_figure
 FigureCanvasAgg.print_figure(self, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\backend_bases.py", line
1923, in print_figure
 **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\backend_bases.py", line
1723, in print_emf
 return emf.print_emf(*args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 717, in print_emf
 self.figure.draw(renderer)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 738, in
draw
 if self.frameon: self.patch.draw(renderer)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 411, in
draw
 renderer.draw_path(gc, tpath, affine, rgbFace)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 258, in draw_path
 self.select_brush(rgbFace)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 565, in select_brush
 brush=EMFBrush(self.emf,rgb)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 105, in __init__
 r,g,b=rgb[:3]
ValueError: too many values to unpack
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/EMF-output-too-many-values-to-unpack-error-tp11466p39275.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Michael D. <md...@st...> - 2012年10月05日 13:54:43
This is a great idea. Anything to raise the level of perceived 
"legitimacy" in the academic community would be great. We can definitely 
add content like this to the documentation and/or website.
Mike
On 10/05/2012 09:43 AM, Jianbao Tao wrote:
> I think that is a great idea. I think it is worthwhile to put a 
> highlighted spot, or whatever, that shows matplotlib plots in academic 
> publications. Additionally, it is good for enlarging the matplotlib 
> user base to ask people to acknowledge matplotlib in their papers if 
> they use matplotlib to make plots, and share links of their 
> publications. Of course, matplotlib.org <http://matplotlib.org> should 
> provide some sort of platform for people to share that kind of 
> information, such as a public email address. Such acknowledgement is 
> not a hard thing to do, and I think most people, if not all, that 
> benefit from matplotlib would be more than happy to do so. :-)
>
> Jianbao
>
> Message: 4
> Date: Thu, 4 Oct 2012 22:31:34 -0600
> From: G?khan Sever <gok...@gm...
> <mailto:gok...@gm...>>
> Subject: [Matplotlib-users] Matplotlib produced plots in academic
> journal articles
> To: mat...@li...
> <mailto:mat...@li...>
> Message-ID:
> 
> <CAE5kuyh17jsDcaejwx=XeK...@ma... <mailto:XeK...@ma...>>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> Is there any collection of articles that shows academic articles using
> matplotlib produced plots? I have come across a few recent
> articles in my
> field with plots produced by matplotlib. Though, the mpl page
> shows some
> nice examples of publication quality plots, it would be nice to have a
> discipline specific collection of academic paper citations/links
> (hopefully
> mostly open-access titles) to raise awareness of mpl usage in
> academia by
> attracting other language users.
>
> What do you think?
>
> --
> G?khan
>
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
>
>
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Jianbao T. <jia...@gm...> - 2012年10月05日 13:43:55
I think that is a great idea. I think it is worthwhile to put a highlighted
spot, or whatever, that shows matplotlib plots in academic publications.
Additionally, it is good for enlarging the matplotlib user base to ask
people to acknowledge matplotlib in their papers if they use matplotlib to
make plots, and share links of their publications. Of course,
matplotlib.orgshould provide some sort of platform for people to share
that kind of
information, such as a public email address. Such acknowledgement is not a
hard thing to do, and I think most people, if not all, that benefit from
matplotlib would be more than happy to do so. :-)
Jianbao
Message: 4
> Date: Thu, 4 Oct 2012 22:31:34 -0600
> From: G?khan Sever <gok...@gm...>
> Subject: [Matplotlib-users] Matplotlib produced plots in academic
> journal articles
> To: mat...@li...
> Message-ID:
> <CAE5kuyh17jsDcaejwx=
> XeK...@ma...>
> Content-Type: text/plain; charset="utf-8"
>
> Hello,
>
> Is there any collection of articles that shows academic articles using
> matplotlib produced plots? I have come across a few recent articles in my
> field with plots produced by matplotlib. Though, the mpl page shows some
> nice examples of publication quality plots, it would be nice to have a
> discipline specific collection of academic paper citations/links (hopefully
> mostly open-access titles) to raise awareness of mpl usage in academia by
> attracting other language users.
>
> What do you think?
>
> --
> G?khan
>
From: Benjamin R. <ben...@ou...> - 2012年10月05日 13:17:19
On Fri, Oct 5, 2012 at 6:38 AM, Usjes <ois...@ya...> wrote:
> Benjamin Root-2 wrote
> > On Thu, Jun 9, 2011 at 12:40 PM, Klonuo Umom <
>
> > klonuo@
>
> > > wrote:
> >
> > I set up pull requests to fix this problem, so the v1.0.x-maint branch
> and
> > the master branch should soon have the fixes commited to them. You can
> > get
> > the latest bugfixed branch for v1.0.1 at
> > https://github.com/matplotlib/matplotlib/tree/v1.0.x-maint, although
> that
> > would mean having to build from source. You could also just edit your
> > copy
> > of the file C:\Python26\lib\site-
> > packages\matplotlib\backends\backend_emf.py so that [:3] is added to the
> > end
> > of lines 69 and 105. This page should show you what changes you need:
> >
> https://github.com/WeatherGod/matplotlib/commit/bf8d9d6f7cea1546c736d3897387698e6ae5e5b3
> >
> > I hope that helps!
> >
> > Ben Root
>
> Hi,
>
> I am having the same problem when trying to save a figure to a .emf file
> via
> pylab.savefig().
> I have tried updating backend_emf.py as suggested but this does not fix the
> problem, it still has a problem with the updated code(see below).
> The only difference I can see with the original poster is that I am using
> backend_qt4agg.py rather than backend_wxagg.py in the original posters
> code.
> This shouldn't change the fix, should it ?
>
>
Does it fail for the example I originally gave?
from pylab import *
plot([1, 2, 3])
savefig("foobar.emf")
Ben Root
From: Usjes <ois...@ya...> - 2012年10月05日 10:39:03
Benjamin Root-2 wrote
> On Thu, Jun 9, 2011 at 12:40 PM, Klonuo Umom &lt;
> klonuo@
> &gt; wrote:
> 
> I set up pull requests to fix this problem, so the v1.0.x-maint branch and
> the master branch should soon have the fixes commited to them. You can
> get
> the latest bugfixed branch for v1.0.1 at
> https://github.com/matplotlib/matplotlib/tree/v1.0.x-maint, although that
> would mean having to build from source. You could also just edit your
> copy
> of the file C:\Python26\lib\site-
> packages\matplotlib\backends\backend_emf.py so that [:3] is added to the
> end
> of lines 69 and 105. This page should show you what changes you need:
> https://github.com/WeatherGod/matplotlib/commit/bf8d9d6f7cea1546c736d3897387698e6ae5e5b3
> 
> I hope that helps!
> 
> Ben Root
Hi, 
I am having the same problem when trying to save a figure to a .emf file via
pylab.savefig(). 
I have tried updating backend_emf.py as suggested but this does not fix the
problem, it still has a problem with the updated code(see below).
The only difference I can see with the original poster is that I am using
backend_qt4agg.py rather than backend_wxagg.py in the original posters code.
This shouldn't change the fix, should it ?
pylab.savefig('nrg.emf')
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "C:\Python26\lib\site-packages\matplotlib\pyplot.py", line 363, in
savefig
 return fig.savefig(*args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 1084, in
savefig
 self.canvas.print_figure(*args, **kwargs)
 File
"C:\Python26\lib\site-packages\matplotlib\backends\backend_qt4agg.py", line
144, in print_figure
 FigureCanvasAgg.print_figure(self, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\backend_bases.py", line
1923, in print_figure
 **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\backend_bases.py", line
1723, in print_emf
 return emf.print_emf(*args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 717, in print_emf
 self.figure.draw(renderer)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\figure.py", line 738, in
draw
 if self.frameon: self.patch.draw(renderer)
 File "C:\Python26\lib\site-packages\matplotlib\artist.py", line 55, in
draw_wrapper
 draw(artist, renderer, *args, **kwargs)
 File "C:\Python26\lib\site-packages\matplotlib\patches.py", line 411, in
draw
 renderer.draw_path(gc, tpath, affine, rgbFace)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 258, in draw_path
 self.select_brush(rgbFace)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 565, in select_brush
 brush=EMFBrush(self.emf,rgb)
 File "C:\Python26\lib\site-packages\matplotlib\backends\backend_emf.py",
line 105, in __init__
 r,g,b=rgb[:3]
ValueError: too many values to unpack
--
View this message in context: http://matplotlib.1069221.n5.nabble.com/EMF-output-too-many-values-to-unpack-error-tp11466p39267.html
Sent from the matplotlib - users mailing list archive at Nabble.com.
From: Damon M. <dam...@gm...> - 2012年10月05日 09:27:36
On Fri, Oct 5, 2012 at 10:13 AM, Matthias BUSSONNIER
<bus...@gm...> wrote:
>
> Le 4 oct. 2012 à 23:09, Juergen Hasch a écrit :
>
>> Here is my take on it as an IPython notebook, based on Damon's code:
>> http://nbviewer.ipython.org/3835181/
>>
>> I took the engineering approach and filtered the random function instead of doing some fft/ifft magic.
>> Also, X and Y of the functions are affected now, giving them a more "natural" look in the slopes.
>>
>> Juergen
>
> If anyone have time to make some examples and a right side thumbnail
> I can make it as featured notebook in the front page of nbviewer.
>
> You can even make a direct PR agains nbviewer and I would then just have
> to merge and deploy.
>
> To be fair, notebook should also give some explanation of the code,
> link to this discussion, maybe show one "original" xkcd graph.
>
> Please take your time, and if there is several submission,
> we'll sort out how to choose the best(s).
>
> --
> Matthias
>
>>
>>
>> Am 04.10.2012 18:09, schrieb Pierre Haessig:
>>> Le 04/10/2012 16:35, Pierre Haessig a écrit :
>>>> So I think this code indeed resamples the rastered plot image on a
>>>> shaken coordinate grid. I kind of understand that the noise on
>>>> coordinates is spatially smoothed by a 10px Gaussian Point Spread
>>>> Function (if I understand correctly...)
>>> I've implemented this processing in a tiny "image_shake" script.
>>> https://gist.github.com/3834536
>>> A nice occasion to learn how to use some scipy image processing functions...
>>>
>>> I've attached the before/after images because I didn't manage to put
>>> them in the Gist (it's not a plot image but gives the idea of line shaking).
>>>
>>> Now, I think it's unfortunately outside the frame of Fernando's
>>> challenge, because this script uses zero matplotlib methods!!
>>>
>>> Best,
>>> Pierre
This thread has made my week.
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Matthias B. <bus...@gm...> - 2012年10月05日 09:10:39
Le 4 oct. 2012 à 23:09, Juergen Hasch a écrit :
> Here is my take on it as an IPython notebook, based on Damon's code:
> http://nbviewer.ipython.org/3835181/
> 
> I took the engineering approach and filtered the random function instead of doing some fft/ifft magic.
> Also, X and Y of the functions are affected now, giving them a more "natural" look in the slopes.
> 
> Juergen
If anyone have time to make some examples and a right side thumbnail
I can make it as featured notebook in the front page of nbviewer.
You can even make a direct PR agains nbviewer and I would then just have 
to merge and deploy.
To be fair, notebook should also give some explanation of the code, 
link to this discussion, maybe show one "original" xkcd graph.
Please take your time, and if there is several submission,
we'll sort out how to choose the best(s).
-- 
Matthias
> 
> 
> Am 04.10.2012 18:09, schrieb Pierre Haessig:
>> Le 04/10/2012 16:35, Pierre Haessig a écrit :
>>> So I think this code indeed resamples the rastered plot image on a
>>> shaken coordinate grid. I kind of understand that the noise on
>>> coordinates is spatially smoothed by a 10px Gaussian Point Spread
>>> Function (if I understand correctly...)
>> I've implemented this processing in a tiny "image_shake" script.
>> https://gist.github.com/3834536
>> A nice occasion to learn how to use some scipy image processing functions...
>> 
>> I've attached the before/after images because I didn't manage to put
>> them in the Gist (it's not a plot image but gives the idea of line shaking).
>> 
>> Now, I think it's unfortunately outside the frame of Fernando's
>> challenge, because this script uses zero matplotlib methods!!
>> 
>> Best,
>> Pierre
> 
> 
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Gökhan S. <gok...@gm...> - 2012年10月05日 04:31:42
Hello,
Is there any collection of articles that shows academic articles using
matplotlib produced plots? I have come across a few recent articles in my
field with plots produced by matplotlib. Though, the mpl page shows some
nice examples of publication quality plots, it would be nice to have a
discipline specific collection of academic paper citations/links (hopefully
mostly open-access titles) to raise awareness of mpl usage in academia by
attracting other language users.
What do you think?
-- 
Gökhan
From: Ryan M. <rm...@gm...> - 2012年10月05日 01:49:51
On Thu, Oct 4, 2012 at 12:38 PM, Andreas Mueller
<amu...@ai...> wrote:
> On 10/04/2012 03:51 PM, Benjamin Root wrote:
> On Thu, Oct 4, 2012 at 10:02 AM, Andreas Mueller <amu...@ai...>
> wrote:
>>
>> Hi everybody.
>> I have been trying to save some animations I made and I encountered the
>> problem mentioned here.
>> I am using current master.
>> To be precise, when I use
>> anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])
>> I get "RuntimeError: Error writing to file" from the agg backend.
>> If I don't use the extra_args, it works, but I get very, very bad
>> quality that can not be redeemed using bitrate.
>> I have ffmpeg and libx264 installed. I also tried the mencoder by passing
>> MencoderWriter() to save, but that resulted in a video where all frames
>> are identical.
>>
>> Any help on this would be appreciated. Is there an easy way to just dump
>> the frames? I can do the mencoder bit myself.
>>
>> Thanks,
>> Andy
>>
>
> Exactly which version of mpl are you using, and what is your platform? This
> will help us diagnose what is going on.
>
>
>> Thanks for the quick answer.
>> I am not on the box but I used master from yesterday, so
>> 89482b21c8582d49a2ddc2865e472eb404fd07e2, I guess.
>> The platform is Ubuntu Precise (with loads of random Python packages, but
>> that seems somewhat unrelated).
I'm on Ubuntu Precise (12.04) here as well. No problems with/without,
but I'm noticing the extra_args aren't being used (which I think is a
known bug I need to fix.) Can you run with --verbose-debug and post
the relevant output? (Or just compress and attach.)
Ryan
-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma
From: Michael A. <kmi...@gm...> - 2012年10月05日 01:35:13
On 2012年10月02日 20:15:51 +0000, Damon McDougall said:
> On Tue, Oct 2, 2012 at 9:09 PM, Eric Firing 
> <ef...@ha...> wrote:
>> On 2012年10月02日 9:21 AM, Michael Aye wrote:
>>>>>>>>> 
>>>>>>>> How nice of you to ask! ;)
>>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>>> shown with some white overhead area around, e.g. for an image of 100
>>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>>> and let imshow instead use the exact image extent. I believe that the
>>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>>> range and not try to beautify the plot?
>>>>>>>> 
>>>>>>>> Michael
>>>>>>>> 
>>>>>>> 
>>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>>> 
>>>>>> 
>>>>>> No, because it needs detail. I was looking for a boolean switch that
>>>> basically says: Respect the data, not beauty.
>>>>> 
>>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>>> that doesn't do what you want?
>>>>> 
>>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>>> 
>>>> 
>>>> Which version of matplotlib are you using? Also, are you on a 32-bit
>>>> machine or a 64-bit machine. This might be related to a bug we have
>>>> seen recently.
>>> 
>>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>>> 
>>> Thanks for the effort Damon. I should have been starting with an
>>> example script from the beginning.
>>> I believe the problem appears only for subplots in the case of sharex
>>> =sharey = True:
>> 
>> Aha! This is a real bug. It may take a bit of work to track it down.
>> Would you enter it, with this test script, as a github issue, please?
>> 
>> Thank you.
>> 
>> Eric
>> 
>>> 
>>> from matplotlib.pyplot import show, subplots
>>> from numpy import arange, array
>>> 
>>> arr = arange(10000).reshape(100,100)
>>> l = [arr,arr,arr,arr]
>>> narr = array(l)
>>> 
>>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>>> 
>>> for ax,im in zip(axes.flatten(),narr):
>>> ax.imshow(im)
>>> 
>>> show()
>>> 
>>> One can see that all the 4 axes show the array with an extent of
>>> [-10,110, 0, 100] here.
>>> 
>>> Michael
>>> 
>>> 
>>>> 
>>>> Ben Root
>>>> 
>>>> ------------------------------------------------------------------------------
>>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>>> Deploy New Relic app performance management and know exactly
>>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>>> http://p.sf.net/sfu/newrelic-dev2dev
>>>> _______________________________________________
>>>> Matplotlib-users mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>> 
>>> 
>>> 
>>> ------------------------------------------------------------------------------
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> The extent keyword is something I put in as second nature. You'll need
> it if your x-range or y-range is something other than the the number
> of pixels in each dimension. In this case, it can safely be removed,
> yes. Thanks for pointing that out.
> 
> If you want to share axes, that is still possible:
> 
> import matplotlib.pyplot as plt
> from numpy import arange, array
> 
> arr = arange(10000).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
> 
> axes = []
> fig = plt.figure()
> for i in range(4):
> if i == 0:
> axes.append(fig.add_subplot(2, 2, i))
> if i > 0:
> axes.append(fig.add_subplot(2, 2, i, sharex=axes[0], sharey=axes[0]))
> 
> for ax, im in zip(axes, narr):
> ax.imshow(im, extent=[0,100,0,100])
> 
> plt.show()
This code fails to share the axes and the last extent setting as well, 
so like in my example the images are shown, at least on my system, with 
an extent of [-10,110,0,100].
From: Michael A. <kmi...@gm...> - 2012年10月05日 01:30:20
On 2012年10月02日 20:09:34 +0000, Eric Firing said:
> On 2012年10月02日 9:21 AM, Michael Aye wrote:
>>>>>>>> 
>>>>>>> How nice of you to ask! ;)
>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>> shown with some white overhead area around, e.g. for an image of 100
>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>> and let imshow instead use the exact image extent. I believe that the
>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>> range and not try to beautify the plot?
>>>>>>> 
>>>>>>> Michael
>>>>>>> 
>>>>>> 
>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>> 
>>>>> 
>>>>> No, because it needs detail. I was looking for a boolean switch that
>>> basically says: Respect the data, not beauty.
>>>> 
>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>> that doesn't do what you want?
>>>> 
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>> 
>>> 
>>> Which version of matplotlib are you using? Also, are you on a 32-bit
>>> machine or a 64-bit machine. This might be related to a bug we have
>>> seen recently.
>> 
>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>> 
>> Thanks for the effort Damon. I should have been starting with an
>> example script from the beginning.
>> I believe the problem appears only for subplots in the case of sharex
>> =sharey = True:
> 
> Aha! This is a real bug. It may take a bit of work to track it down.
> Would you enter it, with this test script, as a github issue, please?
Done.
https://github.com/matplotlib/matplotlib/issues/1325
Cheers,
Michael
> 
> Thank you.
> 
> Eric
> 
>> 
>> from matplotlib.pyplot import show, subplots
>> from numpy import arange, array
>> 
>> arr = arange(10000).reshape(100,100)
>> l = [arr,arr,arr,arr]
>> narr = array(l)
>> 
>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>> 
>> for ax,im in zip(axes.flatten(),narr):
>> ax.imshow(im)
>> 
>> show()
>> 
>> One can see that all the 4 axes show the array with an extent of
>> [-10,110, 0, 100] here.
>> 
>> Michael
>> 
>> 
>>> 
>>> Ben Root
>>> 
>>> ------------------------------------------------------------------------------
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>>> _______________________________________________
>>> Matplotlib-users mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
> 
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
From: Michael D. <md...@st...> - 2012年10月05日 00:18:45
I've put up a PR adding this "sketchy" line drawing as a path filter. 
This makes it work with almost anything that matplotlib draws.
https://github.com/matplotlib/matplotlib/pull/1329
Mike
On 10/04/2012 06:06 PM, Fernando Perez wrote:
> Sweet! That should *defiintely* go into the mpl gallery, and honestly
> I'd love for it to be cleaned up enough to be usable to style
> generically any plot, much like the mathematica code I linked to
> earlier does.
>
> It would be a beautiful demonstration of matplotlib's capabilities,
> and furthermore, I can imagine it being useful in practice. If I want
> to make a purely 'qualitative' diagram, something in this style
> actually looks great and I prefer it to something that looks more like
> a 'real data' plot.
>
> Thanks everyone for the enthusiasm with which you took this and ran with it!
>
> Cheers,
>
> f
>
> On Thu, Oct 4, 2012 at 2:39 PM, Damon McDougall
> <dam...@gm...> wrote:
>> On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch <py...@el...> wrote:
>>> Here is my take on it as an IPython notebook, based on Damon's code:
>>> http://nbviewer.ipython.org/3835181/
>>>
>>> I took the engineering approach and filtered the random function instead of doing some fft/ifft magic.
>>> Also, X and Y of the functions are affected now, giving them a more "natural" look in the slopes.
>>>
>>> Juergen
>> I think I actually prefer your output over mine :)
>> Nice job.
>>
>> --
>> Damon McDougall
>> http://www.damon-is-a-geek.com
>> B2.39
>> Mathematics Institute
>> University of Warwick
>> Coventry
>> West Midlands
>> CV4 7AL
>> United Kingdom
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Matplotlib-users mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Fernando P. <fpe...@gm...> - 2012年10月04日 22:06:51
Sweet! That should *defiintely* go into the mpl gallery, and honestly
I'd love for it to be cleaned up enough to be usable to style
generically any plot, much like the mathematica code I linked to
earlier does.
It would be a beautiful demonstration of matplotlib's capabilities,
and furthermore, I can imagine it being useful in practice. If I want
to make a purely 'qualitative' diagram, something in this style
actually looks great and I prefer it to something that looks more like
a 'real data' plot.
Thanks everyone for the enthusiasm with which you took this and ran with it!
Cheers,
f
On Thu, Oct 4, 2012 at 2:39 PM, Damon McDougall
<dam...@gm...> wrote:
> On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch <py...@el...> wrote:
>> Here is my take on it as an IPython notebook, based on Damon's code:
>> http://nbviewer.ipython.org/3835181/
>>
>> I took the engineering approach and filtered the random function instead of doing some fft/ifft magic.
>> Also, X and Y of the functions are affected now, giving them a more "natural" look in the slopes.
>>
>> Juergen
>
> I think I actually prefer your output over mine :)
> Nice job.
>
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Matplotlib-users mailing list
> Mat...@li...
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
From: Damon M. <dam...@gm...> - 2012年10月04日 21:39:16
On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch <py...@el...> wrote:
> Here is my take on it as an IPython notebook, based on Damon's code:
> http://nbviewer.ipython.org/3835181/
>
> I took the engineering approach and filtered the random function instead of doing some fft/ifft magic.
> Also, X and Y of the functions are affected now, giving them a more "natural" look in the slopes.
>
> Juergen
I think I actually prefer your output over mine :)
Nice job.
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom
From: Juergen H. <py...@el...> - 2012年10月04日 21:09:47
Here is my take on it as an IPython notebook, based on Damon's code:
http://nbviewer.ipython.org/3835181/
I took the engineering approach and filtered the random function instead of doing some fft/ifft magic.
Also, X and Y of the functions are affected now, giving them a more "natural" look in the slopes.
 Juergen
Am 04.10.2012 18:09, schrieb Pierre Haessig:
> Le 04/10/2012 16:35, Pierre Haessig a écrit :
>> So I think this code indeed resamples the rastered plot image on a
>> shaken coordinate grid. I kind of understand that the noise on
>> coordinates is spatially smoothed by a 10px Gaussian Point Spread
>> Function (if I understand correctly...)
> I've implemented this processing in a tiny "image_shake" script.
> https://gist.github.com/3834536
> A nice occasion to learn how to use some scipy image processing functions...
>
> I've attached the before/after images because I didn't manage to put
> them in the Gist (it's not a plot image but gives the idea of line shaking).
>
> Now, I think it's unfortunately outside the frame of Fernando's
> challenge, because this script uses zero matplotlib methods!!
>
> Best,
> Pierre
From: Andreas M. <amu...@ai...> - 2012年10月04日 17:38:41
On 10/04/2012 03:51 PM, Benjamin Root wrote:
>
>
> On Thu, Oct 4, 2012 at 10:02 AM, Andreas Mueller 
> <amu...@ai... <mailto:amu...@ai...>> wrote:
>
> Hi everybody.
> I have been trying to save some animations I made and I
> encountered the problem mentioned here
> <http://sourceforge.net/mailarchive/forum.php?thread_name=CAKH0P%2BVLXthNCAZ1K2pKHYqqPiFHP5iXSFwJvEerVmvtmgGv0g%40mail.gmail.com&forum_name=matplotlib-devel>.
> I am using current master.
> To be precise, when I use
> anim.save("file.mp4", fps=10, extra_args=['-vcodec', 'libx264'])
> I get "RuntimeError: Error writing to file" from the agg backend.
> If I don't use the extra_args, it works, but I get very, very bad
> quality that can not be redeemed using bitrate.
> I have ffmpeg and libx264 installed. I also tried the mencoder by
> passing
> MencoderWriter() to save, but that resulted in a video where all
> frames are identical.
>
> Any help on this would be appreciated. Is there an easy way to
> just dump
> the frames? I can do the mencoder bit myself.
>
> Thanks,
> Andy
>
>
> Exactly which version of mpl are you using, and what is your 
> platform? This will help us diagnose what is going on.
>
 Thanks for the quick answer.
 I am not on the box but I used master from yesterday, so
 89482b21c8582d49a2ddc2865e472eb404fd07e2
 <https://github.com/matplotlib/matplotlib/commit/89482b21c8582d49a2ddc2865e472eb404fd07e2>,
 I guess.
 The platform is Ubuntu Precise (with loads of random Python
 packages, but that seems somewhat unrelated).
 Cheers,
 Andy
From: Benjamin R. <ben...@ou...> - 2012年10月04日 17:37:46
Replying back to the mailing list so that others can see your response....
On Thu, Oct 4, 2012 at 12:53 PM, Andreas Mueller
<amu...@ai...>wrote:
> Thanks for the quick answer.
> I am not on the box but I used master from yesterday, so
> 89482b21c8582d49a2ddc2865e472eb404fd07e2<https://github.com/matplotlib/matplotlib/commit/89482b21c8582d49a2ddc2865e472eb404fd07e2>,
> I guess.
> The platform is Ubuntu Precise (with loads of random Python packages, but
> that seems somewhat unrelated).
> Cheers,
> Andy
>
>
From: Pierre H. <pie...@cr...> - 2012年10月04日 16:09:58
Le 04/10/2012 16:35, Pierre Haessig a écrit :
> So I think this code indeed resamples the rastered plot image on a
> shaken coordinate grid. I kind of understand that the noise on
> coordinates is spatially smoothed by a 10px Gaussian Point Spread
> Function (if I understand correctly...)
I've implemented this processing in a tiny "image_shake" script.
https://gist.github.com/3834536
A nice occasion to learn how to use some scipy image processing functions...
I've attached the before/after images because I didn't manage to put
them in the Gist (it's not a plot image but gives the idea of line shaking).
Now, I think it's unfortunately outside the frame of Fernando's
challenge, because this script uses zero matplotlib methods!!
Best,
Pierre
From: Pierre H. <pie...@cr...> - 2012年10月04日 15:03:30
Attachments: signature.asc
Le 04/10/2012 16:54, Damon McDougall a écrit :
> Adding Gaussian noise to each point on a function doesn't look nice.
> That's why I produced a random function in Fourier space first. That
> way, random functions still have some sense of smoothness.
Mathematica code seems to use a Gaussian *smoothing* of a uniform noise.
I understand this as the spatial-domain-way (using convolution) to get
some smoothness while you've taken the frequency-domain path. It's a
matter of taste and I guess that both ways should be ok !
Best,
Pierre
From: Michael D. <md...@st...> - 2012年10月04日 15:01:54
On 10/04/2012 10:29 AM, Benjamin Root wrote:
>
>
> On Thu, Oct 4, 2012 at 10:11 AM, Michael Droettboom <md...@st... 
> <mailto:md...@st...>> wrote:
>
> Yes -- this would be a great application for the path filtering
> infrastructure that matplotlib has.
>
> Mike
>
>
> I agree with this idea. However, I don't think the code is set up to 
> allow for user-defined path filters. Maybe an AGG filter would be 
> sufficient in the short-term?
>
We have a complete set of path filters in C++ in path_converters.h that 
are used by most of the backends. It's not really user-defined because 
it can't be extended from Python, but it should be sufficient to put it 
in there and have it work everywhere.
Mike
From: Damon M. <dam...@gm...> - 2012年10月04日 14:54:31
On Thu, Oct 4, 2012 at 3:35 PM, Pierre Haessig <pie...@cr...> wrote:
> Le 04/10/2012 16:03, Jason Grout a écrit :
>> f@r means f(r)
>>
>> a~ImageConvolve~b means ImageConvolve(a,b) (~ treats an operator as infix)
>>
>> Table[..., {2}] means [... for i in range(2)]
>>
>> #+1& is a lambda function lambda x: x+1
>>
>> So I think it goes something like:
>>
>> def xkcdDistort(p):
>> r = ImagePad(Rasterize(p), 10, Padding='White')
>> (ix, iy) = [ImageConvolve(RandomImage([-1,1], ImageDimensions(r)),
>> GaussianMatrix(10))
>> for i in range(2)]
>> return ImagePad(ImageTransformation(r,
>> lambda coord: (coord[0]+15*ImageValue(ix, coord),
>> coord[1]+15*ImageValue(iy, coord)),
>> DataRange='Full'),
>> -5)
> Thanks a lot!
>
> It's the first time I encounter Mathematica syntax. Some of these
> functional notations are not so easy to follow for my unexperienced eyes
> but it makes this Mathematica code nicely compact.
>
> So I think this code indeed resamples the rastered plot image on a
> shaken coordinate grid. I kind of understand that the noise on
> coordinates is spatially smoothed by a 10px Gaussian Point Spread
> Function (if I understand correctly...)
>
> Best,
> Pierre
Adding Gaussian noise to each point on a function doesn't look nice.
That's why I produced a random function in Fourier space first. That
way, random functions still have some sense of smoothness.
-- 
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

Showing results of 355

<< < 1 .. 9 10 11 12 13 .. 15 > >> (Page 11 of 15)
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 によって変換されたページ (->オリジナル) /