Matlab Plots Very Small dots

45 ビュー (過去 30 日間)
Pourya saber
Pourya saber 2013 年 2 月 16 日
コメント済み: HYEWON HWANG 2017 年 7 月 28 日
Hi
I am facing this problem and it is getting quite annoying at the moment. Basically my matlab plots dots that are very small, it is so small that makes it hard to even see them. I used markersize property with value 10,20,10000.... and doesn't make any difference. Anyone knows what could have gone wrong ?
plot(data(i,1),data(i,2),'blue','markersize',200);
See if you can even spot it in this image :D
  1 件のコメント
Walter Roberson
Walter Roberson 2013 年 2 月 16 日
I see you edited the question, but the current version of the question is the same as what I remember the original being.
Your edit was after my Answer. Did you try the steps in my Answer?

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

採用された回答

Jan
Jan 2013 年 2 月 17 日
編集済み: Jan 2013 年 2 月 17 日
The MarkerSize matters only, when a marker is used:
plot(1, 1, 'Marker', 'o', 'MarkerSize', 4, ...
'MarkerFaceColor', 'b', 'MarkerEdgeColor', 'b');
The size of a single dot does not depend on the LineWidth:
axes('NextPlot', 'add', 'YLim', [0, 3]);
plot(1, 1, 'LineWidth', 4);
plot([0.5, 1.5], [2, 2], 'LineWidth', 4)

その他の回答 (2 件)

Walter Roberson
Walter Roberson 2013 年 2 月 16 日
Try
set(gcf, 'Renderer', 'painters')
and also
set(gcf, 'Renderer', 'opengl')
if opengl is the one that fails, then try
opengl software
and see if it works then
  3 件のコメント
Walter Roberson
Walter Roberson 2013 年 2 月 17 日
Ah. Your problem is that you are not specifying any marker, and the default is to use no markers.
HYEWON HWANG
HYEWON HWANG 2017 年 7 月 28 日
Thank you so much

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


Image Analyst
Image Analyst 2013 年 2 月 17 日
I don't know why you're just plotting one data point, and you're not using the format description like I would. Try taking it out of your loop over i and plotting it after the loop like this:
plot(data(:,1), data(:,2), 'bo-','MarkerSize', 15);
For me, this certainly does let you change the marker size. You can leave it in the loop if you use hold on:
for k = 1 : size(data, 1)
plot(data(k,1), data(k,2), 'bo-','MarkerSize', 15);
if k == 1
hold on;
end
end
though this is less efficient/slower.
  2 件のコメント
Pourya saber
Pourya saber 2013 年 2 月 17 日
I am actually plotting a whole dataset like this
for i = 1 : 20
if i < 11
rnd = mvnrnd(Mu1,Sigma1);
data(i,1) = rnd(1,1);
data(i,2) = rnd(1,2);
data(i,3) = 1;
plot(data(i,1),data(i,2),'red','markersize',20);
hold on;
else
rnd = mvnrnd(Mu2,Sigma2);
data(i,1) = rnd(1,1);
data(i,2) = rnd(1,2);
data(i,3) = -1;
plot(data(i,1),data(i,2),'blue','markersize',20);
hold on;
end
end
I want to be able to distinguish between two set of data through their colors.
Interestingly this
plot(data(:,1), data(:,2), 'bo-','MarkerSize', 15);
allow me to change the size of those circles which is good. How can I add color to this ?
Image Analyst
Image Analyst 2013 年 2 月 17 日
編集済み: Image Analyst 2013 年 2 月 17 日
Add the input parameter pair
, 'Color', [r g b]
where r, g, and b are numbers in the range 0-1. Alternatively if you want standard colors (r, g, b, y, m, c, k) you can just put those in instead of b (blue) in the 'bo-' argument, or after the 'Color' argument. You can also choose different standard markers (e.g. d=diamond, s = square, etc.) instead of o (for circles).

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

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by