Thanks to both for your further comments.
downloaded and followed step by step.
http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/surface_shading.ipynb/%3Fdl%3D0
the pegtop algorithm. It works nicely with the data.
intensity as suggested. Eric you will notce I did include the line
not working.
in my code, and if there is a way to make it work. The reason is that this
https://books.google.ca/books?id=dP2iACuzq34C&q=figure+20#v=snippet&q=a%20time%20slice%20through%20a%20survey%20acquired%20over%20the%20Central%20Basin%20Platform%2C%20Texas%2C%20U.S.A.%2C%20using%20a%203D&f=false
Any further insight would be really appreciated.
Post by Joe KingtonI think you're asking how to blend a custom intensity image with an rgb
image. (I'm traveling and just have my phone, so you'll have to excuse my
lack of examples.)
There are several ways to do this. Basically, it's analogous to "blend
modes" in Photoshop etc.
Have a look at the matplotlib.colors.LightSource.blend_overlay and
blend_soft_light functions in the current github head. (And also
http://matplotlib.org/devdocs/examples/specialty_plots/topographic_hillsh
ading.html )
If you're working with 1.4.x, though, you won't have those functions.
However, the math is very simple. Have a look at the code in those
functions in the github head. It's basically a one liner.
You'll need both the 4-band rgba image and the 1 band intensity/hillshade
image to be floating point arrays scaled from 0-1. However, this is the
default in matplotlib.
How that helps a bit, and sorry again for the lack of examples!
Joe
OK, I understand.
Could you suggest a way to reduce that 3D array to a 2D array and plot it
with a specific colormap, while preserving the shading?
I did something similar in Matlab
https://mycarta.wordpress.com/2012/04/05/visualization-tips-for-geoscient
ists-matlab-part-ii/
But it took using some custom functions and a ton of asking and
tinkering, and I'm not quite at that level with matplotlib, so any
suggestion would be appreciated
Thanks,
Matteo
Post by Eric FiringColormapping occurs only when you give imshow a 2-D array of numbers to
be mapped; when you feed it a 3-D array of RGB values, it simply shows
those colors. For colormapping to occur, it must be done on a 2-D
array as a step leading up to the generation of your img_array.
Eric
Post by Matteo NiccoliI posted a question on stackoverflow about creating with making my
own shading effect (I want to use horizontal gradient for the
shading).
http://stackoverflow.com/questions/30310002/issue-creating-map-shadin
g- in-matplotlib-imshow-by-setting-opacity-to-data-gradi
Unfortunately I cannot share the data because I am using it for a
http://nbviewer.ipython.org/urls/dl.dropbox.com/s/2pfhla9rn66lsbv/sur
fa ce_shading.ipynb/%3Fdl%3D0
The shading using gradient is implemented in two ways as suggested in
the answer. What I do not understand is why the last plot comes out
with a rainbow-like colors, when I did specify cubehelix as colormap.
hsv = cl.rgb_to_hsv(img_array[:, :, :3]) hsv[:, :, 2] = tdx_n rgb =
cl.hsv_to_rgb(hsv) plt.imshow(rgb[4:-3,4:-3], cmap='cubehelix')
plt.show()
Am I doing something wrong or is this unexpected behavior; is there a
workaround?
Thanks
Matteo
-----------------------------------------------------------------------
--
-----
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
-------------------------------------------------------------------------
-----
One dashboard for servers and applications across Physical-Virtual-Cloud
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Matplotlib-users mailing list
https://lists.sourceforge.net/lists/listinfo/matplotlib-users