No degradation color on the 3D plot

조회 수: 1 (최근 30일)
Lasfitri Rosanty Sinaga
Lasfitri Rosanty Sinaga 2022년 12월 5일
편집: Rajeev 2023년 2월 24일
I need more help please. I want to plot 3D function (x,y,z), the result is actually right (around xe-4 until xe-2) but there is no degradation color on my plot that showing the limit line for z-variable. Is the mistake on the Lmin Lmax Input?
So much thanks in advance!
%sensitivity analysis
%lifetime and efficiency
lifetime=linspace(30,5,20);
efficiency=linspace(0.3,0.05,20);
l=length(lifetime);
e=length(efficiency);
H2MSAeff=zeros(l,e);
for i=1:e
for j=1:l
[aa]=H2MSA_conversion(lifetime(j),efficiency(i), msaprice);
plot_H2MSA_conversion=[aa];
H2MSAeff(i,j)=plot_H2MSA_conversion(key);
end
end
efficiency=efficiency*100;
[Lifetime,Efficiency,H2MSAeff]=griddata(lifetime,efficiency,H2MSAeff,linspace(min(lifetime),...
max(lifetime),100)',linspace(min(efficiency),max(efficiency),100),'linear');
if figurekey==1
Lmin=min(min(H2MSAeff));Lmax=max(max(H2MSAeff));
L=[Lmin,0.00001,0.0001,0.0002,0.0004,0.001,Lmax];
L=roundn(L,-1);
[C,h]=contourf(Lifetime,Efficiency,H2MSAeff,L,'ShowText','on','color','white');
clabel(C,h,'FontSize',13,'Color','w'); %Set curve label font size
colorbar;
colormap(parula);
xlabel('Lifetime(year)');
ylabel('STH Efficiency(%)');
m = get(gca,'XTickLabel'); % Set font size of axis
set(gca,'XTickLabel',m,'fontsize',13);
end
if figurekey~=1
end
  댓글 수: 1
Divyanshu
Divyanshu 2023년 2월 23일
Can you provide more information regarding the values of the variables and functions called, so that it would be easier to reproduce the issue?

댓글을 달려면 로그인하십시오.

답변 (1개)

Rajeev
Rajeev 2023년 2월 24일
편집: Rajeev 2023년 2월 24일
It seems like the issue might be with the way the contour levels are set using:
% Original contour levels
L=[Lmin,0.00001,0.0001,0.0002,0.0004,0.001,Lmax];
The values in L are all very close to each other and may not give you the desired colour degradation. You can try changing the values in L to have a larger range, for example,
% Contour levels with larger spacing in between
L=[Lmin,0.0001,0.001,0.01,0.1,1,Lmax];.
Also, the colormap can be adjusted to better represent the range of values in your data. For example, you can try using the ‘jet’ colormap instead of ‘parula’ by changing colormap(parula) to colormap(jet).

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by