フィルターのクリア

may I ask why I cannot get the label [0.8 0.5 0.25 0.1]?

3 ビュー (過去 30 日間)
CHENG-YI LEE
CHENG-YI LEE 2022 年 6 月 17 日
回答済み: Ritish Sehgal 2022 年 6 月 30 日
clc;%清理命令行窗口
clear all;%清理工作区
%读取excel数据,同目录下
tx=xlsread('co.xlsx');
tx(:,1)=[];
tx(32,:)=[];
z=tx;
figure(1)
pcolor(z)
shading interp;
colorbar; colormap(jet);
xlabel('W1');ylabel('W2');
hold on;
title('C0')
contour(z,[0.8 0.5 0.25 0.1],'b--');
clabel(z,'LabelSpacing',1, 'FontSize', 10, 'Color', 'k');
hold off;

回答 (1 件)

Ritish Sehgal
Ritish Sehgal 2022 年 6 月 30 日
It is my understanding that you want to label those data points [0.8 0.5 0.25 0.1] over your contour plot.
There is a property named ‘ShowText’ which needs to be set to ‘on’ in order to achieve that. So, you need to pass this name-value pair to you contour function as an argument to get those points labelled on your plot.
I have attached a link below which has a very similar example of how to pass that property to the contour function:
Hope it helps!!

カテゴリ

Help Center および File Exchange等高线图 についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!