フィルターのクリア

graph alignment problem with Plot and Stem

1 回表示 (過去 30 日間)
Luca Re
Luca Re 2023 年 10 月 5 日
コメント済み: Luca Re 2023 年 10 月 5 日
hi, i've problem to alignment plot graph with stem graph
all Data have the same size
plot(Ax_Draw,XDates,TDR1)
ST=stem(Ax_Sys,XDates,TCC2)
size(XDates)
ans =
1333 1
ans =
size(TDR1)
1333 1
ans =
size(TCC2)
1333 1
  3 件のコメント
Luca Re
Luca Re 2023 年 10 月 5 日
I created another example that gives me the same problem
function Table_Graph_Strategy_Struct(Eq,Sis,item,Ax_Eq,Ax_Draw,Ax_Sys)
a=1:50;
plot(Ax_Eq,a,'DisplayName','Base','Color','red')
%ine(Ax_Eq,[OOS OOS],[Ax_Eq.YTick(1) Ax_Eq.YTick(end)],'Color',[.25 .25 .25],'LineWidth',0.5)
%%************
ytickformat(Ax_Eq,'usd');
axis(Ax_Eq, 'tight');
disableDefaultInteractivity(Ax_Eq)
grid(Ax_Eq,"on");
dt = Ax_Eq.YTick(2) - Ax_Eq.YTick(1);
Ax_Eq.YLim = [Ax_Eq.YLim(1)-dt Ax_Eq.YLim(2)+dt];
hold(Ax_Eq, 'off')
plot(Ax_Draw,a,'DisplayName','Base','Color','red');
ST=stem(Ax_Sys,a,'Color','red');
Luca Re
Luca Re 2023 年 10 月 5 日
i see the problem is "ytickformat(Ax_Eq,'usd')"
If I remove it the problem goes away

サインインしてコメントする。

回答 (1 件)

Guillaume
Guillaume 2023 年 10 月 5 日
Hello,
Maybe a matter of XLIM on your two different axes ? You can try something like
xlim(Ax_Sys, get(Ax_Draw, 'xlim'))
  1 件のコメント
Luca Re
Luca Re 2023 年 10 月 5 日
the problem is "ytickformat(Ax_Eq, 'usd' )"

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by