複数の x 軸と y 軸があるチャートのマーカー表示
Mostra commenti meno recenti
複数の x 軸と y 軸があるチャートを作成した際に、描画コマンドとしてlineを使用しているのですが、線でしか表示されず、マーカーを表示させたいですが、エラーが出てしまい出来ない状態です。複数の x 軸と y 軸があるチャートを作成するためにはplotは使えないようなので困っています。
4 Commenti
madhan ravi
il 18 Lug 2019
Could you upload your code?
riku
il 18 Lug 2019
madhan ravi
il 18 Lug 2019
Can you provide the missing variable datas too?
riku
il 18 Lug 2019
Risposta accettata
Più risposte (1)
Etsuo Maeda
il 25 Lug 2019
Kazuyaさんに便乗しまして、plot関数を使った複数軸プロットの方法をご紹介しておきます。
プロット系の関数は実行時にaxesのプロパティをリセットしてしまいます。
予めNextPlotプロパティをreplacechildrenにしておくか、plotしてからaxesのプロパティを調整するようにしておけば、plot関数を使った複数軸プロットが実現できます。
ドキュメンテーション「グラフの Figure および座標軸の準備」

xL = 1:10;
yL = sin(xL);
xR = -xL;
yR = sin(xR);
f = figure;
axL = axes('Parent', f);
axL.NextPlot = 'replacechildren';
axL.XColor = 'b';
axL.YColor = 'b';
axL.Box = 'off';
axL.Color = 'g';
myPos = axL.Position;
axR = axes('Parent', f, 'Position', myPos);
axR.NextPlot = 'replacechildren';
axR.XColor = 'r';
axR.YColor = 'r';
axR.Box = 'off';
axR.XAxisLocation = 'top';
axR.YAxisLocation = 'right';
axR.Color = 'none';
hL = plot(axL, xL, yL, 'bo-', 'MarkerFaceColor', 'b', 'MarkerSize', 8);
hR = plot(axR, xR, yR, 'ro-', 'MarkerFaceColor', 'r', 'MarkerSize', 18);
legend([hL, hR], 'Left', 'Right')
HTH
Categorie
Scopri di più su Annotations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!