Matlab: How can I specify the RGB color and line style for each curve in a waterfall plot?
6 ビュー (過去 30 日間)
古いコメントを表示
I want to plot my data in a waterfall style in a way that each curve has a specific line style and color without having under the curves filled with a color. I am using the below code as an example. I appreciate any help!
figure
xaxis = linspace(-pi/2,3/2*pi, 200);
variation = [ 0.5 1 5 10 7 3.5 8 0.6 4 7];
spectralSeries = abs(sin(xaxis)'*ones(1,10) + sin(xaxis'*variation)*0.25);
h = waterfall(spectralSeries');
cameratoolbar;
%%
set(h, 'FaceColor', 'flat');
set(h, 'FaceAlpha', 1);
set(h, 'EdgeColor', 'k');
set(h, 'FaceVertexCData', rand(10,3));
0 件のコメント
回答 (1 件)
Star Strider
2023 年 3 月 10 日
figure
xaxis = linspace(-pi/2,3/2*pi, 200);
variation = [ 0.5 1 5 10 7 3.5 8 0.6 4 7];
spectralSeries = abs(sin(xaxis)'*ones(1,10) + sin(xaxis'*variation)*0.25);
[X,Y] = ndgrid(xaxis,(1:numel(variation)));
figure
plot3(X, Y, spectralSeries)
yticks(1:numel(variation))
grid
xlabel('X')
ylabel('Y')
Ax = gca;
Ax.ColorOrder = jet(numel(variation));
Set the ColorOrder property to define the line colours.
.
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!