フィルターのクリア

plotting two x aes and 1 y axes for one plot

1 回表示 (過去 30 日間)
priya
priya 2019 年 10 月 13 日
コメント済み: darova 2019 年 10 月 13 日
Drawing1.png
I made the function simple.
the code i have used is:
x1= [0: 0.1 : (2*pi*1)];
y=sin(x1);
plot (x1,y)
This helps me to plot the curve for magnitude vs time. I am unable to add the 'delta' x- axes?
  2 件のコメント
darova
darova 2019 年 10 月 13 日
Did you try something?
priya
priya 2019 年 10 月 13 日
I have editted the question to make the function simple. I am unable to plot the 2nd x-axes.

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

採用された回答

darova
darova 2019 年 10 月 13 日
Example with two axes. Idea is from HERE
x1 = 0:0.1:40;
y1 = 4.*cos(x1)./(x1+2);
plot(x1,y1,'r')
ax1 = gca;
ax1_pos = get(ax1,'Position'); % position of first axes
% align second axes (transparent)
ax2 = axes('Position',ax1_pos,...
'Color','none');
ax1_pos(2) = ax1_pos(2) + 0.1; % move first axes up
ax1_pos(4) = ax1_pos(4) - 0.1; % make Ysize of axes smaller
set(ax1,'Position',ax1_pos)
set(ax2,'YTick',[]) % remove Y axis ticks
xlim(ax2,[0 5])
set(ax2,'XTick',0:2:5)
  2 件のコメント
priya
priya 2019 年 10 月 13 日
yes it is working, thanks @darova
darova
darova 2019 年 10 月 13 日
You are welcome!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by