Hello, I have two question
Show older comments
Hello, I have two question-
- I need to plot the below figure in a new form which should show only the region which is blue in color into red color and in a transparent cube. The figure should not show any other mesh except the blue region (in red with mesh).
- Second thing is at present the dimension displaying on each axis is according to the size of meshgrid(49*33*33), I need to change it to actual room size (12*4*5).
Thanks for your help

8 Comments
Jan
on 28 May 2017
Show us the code, which is used to create the current diagram. Then it is very easy to suggest the changes.
Nikita Johnson
on 28 May 2017
Edited: dpb
on 28 May 2017
Nikita Johnson
on 29 May 2017
Walter Roberson
on 29 May 2017
You plot does not have the same colormap as your code. colormap hsv starts with pure red at its lowest bounds, and goes up through a number of colors, ending in impure red at its top end. Your plot starts at yellow at its bottom end and goes to blue at its top end. Your colormap does not correspond to any of the pre-defined colormaps.
This is important because you have defined your boundary in terms of "blue", and in order to figure out what that means in terms of data values, we need to look at the colormap values and examine the RGB components and try to figure out from them which entries are "blue", and then use that information to project back to data values. If we knew the construction rules for the colormap then we might be able to use the defining principles to try to sensibly answer the question "What is 'blue' ?" Does "blue" include teal? Does it include "azure" ? What is the dividing line between "blue" and "purple" ?
Now, if we had seen your real code, then just maybe we would have seen you write integer values into data_inter and construct a custom colormap and perhaps the combination would have been enough for us to unambiguously figure out what range of values in data_inter had to be plotted separately.
Or, you know, you could just tell us.
Nikita Johnson
on 30 May 2017
Walter Roberson
on 30 May 2017
We are not able to assist you until you define what "blue" is exactly (since you said it had to be the "blue" that was copied and we do not know what "blue" means); or until you define the range of values in data_inter that you want to be copied to the new figure.
Nikita Johnson
on 30 May 2017
Edited: Nikita Johnson
on 30 May 2017
Nikita Johnson
on 31 May 2017
Answers (1)
Walter Roberson
on 11 Jun 2017
figure
xslice = (1:1:33); %YZ plane over different x-values
yslice = (1:1:49); %XZ plane over different Y-values
zslice = (1:1:33); %XY plane over different z-values
[X, Y, Z] = meshgrid(xslice, yslice, zslice );
data_copy = data_inter;
data_copy(data_copy ~= 1) = nan;
hi = slice(X,Y,Z,data_inter,[1,33],[1,49],1);
xlabel('x-axis')
ylabel('y-axis') %Mind this , explained above*
zlabel('z-axis')
colormap([0 0 0; 1 0 0]);
caxis([0 1])
3 Comments
Nikita Johnson
on 29 Jun 2017
Nikita Johnson
on 29 Jun 2017
Edited: Nikita Johnson
on 29 Jun 2017
Walter Roberson
on 5 Jul 2017
You do not appear to have attached your data for us to test with.
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

