plotting a figure with specific x axis

I have already opened a figure and i want to plot a new figure without being in the old one. For that purpose I want to display the x axis as matrix(:,1) and the y axis as matrix(:4). At the same time I want a vertical dotted line in the new figure when the x axis is a multiple of 60 (60, 120, 180 ....). How will I plot that chart?

 採用された回答

AA
AA 2017 年 10 月 12 日

0 投票

it doesnt work, it draws something in another figure which is already opened. i need it to be drawn into a new figure

1 件のコメント

Walter Roberson
Walter Roberson 2017 年 10 月 12 日
Put the call
figure()
before the plot(x,y) call

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

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2017 年 10 月 12 日

0 投票

x = matrix(:,1);
y = matrix(:,4);
plot(x, y);
maxx = max(x);
maxx = 60 * ceil(maxx/60);
xticks = 0 : maxx;
set(gca, 'xtick', xticks, 'xgrid', 'on', 'gridlinestyle', ':')

カテゴリ

ヘルプ センター および File ExchangeLine Plots についてさらに検索

タグ

質問済み:

AA
2017 年 10 月 12 日

コメント済み:

2017 年 10 月 12 日

Community Treasure Hunt

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

Start Hunting!

Translated by