Add axes x and y labels (or title) to a scatter plot, not using tbl notation

45 ビュー (過去 30 日間)
Vyte Jan
Vyte Jan 2022 年 9 月 24 日
コメント済み: Star Strider 2022 年 9 月 26 日
Hello,
I seem to have ran into an error.
I am trying to plot a simple scatter plot, and I want to add x and y axis label names. I'm sure I am using the right command and there is nothing weird going on with my code. I refreshed matlab and it still won't work.
Any suggestions on whats happening?
Thanks!
figure
scatter(A_full,B_30_channels, 'blue') % A and B are both rows of 570 values each
hold on
ylabel=('30 chan')
xlabel=('128 chan')
title=('scatter of 30 vs 128 channel band power means')

採用された回答

Star Strider
Star Strider 2022 年 9 月 24 日
Delete the equal sign in the xlabel, ylabel, and title calls —
A_full = rand(1,570);
B_30_channels = rand(1,570);
figure
scatter(A_full,B_30_channels, 'blue') % A and B are both rows of 570 values each
hold on
ylabel('30 chan')
xlabel('128 chan')
title('scatter of 30 vs 128 channel band power means')
.
  2 件のコメント
Vyte Jan
Vyte Jan 2022 年 9 月 26 日
Thank you @Star Strider
Can't believe it was only '=' I needed to remove, I feel silly now.
Thank you!
Star Strider
Star Strider 2022 年 9 月 26 日
As always, my pleasure!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGrid Lines, Tick Values, and Labels についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by