|
From: Joy m. m. <joy...@gm...> - 2014-10-15 17:42:16
|
pardon the query if it seems dumb, but why don't you do a savefig() after plotting the data and then convert it to any format you like? alternatively, contour() and contourf() both create paths that can be accessed: cf = contourf(.....) output = cf.collections.pop() paths = output.get_paths()[i] # for the various contours the x,y coordinates can then be accessed as xcoords = paths.vertices.transpose()[0] ycoords = paths.vertices.transpose()[1] you can then do whatever you wish with them. Joy On Wed, Oct 15, 2014 at 9:11 PM, David Hoese <dh...@gm...> wrote: > I've been searching and reading through source code and google searches > to see if this is possible, but no luck so far. I'm basically trying to > map some data using Basemap, use contourf to map it to an image, and > then put that image in a geotiff (or other format) for use in other GIS > programs. I have other tools for remapping data and creating geotiffs, > but the contour image looks better. All I would need to get this to work > would be an array representing the image inside the axes of a contourf > plot. I found a lot of geotiff -> Basemap png results, but I would like > the reverse. > > Since the plots are made using paths/patches I'm guessing I would have > to have a backend render the image and then extract the image somehow. > Does anyone have some tips or tricks to do something like this? Or am I > thinking about this completely wrong? > > Thanks for any help and if you could CC me in any replies it would be > much appreciated. > > -Dave > > > ------------------------------------------------------------------------------ > Comprehensive Server Monitoring with Site24x7. > Monitor 10 servers for $9/Month. > Get alerted through email, SMS, voice calls or mobile push notifications. > Take corrective actions from your mobile device. > http://p.sf.net/sfu/Zoho > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- The best ruler, when he finishes his tasks and completes his affairs, the people say “It all happened naturally” - Te Tao Ch'ing |