Contour lines over contourf 2D matrix

4 ビュー (過去 30 日間)
Michael
Michael 2016 年 5 月 14 日
コメント済み: Star Strider 2016 年 5 月 15 日
I would like to plot thick lines where y = n as a contour line on top of a contourf plot (like the image attached). How can I do this?
I have 3 Matrices I use to contourf: xi,yi,zi - all same dimensions (200x100). I want to use zi data to create the superimposed contours. I do not wish to set the levels within contourf as this is not useful for what I wish to do. I would like to control the contours completely seperate.
For an extra bonus point, it will be nice to have corresponding labels.

採用された回答

Star Strider
Star Strider 2016 年 5 月 14 日
Use the hold function, and plot only the lines of interest using a second call to the contour (not contourf) function.
See the contour documentation for Display Single Contour Line for details.
  2 件のコメント
Michael
Michael 2016 年 5 月 15 日
Thanks! works perfectly.
I was stupid and left in the 'LineStyle','none' when trying this before so I thought it wasn't possible this way...
Star Strider
Star Strider 2016 年 5 月 15 日
My pleasure!
Not stupid — just an experiment that didn’t work out as you wanted. That’s how we learn!

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by