Setting color to certain data in 3d plot, keeping rest of data following colormap
I am plotting data in a 3d heatmap using the bar3 command. I’d like to set some of the data to a certain color that is not included in the colorscheme of the legend bar, while keeping the rest of the data following the color map. The code I’m currently using is:
b=bar3(error);
set(gca,’XTickLabel’,[2.5 5 7.5 10])
set(gca,’YTickLabel’,[0 50 100 150 200 250])
ylim([0 20.5]);
colorbar
colormap turbo;
caxis([0 100]);
for k = 1:length(b)
zdata = b(k).ZData;
b(k).CData = zdata;
b(k).FaceColor = ‘interp’;
endI am plotting data in a 3d heatmap using the bar3 command. I’d like to set some of the data to a certain color that is not included in the colorscheme of the legend bar, while keeping the rest of the data following the color map. The code I’m currently using is:
b=bar3(error);
set(gca,’XTickLabel’,[2.5 5 7.5 10])
set(gca,’YTickLabel’,[0 50 100 150 200 250])
ylim([0 20.5]);
colorbar
colormap turbo;
caxis([0 100]);
for k = 1:length(b)
zdata = b(k).ZData;
b(k).CData = zdata;
b(k).FaceColor = ‘interp’;
end I am plotting data in a 3d heatmap using the bar3 command. I’d like to set some of the data to a certain color that is not included in the colorscheme of the legend bar, while keeping the rest of the data following the color map. The code I’m currently using is:
b=bar3(error);
set(gca,’XTickLabel’,[2.5 5 7.5 10])
set(gca,’YTickLabel’,[0 50 100 150 200 250])
ylim([0 20.5]);
colorbar
colormap turbo;
caxis([0 100]);
for k = 1:length(b)
zdata = b(k).ZData;
b(k).CData = zdata;
b(k).FaceColor = ‘interp’;
end bar3, bar color MATLAB Answers — New Questions