Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Timothée Lecomte <timothee.lecomte@lp...>  20090313 11:30:30

Dear all, I am using matplotlib with a great pleasure, and I enjoy its capabilities. I have recently attended a conference where the invited speaker showed great visualizations of arrays from both experiments and simulations. His plots were basically looking like those produced by imshow, that is a luminance array rendered as a colormap image, but with the additionnal use of a shading, which gives a really great feeling to the image. You can feel the height of each part of the image. I have tried to find what software could have produced such a plot, and found the ReliefPlot function of Mathematica, which has precisely this purpose : rendering a colormap image from an array with a shading to give the perception of relief. The documentation and its examples are selfexplanatory : http://reference.wolfram.com/mathematica/ref/ReliefPlot.html (look in particular at the first "neat example" at the bottom of that page) The two "live" demonstrations illustrate this plot style quite well too : http://demonstrations.wolfram.com/ReliefShadedElevationMap/ http://demonstrations.wolfram.com/VoronoiImage/ So here are my questions : Is there a trick to generate an image with such a shading in matplotlib ? If not, do you know of a python tool that could help ? Where could I start if I want to code it myself in matplotlib ? Thanks for your help. Best regards, Timothée Lecomte  Laboratoire Pierre Aigrain, École Normale Supérieure 24, rue Lhomond 75005 Paris 
From: Jeff Whitaker <jswhit@fa...>  20090313 20:03:09
Attachments:
hillshade.py

Timothée Lecomte wrote: > Dear all, > > I am using matplotlib with a great pleasure, and I enjoy its capabilities. > I have recently attended a conference where the invited speaker showed > great visualizations of arrays from both experiments and simulations. > His plots were basically looking like those produced by imshow, that is > a luminance array rendered as a colormap image, but with the additionnal > use of a shading, which gives a really great feeling to the image. You > can feel the height of each part of the image. > > I have tried to find what software could have produced such a plot, and > found the ReliefPlot function of Mathematica, which has precisely this > purpose : rendering a colormap image from an array with a shading to > give the perception of relief. > > The documentation and its examples are selfexplanatory : > http://reference.wolfram.com/mathematica/ref/ReliefPlot.html > (look in particular at the first "neat example" at the bottom of that page) > > The two "live" demonstrations illustrate this plot style quite well too : > http://demonstrations.wolfram.com/ReliefShadedElevationMap/ > http://demonstrations.wolfram.com/VoronoiImage/ > > So here are my questions : > Is there a trick to generate an image with such a shading in matplotlib ? > If not, do you know of a python tool that could help ? > Where could I start if I want to code it myself in matplotlib ? > > Thanks for your help. > > Best regards, > > Timothée Lecomte > > Timothée: There is nothing builtin, but it would be a nice thing to have. Here's a proofofconcept hack that follows the approach used in the Generic Mapping Tools (explained here http://www.seismo.ethz.ch/gmt/doc/html/tutorial/node70.html), with some code borrowed from http://www.langarson.com.au/blog/?p=14. It's very rough, but if it looks promising to you I can try to polish it. Jeff  Jeffrey S. Whitaker Phone : (303)4976313 Meteorologist FAX : (303)4976449 NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... 325 Broadway Office : Skaggs Research Cntr 1D113 Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg 
From: Jeff Whitaker <jswhit@fa...>  20090313 21:10:08
Attachments:
hillshade.py

