Plot Marker - can it be alphabetical?

Hi,
I want to use alphabetical markers in the plot function. Intuitively one may write the command like this:
plot(x,y,'A')
This doesn't work of course, as 'A' is not in the default marker list.
How can I define other then default markers in the plot function?
Thanks, Marina.

2 件のコメント

Marina Delac
Marina Delac 2011 年 10 月 13 日
Hi,
Fangjun's suggestion definitely solves part of the problem.
But what I just realised that applying this solution I end up with, at least, 2 other issues:
1. Legend doesn't work any more
2. Rescaling of axis doesn't move text to new rescaled locations
Any suggestions, thanks, Marina.
Fangjun Jiang
Fangjun Jiang 2011 年 10 月 13 日
Certainly my answer is not meant to be the "right" solution, but what do you mean your two remaining issues?
%%
x=1:10;
ya=1:10;
yb=10:-1:1;
figure;hold on;grid on;
plot(x,ya,'r');text(x,ya,'A');
plot(x,yb,'b');text(x,yb,'B');
legend({'A','B'});
axis([-5 15 -5 15]);

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

 採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 10 月 13 日

0 投票

As far as I know, that's not available in plot() as of now. All the possible markers are those listed in help plot.
Something like this may serve the purpose:
x=1:10;
y=1:10;
plot(x,y);
text(x,y,'A');

1 件のコメント

Marina Delac
Marina Delac 2011 年 10 月 13 日
Thanks Fangjun, this works beautifully!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange2-D and 3-D Plots についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by