MATLAB Answers

Mos_bad
0

x-axes are not coincident using multiple axes

Mos_bad
さんによって質問されました 2019 年 7 月 19 日
最新アクティビティ Adam Danz
さんによって 回答されました 2019 年 7 月 19 日
I am using multipe axes using the code below. The top x-axis is not coincident as shown in attached file.
ax2=axes('xaxislocation','top','yaxislocation','right','color','none', 'xscale', 'log', 'yscale', 'log');

  4 件のコメント

Adam Danz
2019 年 7 月 19 日
I'm wondering the same thing Jan asked. It should look something like this:
ax2 = axes(...,'Position',ax1.Position,...)
But that alone wont' align the two sets of x-ticks. You'll need to use xlim() to control the x axis limits and you'll need to set the xtick using set(h,'XTick', ...) to ensure there are the same number of ticks on each axis.
Mos_bad
2019 年 7 月 19 日
Thanks Adam, the issue was solved by your comment.
Adam Danz
2019 年 7 月 19 日
Great! I'll move my comment to the answers section to the question is marked answered.

サインイン to comment.

1 件の回答

Adam Danz
回答者: Adam Danz
2019 年 7 月 19 日
 採用された回答

(Copied from comments section)
I'm wondering the same thing Jan asked. It should look something like this:
ax2 = axes(...,'Position',ax1.Position,...)
But that alone wont' align the two sets of x-ticks. You'll need to use xlim() to control the x axis limits and you'll need to set the xtick using set(h,'XTick', ...) to ensure there are the same number of ticks on each axis.

  0 件のコメント

サインイン to comment.



Translated by