Matlab's contour and colormap ignores input values

1 回表示 (過去 30 日間)
mldmnn
mldmnn 2018 年 8 月 6 日
コメント済み: Adam Danz 2018 年 8 月 6 日
I'm plotting a contour using the contourf function in Matlab and using sound pressure levels and the associated coordinates as an input. The maximum SPL is over 78 dB. The contourf function somehow is only taking values until 75 dB into account but I need a finer resolution what is covering values until the maximum one. Now all values over 75 dB are in the same color.
% Plotting
figure();
contourf(xObsGnewGrid,yObsGnewGrid,obsSplMaxInterp,'LineColor','none');
axis equal;
clrb = colorbar('eastoutside','Ticks',[0:2:100]);
zlab = get(clrb,'ylabel');
set(zlab,'String','SPL [dBA]');
ylabel('Lateral Position [m]');
xlabel('Longitudinal Position [m]');
xlabel('Longitudinal Position [m]');

採用された回答

mldmnn
mldmnn 2018 年 8 月 6 日
An increase of the contour levels worked for me!
  1 件のコメント
Adam Danz
Adam Danz 2018 年 8 月 6 日
If Jonas' solution worked for you, you should accept that answer, not yours (which is only a comment). That way when people reference this question in the future, they will be pointed to the correct answer.

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

その他の回答 (1 件)

jonas
jonas 2018 年 8 月 6 日
編集済み: jonas 2018 年 8 月 6 日
You can increase the resolution by adjusting the levelstep property
contourf(x,y,z,'levelstep',2)
Adjust the limits on the colorbar by
colorbar('limits',[min(obsSplMaxInterp(:) max(obsSplMaxInterp(:))])

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by