Jeff Whitaker wrote: > Timothée Lecomte wrote: >> Dear all, >> >> I am using matplotlib with a great pleasure, and I enjoy its >> capabilities. >> I have recently attended a conference where the invited speaker >> showed great visualizations of arrays from both experiments and >> simulations. His plots were basically looking like those produced by >> imshow, that is a luminance array rendered as a colormap image, but >> with the additionnal use of a shading, which gives a really great >> feeling to the image. You can feel the height of each part of the image. >> >> I have tried to find what software could have produced such a plot, >> and found the ReliefPlot function of Mathematica, which has precisely >> this purpose : rendering a colormap image from an array with a >> shading to give the perception of relief. >> >> The documentation and its examples are selfexplanatory : >> http://reference.wolfram.com/mathematica/ref/ReliefPlot.html >> (look in particular at the first "neat example" at the bottom of that >> page) >> >> The two "live" demonstrations illustrate this plot style quite well >> too : >> http://demonstrations.wolfram.com/ReliefShadedElevationMap/ >> http://demonstrations.wolfram.com/VoronoiImage/ >> >> So here are my questions : >> Is there a trick to generate an image with such a shading in >> matplotlib ? >> If not, do you know of a python tool that could help ? >> Where could I start if I want to code it myself in matplotlib ? >> >> Thanks for your help. >> >> Best regards, >> >> Timothée Lecomte >> >> > > Timothée: There is nothing builtin, but it would be a nice thing to > have. Here's a proofofconcept hack that follows the approach used > in the Generic Mapping Tools (explained here > http://www.seismo.ethz.ch/gmt/doc/html/tutorial/node70.html), with > some code borrowed from http://www.langarson.com.au/blog/?p=14. It's > very rough, but if it looks promising to you I can try to polish it. > > Jeff Found a bug, here's a fixed version. Jeff  Jeffrey S. Whitaker Phone : (303)4976313 Meteorologist FAX : (303)4976449 NOAA/OAR/PSD R/PSD1 Email : Jeffrey.S.Whitaker@... 325 Broadway Office : Skaggs Research Cntr 1D113 Boulder, CO, USA 803033328 Web : http://tinyurl.com/5telg 
From: Timothée Lecomte <timothee.lecomte@lp...>  20090313 22:24:20

Jeff Whitaker wrote: > Jeff Whitaker wrote: >> Timothée Lecomte wrote: >>> Dear all, >>> >>> I am using matplotlib with a great pleasure, and I enjoy its >>> capabilities. >>> I have recently attended a conference where the invited speaker >>> showed great visualizations of arrays from both experiments and >>> simulations. His plots were basically looking like those produced by >>> imshow, that is a luminance array rendered as a colormap image, but >>> with the additionnal use of a shading, which gives a really great >>> feeling to the image. You can feel the height of each part of the >>> image. >>> >>> I have tried to find what software could have produced such a plot, >>> and found the ReliefPlot function of Mathematica, which has >>> precisely this purpose : rendering a colormap image from an array >>> with a shading to give the perception of relief. >>> >>> The documentation and its examples are selfexplanatory : >>> http://reference.wolfram.com/mathematica/ref/ReliefPlot.html >>> (look in particular at the first "neat example" at the bottom of >>> that page) >>> >>> The two "live" demonstrations illustrate this plot style quite well >>> too : >>> http://demonstrations.wolfram.com/ReliefShadedElevationMap/ >>> http://demonstrations.wolfram.com/VoronoiImage/ >>> >>> So here are my questions : >>> Is there a trick to generate an image with such a shading in >>> matplotlib ? >>> If not, do you know of a python tool that could help ? >>> Where could I start if I want to code it myself in matplotlib ? >>> >>> Thanks for your help. >>> >>> Best regards, >>> >>> Timothée Lecomte >>> >>> >> >> Timothée: There is nothing builtin, but it would be a nice thing to >> have. Here's a proofofconcept hack that follows the approach used >> in the Generic Mapping Tools (explained here >> http://www.seismo.ethz.ch/gmt/doc/html/tutorial/node70.html), with >> some code borrowed from http://www.langarson.com.au/blog/?p=14. It's >> very rough, but if it looks promising to you I can try to polish it. >> >> Jeff > > Found a bug, here's a fixed version. > > Jeff > Hi Jeff, Sure it looks promising ! The example you provided is very nice. I will try on my own data on Monday, and I'll let you know if it gives a good result too. Thank you very much for that very fast hack ! Best regards, Timothée 
From: Jeff Whitaker <jswhit@fa...>  20090314 13:24:00

