필터 지우기
필터 지우기

Coloring legend, function surf

조회 수: 28 (최근 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
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 CenterFile Exchange에서 Legend에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by