How to contour plot from columns of data?
조회 수: 3 (최근 30일)
이전 댓글 표시
Hi. I have three columns of data. The first two columns are the x and y coordinates while the third one is the isoline column. Can anyone help me how to make a single contour plot in Matlab. I have attached the file here. Please help. Thanks.
댓글 수: 0
채택된 답변
Simon Chan
2023년 2월 24일
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/1305315/contour%20plot%20data.txt';
opts = detectImportOptions(filename);
opts.DataLines = [9 Inf];
opts.VariableNames = {'x','y','IsoLevel'};
rawdata = readtable(filename,opts);
s=scatter(rawdata.x,rawdata.y,[],rawdata.IsoLevel);
댓글 수: 4
Simon Chan
2023년 2월 24일
You may try to use the dot as the marker and adjust the LineWidth property in order for the plot to look like a line.
s=scatter(rawdata.x,rawdata.y,[],rawdata.IsoLevel,'.','LineWidth',1);
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Contour Plots에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!