Timothée Lecomte wrote: > Jeff Whitaker wrote: >> Jeff Whitaker wrote: >>> Timothée Lecomte wrote: >>>> Dear all, >>>> >>>> I am using matplotlib with a great pleasure, and I enjoy its >>>> capabilities. >>>> I have recently attended a conference where the invited speaker >>>> showed great visualizations of arrays from both experiments and >>>> simulations. His plots were basically looking like those produced >>>> by imshow, that is a luminance array rendered as a colormap image, >>>> but with the additionnal use of a shading, which gives a really >>>> great feeling to the image. You can feel the height of each part of >>>> the image. >>>> >>>> I have tried to find what software could have produced such a plot, >>>> and found the ReliefPlot function of Mathematica, which has >>>> precisely this purpose : rendering a colormap image from an array >>>> with a shading to give the perception of relief. >>>> >>>> The documentation and its examples are selfexplanatory : >>>> http://reference.wolfram.com/mathematica/ref/ReliefPlot.html >>>> (look in particular at the first "neat example" at the bottom of >>>> that page) >>>> >>>> The two "live" demonstrations illustrate this plot style quite well >>>> too : >>>> http://demonstrations.wolfram.com/ReliefShadedElevationMap/ >>>> http://demonstrations.wolfram.com/VoronoiImage/ >>>> >>>> So here are my questions : >>>> Is there a trick to generate an image with such a shading in >>>> matplotlib ? >>>> If not, do you know of a python tool that could help ? >>>> Where could I start if I want to code it myself in matplotlib ? >>>> >>>> Thanks for your help. >>>> >>>> Best regards, >>>> >>>> Timothée Lecomte >>>> >>>> >>> >>> Timothée: There is nothing builtin, but it would be a nice thing >>> to have. Here's a proofofconcept hack that follows the approach >>> used in the Generic Mapping Tools (explained here >>> http://www.seismo.ethz.ch/gmt/doc/html/tutorial/node70.html), with >>> some code borrowed from http://www.langarson.com.au/blog/?p=14. >>> It's very rough, but if it looks promising to you I can try to >>> polish it. >>> >>> Jeff >> >> Found a bug, here's a fixed version. >> >> Jeff >> > Hi Jeff, > > Sure it looks promising ! The example you provided is very nice. I > will try on my own data on Monday, and I'll let you know if it gives a > good result too. Thank you very much for that very fast hack ! > > Best regards, > > Timothée > > Timothée: I've added this capability in svn, along with an example (shading_example.py) to show how to use it. Thanks for suggesting it. Jeff 
From: Ryan May <rmay31@gm...>  20090316 01:07:45
Attachments:
Message as HTML

On Sat, Mar 14, 2009 at 8:23 AM, Jeff Whitaker <jswhit@...> wrote: > Timothée Lecomte wrote: > > Jeff Whitaker wrote: > >> Jeff Whitaker wrote: > >>> Timothée Lecomte wrote: > >>>> Dear all, > >>>> > >>>> I am using matplotlib with a great pleasure, and I enjoy its > >>>> capabilities. > >>>> I have recently attended a conference where the invited speaker > >>>> showed great visualizations of arrays from both experiments and > >>>> simulations. His plots were basically looking like those produced > >>>> by imshow, that is a luminance array rendered as a colormap image, > >>>> but with the additionnal use of a shading, which gives a really > >>>> great feeling to the image. You can feel the height of each part of > >>>> the image. > >>>> > >>>> I have tried to find what software could have produced such a plot, > >>>> and found the ReliefPlot function of Mathematica, which has > >>>> precisely this purpose : rendering a colormap image from an array > >>>> with a shading to give the perception of relief. > >>>> > >>>> The documentation and its examples are selfexplanatory : > >>>> http://reference.wolfram.com/mathematica/ref/ReliefPlot.html > >>>> (look in particular at the first "neat example" at the bottom of > >>>> that page) > >>>> > >>>> The two "live" demonstrations illustrate this plot style quite well > >>>> too : > >>>> http://demonstrations.wolfram.com/ReliefShadedElevationMap/ > >>>> http://demonstrations.wolfram.com/VoronoiImage/ > >>>> > >>>> So here are my questions : > >>>> Is there a trick to generate an image with such a shading in > >>>> matplotlib ? > >>>> If not, do you know of a python tool that could help ? > >>>> Where could I start if I want to code it myself in matplotlib ? > >>>> > >>>> Thanks for your help. > >>>> > >>>> Best regards, > >>>> > >>>> Timothée Lecomte > >>>> > >>>> > >>> > >>> Timothée: There is nothing builtin, but it would be a nice thing > >>> to have. Here's a proofofconcept hack that follows the approach > >>> used in the Generic Mapping Tools (explained here > >>> http://www.seismo.ethz.ch/gmt/doc/html/tutorial/node70.html), with > >>> some code borrowed from http://www.langarson.com.au/blog/?p=14. > >>> It's very rough, but if it looks promising to you I can try to > >>> polish it. > >>> > >>> Jeff > >> > >> Found a bug, here's a fixed version. > >> > >> Jeff > >> > > Hi Jeff, > > > > Sure it looks promising ! The example you provided is very nice. I > > will try on my own data on Monday, and I'll let you know if it gives a > > good result too. Thank you very much for that very fast hack ! > > > > Best regards, > > > > Timothée > > > > > Timothée: I've added this capability in svn, along with an example > (shading_example.py) to show how to use it. Thanks for suggesting it. > That looks awesome. Very nice work, Jeff. Ryan  Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma 