Re: [Matplotlib-users] XKCD style graphs?

2012-10-11 Thread Juergen Hasch
Am 05.10.2012 11:13, schrieb Matthias BUSSONNIER: 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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-05 Thread Matthias BUSSONNIER
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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-05 Thread Damon McDougall
On Fri, Oct 5, 2012 at 10:13 AM, Matthias BUSSONNIER bussonniermatth...@gmail.com 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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-05 Thread Jason Grout
On 10/4/12 2:16 AM, Fernando Perez wrote: This would make for an awesome couple of examples for the gallery, the mathematica solutions look really pretty cool: http://mathematica.stackexchange.com/questions/11350/xkcd-style-graphs The matlab and R version not quite so much, still for

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Hi Fernando, Le 04/10/2012 09:16, Fernando Perez a écrit : This would make for an awesome couple of examples for the gallery, the mathematica solutions look really pretty cool: http://mathematica.stackexchange.com/questions/11350/xkcd-style-graphs I've never used Mathematica so that it's

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Damon McDougall
On Thu, Oct 4, 2012 at 10:44 AM, Damon McDougall damon.mcdoug...@gmail.com wrote: On Thu, Oct 4, 2012 at 10:02 AM, Pierre Haessig pierre.haes...@crans.org wrote: Hi Fernando, Le 04/10/2012 09:16, Fernando Perez a écrit : This would make for an awesome couple of examples for the gallery, the

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Phil Elson
Nice challenge Fernando! Damon, I love the solution! I do wonder whether we could do some quirky transform on the lines to achieve a similar result, rather than manipulating the data before plotting it. The benefit is that everything should then get randomly Xkcd-ed automatically - maybe I will

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Michael Droettboom
Yes -- this would be a great application for the path filtering infrastructure that matplotlib has. Mike On 10/04/2012 08:29 AM, Phil Elson wrote: Nice challenge Fernando! Damon, I love the solution! I do wonder whether we could do some quirky transform on the lines to achieve a similar

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Jason Grout
On 10/4/12 4:02 AM, Pierre Haessig wrote: Hi Fernando, Le 04/10/2012 09:16, Fernando Perez a écrit : This would make for an awesome couple of examples for the gallery, the mathematica solutions look really pretty cool: http://mathematica.stackexchange.com/questions/11350/xkcd-style-graphs

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Le 04/10/2012 14:29, Phil Elson a écrit : Damon, I love the solution! I do wonder whether we could do some quirky transform on the lines to achieve a similar result, rather than manipulating the data before plotting it. The benefit is that everything should then get randomly Xkcd-ed

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Michael Droettboom
This is just too cool of an idea to pass up -- I'm going to see if I can put together a PR that does this using the C++ path filtering stuff so it would be available everywhere. Mike On 10/04/2012 10:11 AM, Michael Droettboom wrote: Yes -- this would be a great application for the path

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Benjamin Root
On Thu, Oct 4, 2012 at 10:11 AM, Michael Droettboom md...@stsci.edu 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.

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
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 =

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
Le 04/10/2012 16:11, Michael Droettboom a écrit : Yes -- this would be a great application for the path filtering infrastructure that matplotlib has. Sounds way cooler than post-processing a raster plot image ! I'm not aware of this path filtering infrastructure. I guess it's a deeply buried

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Jason Grout
On 10/4/12 9:11 AM, Michael Droettboom wrote: Yes -- this would be a great application for the path filtering infrastructure that matplotlib has. Is that the same as the path effects features, like http://matplotlib.org/examples/pylab_examples/patheffect_demo.html ? Thanks, Jason

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Benjamin Root
On Thu, Oct 4, 2012 at 10:39 AM, Pierre Haessig pierre.haes...@crans.orgwrote: Le 04/10/2012 16:11, Michael Droettboom a écrit : Yes -- this would be a great application for the path filtering infrastructure that matplotlib has. Sounds way cooler than post-processing a raster plot image !

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Damon McDougall
On Thu, Oct 4, 2012 at 3:35 PM, Pierre Haessig pierre.haes...@crans.org 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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Michael Droettboom
On 10/04/2012 10:29 AM, Benjamin Root wrote: On Thu, Oct 4, 2012 at 10:11 AM, Michael Droettboom md...@stsci.edu mailto:md...@stsci.edu wrote: Yes -- this would be a great application for the path filtering infrastructure that matplotlib has. Mike I agree with this idea.

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Pierre Haessig
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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Juergen Hasch
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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Damon McDougall
On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch pyt...@elbonia.de 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

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Fernando Perez
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,

Re: [Matplotlib-users] XKCD style graphs?

2012-10-04 Thread Michael Droettboom
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,