複数の x 軸と y 軸があるチャートのマーカー表示
Mostrar comentarios más antiguos
複数の x 軸と y 軸があるチャートを作成した際に、描画コマンドとしてlineを使用しているのですが、線でしか表示されず、マーカーを表示させたいですが、エラーが出てしまい出来ない状態です。複数の x 軸と y 軸があるチャートを作成するためにはplotは使えないようなので困っています。
4 comentarios
madhan ravi
el 18 de Jul. de 2019
Could you upload your code?
riku
el 18 de Jul. de 2019
madhan ravi
el 18 de Jul. de 2019
Can you provide the missing variable datas too?
riku
el 18 de Jul. de 2019
Respuesta aceptada
Más respuestas (1)
Etsuo Maeda
el 25 de Jul. de 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
Categorías
Más información sobre Annotations en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!