How can I make below a certain value NaN so it does not effect my projection?

조회 수: 6 (최근 30일)
Anna Vaculik
Anna Vaculik 2018년 6월 22일
답변: Ameer Hamza 2018년 6월 22일
Hi, I am looking to project temperature on to a shapefile, I have a river that cuts through it and throws my colorbar off. Is there a command I can insert that says "any number less then 260 is NaN and should not be projected?"
Thank you!
  댓글 수: 3
Anna Vaculik
Anna Vaculik 2018년 6월 22일
Thank you for your quick response! Now that did work and my remaining values are what I need. However they still project on my map and throwing my color bar off. Can I assign my new NaN to be white? So then my only colored data is temperature?
Ameer Hamza
Ameer Hamza 2018년 6월 22일
Nan values should not affect the colormap, The color with which they are displayed depend on the plotting function. Can you attach the actual dataset? I believe there must be some other values affecting the color bar.

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

답변 (1개)

Ameer Hamza
Ameer Hamza 2018년 6월 22일
You can manually specify the color axis limit using caxis(). For example
caxis([260 300])
manually specify the lower limit to be 260 and the upper limit to be 300. The color for values beyond this limit will take the extreme values i.e. below 260 will take the color of 260 and above 300 will have the same color as 300. The same effect can also be obtained by using CLim property of the axis object.

카테고리

Help CenterFile Exchange에서 Grid Lines, Tick Values, and Labels에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by