
等高線のラベルを指数表示にするにはどうすればいいですか?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
yuya inatomi
am 30 Jan. 2018
Kommentiert: yuya inatomi
am 30 Jan. 2018

x=linspace(1,3,30);
y=linspace(1,3,30);
[X Y]=meshgrid(x,y);
Z=(X.^2+Y.^2)*1e3;
contour(X,Y,Z,'ShowText','on')
上記コードで画像のような等高線をプロットしたとします。 このときラベルを指数表示(例:4000->4.0x10^3) にするにはどうすればいいでしょうか。
0 Kommentare
Akzeptierte Antwort
Akira Agata
am 30 Jan. 2018
等高線のラベルを付ける位置をマウスで指定する必要がありますが、たとえば下記のようにするとラベルを指数表示にすることができます。
x = linspace(1,3,30);
y = linspace(1,3,30);
[X Y] = meshgrid(x,y);
Z = (X.^2+Y.^2)*1e3;
[C,h] = contour(X,Y,Z);
t = clabel(C,h,'manual')
set(t,'BackgroundColor',[1 1 1]);
for kk = 1:numel(t)
t(kk).String = sprintf('%.2e',t(kk).UserData);
end

Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 等高線図 finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!