How to plot a contour in a fast scatter plot

4 ビュー (過去 30 日間)
checkMAT
checkMAT 2019 年 7 月 31 日
コメント済み: Walter Roberson 2019 年 8 月 1 日
Hi everyone,
I have a temperature field calculated through markers advection and I would like to plot the 600 °C contour.
I am using the fastscatter function to obtain the temperature field(Fastscatter(xm,ym,Tm)), where xm and ym represent markers coordinate and Tm the markers temeprature and are calculated accordingly to particular functions. I just need the contour to visualize its evolution over time, I don't need it for further calculations.
Thanks!
  3 件のコメント
checkMAT
checkMAT 2019 年 7 月 31 日
yes, that's the function. However my question is about plotting contours on top of that.
Walter Roberson
Walter Roberson 2019 年 7 月 31 日
fastscatter is not part of MATLAB so it is necessary to identify the source of it so that people know what it does.

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

採用された回答

Walter Roberson
Walter Roberson 2019 年 7 月 31 日
編集済み: Walter Roberson 2019 年 8 月 1 日
  4 件のコメント
checkMAT
checkMAT 2019 年 7 月 31 日
thanks! it is kind of working. the contour is plotted but is hidden within the markers, because the markers density is pretty high (high resolution). Do you know if I can increase the thinckness of the contour? I tried to make it black, but is not visible.
Walter Roberson
Walter Roberson 2019 年 7 月 31 日
編集済み: Walter Roberson 2019 年 8 月 1 日

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

その他の回答 (1 件)

checkMAT
checkMAT 2019 年 8 月 1 日
I managed to plot the contours(I attached an image of the results), however the 'clabel(C,h)' function does not work' and I am not able to modify the colors and thickness of the contours. I can only put contours label using 'clabel(C,'Color','r')', but this is not what I need. Any suggestions?
This is the script I am using and the error I have:
tri=delaunay(xm,ym); % xm and ym represent my marker positions in the grid and Tm the teperature field generate as result of marker advection
[C,h]=tricontour(tri,xm,ym,Tm,14);
axis ij
clabel(C,h,'Color','k')
Error using clabel (line 77)
Not enough contour handles.
  1 件のコメント
Walter Roberson
Walter Roberson 2019 年 8 月 1 日
contour() itself returns https://www.mathworks.com/help/matlab/ref/matlab.graphics.chart.primitive.contour-properties.html Contour objects. clabel() expects those objects, but tricontour() returns patch objects.
Patch properties include EdgeColor and LineWidth
To label the contours that are patch objects, you will have to text() somewhere appropriate. True contour objects are able to internally break the line and put in the text somewhere "nice", but you will not be able to do that at all easily for patch objects.

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

カテゴリ

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