how to zoom in on specific overlapped data points and keepin the others ones inside the grid range

5 ビュー (過去 30 日間)
Hello, I have a set of data I am analyzing and I would like some help if you can. My data consist of two columns but my X column is only one point and my Y colunm is about 50 points. So when I plot it of course it's just just diff points along the Y axis versus one single point on the x axis.
Now those points are really closed to each other and what I would like to do is to label each point to their actual Channel name. But so far I tried to use the text() function an it gives me an error saying that my x and y value should be the same. I'm not sure which way to do this anymore. Keep in mind that I have the names of each data points in a file also. Can you help? Keep in mind using one x value and 50 Y values. Lets say I fix it and now the names are on top of each other. Is there a way I am space them out without affecting the location of the points.
Thanks for your help in advance!
  2 件のコメント
Jonathan Epperl
Jonathan Epperl 2013 年 4 月 19 日
Post your code, and the error message.
Mini Me
Mini Me 2013 年 4 月 19 日
@ jonathan, the error messgae I get is X,Y should be the same length.
and it is because my Y has 50 data points and my X has only one.

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

回答 (1 件)

Jonathan Epperl
Jonathan Epperl 2013 年 4 月 19 日
Okay, either you're not explaining well, or the solution is very simple: If the data doesn't have the same dimension, then make it.
Either, you make an array with all the channel names, then use text once:
M = [repmat('Channel ',50,1) num2str((1:50)', '%2d')];
plot(1,1:50,'s');
text(ones(50,1)+.1,1:50,M);
or you use a for-loop:
plot(1,Y,'s');
for ii=1:50
text(1+.1, Y(ii), num2str(ii,'Channel %d'));
end
Does that help?
  10 件のコメント
Jonathan Epperl
Jonathan Epperl 2013 年 4 月 24 日
So you'd like some kind of magnifying glass? Maybe an inset axis might be what your are looking for: http://www.mathworks.com/matlabcentral/fileexchange/33159-inset2dabsolute
Or you could distort the y-axis, so that the scale in the center is smaller than on the edges.
I have no idea how else you would zoom in without losing the other data points.
Mini Me
Mini Me 2013 年 4 月 24 日
@ john,didnt quite do the job..but thanks for all your input. It was well appreciated.

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

カテゴリ

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