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 automatically - maybe I
> will save that one for a rainy day....
>
>
A different solution to get the shaken effect on every graphic items is
the post-processing of a raster rendering of the plot. I think this is
what was proposed with Mathematica though I'm really unfamiliar with its
syntax

One way I see to "shake" on image would be to use
scipy.ndimage.interpolation.map_coordinates [1] to interpolate the
rastered plot image with a "shaken grid". This shaken grid would be a
regular 2D indexing grid + some 2D noise, carefully tuned to have a bit
of spatial correlation.
I'm not so familiar with image processing in Python though, so there may
be better solutions I'm not aware of.

Best,
Pierre

[1]
http://docs.scipy.org/doc/scipy/reference/generated/scipy.ndimage.interpolation.map_coordinates.htm

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Reply via email to