XKCD style graphs?

I think I actually prefer your output over mine :slight_smile:
Nice job.

···

On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch <python@...4224...> 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

--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

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 <damon.mcdougall@...287...> wrote:

On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch <python@...4224...> 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 :slight_smile:
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
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

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.

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 > <damon.mcdougall@...287...> wrote:

On Thu, Oct 4, 2012 at 10:09 PM, Juergen Hasch <python@...4224...> 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 :slight_smile:
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
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

------------------------------------------------------------------------------
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
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

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).

···

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

--
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.
Shake an image to get kind of XKCD-style lines · GitHub
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
Matplotlib-users@lists.sourceforge.net
matplotlib-users List Signup and Options

This thread has made my week.

···

On Fri, Oct 5, 2012 at 10:13 AM, Matthias BUSSONNIER <bussonniermatthias@...287...> 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.
Shake an image to get kind of XKCD-style lines · GitHub
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

--
Damon McDougall
http://www.damon-is-a-geek.com
B2.39
Mathematics Institute
University of Warwick
Coventry
West Midlands
CV4 7AL
United Kingdom

Just FYI, wolfram now has a blog post up about it: Automating xkcd Diagrams: Transforming Serious to Funny—Wolfram Blog

Thanks,

Jason

···

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:

plotting - xkcd-style Plots - Mathematica Stack Exchange

The matlab and R version not quite so much, still for reference:

plot - xkcd style graphs in MATLAB - Stack Overflow
r - How can we make xkcd style graphs? - Stack Overflow

I automated things a little more, and learned a few things about matplotlib on the way.
Here is the result:

With xkcd-style.py here:

···

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 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).