Azzera filtri
Azzera filtri

2D image in 3D plot with partial transparency

2 visualizzazioni (ultimi 30 giorni)
Kyle Wang
Kyle Wang il 2 Apr 2015
I used surf to plot a 2D matrix as a 3D model, then I want to place imagesc(matrix) on top of this 3D model.Moreover, I want to set part of the 2D image transparent. I understand the texturemap trick, but such method doesn't allow me to set alpha data to my 2D image. Any suggestion, many thanks.
surf(sampleMatrix); hold on
xLimit = xlim;
yLimit = ylim;
alphaMap = zeros(size(sampleMatrix));
alphaMap(:) = 0.5;
alphaMap(sampleMatrix == 5) = 0;
surf([xLimit(1) xLimit(2)],[yLimit(1) yLimit(2)],repmat(70, [2 2]),...
sampleMatrix, 'Facecolor','texturemap', 'alphadata', alphaMap);
The last line doesn't work :(

Risposte (0)

Categorie

Scopri di più su Lighting, Transparency, and Shading in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by