フィルターのクリア

Creating plot with 2 x axes from property inspector?

6 ビュー (過去 30 日間)
MementoMori
MementoMori 2023 年 5 月 21 日
コメント済み: Walter Roberson 2023 年 5 月 22 日
Hi, I want to create a plot with two x axes, one on the bottom of the graph and the other one on the top.
Given a plot how can I create a x axes on the top of the graph using only property inspector?

回答 (1 件)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2023 年 5 月 22 日
Here is a doc for two x-axes and y-axes: DOC
Here is how to create two x-axes:
x1=0:.1:2*pi;
Y1 = sin(2*x1);
x2 = -pi:.1:pi;
Y2 = cos(2*x2);
t = tiledlayout(1,1);
ax1 = axes(t);
plot(ax1,x1,Y1,'r-o')
ax1.XColor = 'r';
ax1.YColor = 'r';
ax2 = axes(t);
plot(ax2,x2,Y2,'bd-.')
ax2.XAxisLocation = 'top';
ax2.YAxisLocation = 'right';
ax2.Color = 'none';
ax1.Box = 'off';
ax2.Box = 'off';
ylabel('cos(x_2)')
xlabel('x_2')
grid on
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 5 月 22 日
But this does not use only property inspector.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by