Coloring legend, function surf

36 ビュー (過去 30 日間)
Frane Calusic
Frane Calusic 2019 年 8 月 11 日
コメント済み: Frane Calusic 2019 年 8 月 15 日
Hello there,
I've allready asked similar question to this one in the following link https://www.mathworks.com/matlabcentral/answers/470219-coloring-in-plots-legend. But as you can see in the last comment in the thread, I did change the color but I need to use the X-Y view for something and you can see the difference. Is it possible to change the colors in the legend or something?
image.jpg
This is the first picture (original).
image1.jpg
This is when I changed the color but the X-Y view is different as you can see. The legend color did change but i need to have the same size as in the 1st picture.
Thanks.
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 8 月 11 日
Can you share the code of figure 1?
Frane Calusic
Frane Calusic 2019 年 8 月 12 日
Here is the code:
clc
clear all
close all
mu_bura = [25 45];
sigma_bura = [20 10; 10 50];
x1 = 0:1:50;
x2 = 0:1:180;
[X1,X2] = meshgrid(x1,x2);
X = [X1(:) X2(:)];
y_bura = mvnpdf(X,mu_bura,sigma_bura);
y_bura = reshape(y_bura,length(x2),length(x1));
mu_jugo = [10 130];
sigma_jugo= [15 5; 5 30];
y_jugo = mvnpdf(X,mu_jugo,sigma_jugo);
y_jugo = reshape(y_jugo,length(x2),length(x1));
%3D
figure
surf(X1, X2,y_bura)
set(gca,'FontName','Times','FontSize',12)
hold on
surf(X1, X2,y_jugo)
set(gca,'FontName','Times','FontSize',12)
legend({'Bura','Jugo'},'FontName','Times','FontSize',12)
colormap(jet)
axis tight
xlabel('Brzina')
ylabel('Kut')

サインインしてコメントする。

回答 (1 件)

boris vuleta
boris vuleta 2019 年 8 月 11 日
Probaj ovo mozda ti pomogne https://www.mathworks.com/help/matlab/ref/matlab.graphics.illustration.legend-properties.html Sretno ?
  4 件のコメント
boris vuleta
boris vuleta 2019 年 8 月 14 日
Frane Calusic
Frane Calusic 2019 年 8 月 15 日
vidis ovu 3d sliku i pogledaj tu legend..vidis da je iste boje..a ja trebam stavit da se razlikuje tj da se vidi razlika izmedu bure i juga

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeLegend についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by