|
From: Pierre H. <pie...@cr...> - 2012-10-04 14:22:19
|
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 |