How to FIx non uniform Ranges in contour plots

3 ビュー (過去 30 日間)
Jayant chouragade
Jayant chouragade 2021 年 8 月 20 日
コメント済み: Chunru 2021 年 8 月 20 日
Hi all,
I have X,Y,Z matix. I would like to plot contours as per the follwoing ranges of Z.
For
Z<50 --> Color1.
50<Z<=100 -->Color2.
100<Z<=500 -->Color3.
500<Z<=1000 -->Color4.
1000<Z<=5000 -->Color5.
5000<Z -->Color6.
And want to have evenly spaced color bar with tick labels as (0-50, 50-100,10-500,500-1000,1000-5000,>5000) at the middle of respective colors.
Looking forward to tips and tricks.
best
jayant

採用された回答

Chunru
Chunru 2021 年 8 月 20 日
[X,Y,Z] = peaks(50);
levels = [-10 -8 -5 -2 0 4 6 8];
contourf(X,Y,Z, levels,'ShowText','on')
  2 件のコメント
Jayant chouragade
Jayant chouragade 2021 年 8 月 20 日
thanks. How do I set the color of contours , and have evenly spaced color bar with tick labels.
Chunru
Chunru 2021 年 8 月 20 日
[X,Y,Z] = peaks(50);
levels = [-10 -8 -5 -2 0 4 6 8];
contourf(X,Y,Z, levels,'ShowText','on');
colorbar

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by