y-axis looks very clustered ?

1 次查看(过去 30 天)
Fire
Fire 2011-3-18
Dear all,
I have y-axis with time starting from 0 seconds to 14,000 seconds and I assigned it manually to get the values from an excel sheet and it plots all seconds which is a difference of 10 seconds each and it was too clustered and not able to see it properly because of too many data point in it.
is that any way to show just 15 points in that y-axis but when i zoom it should also automatically show the points where in it. I want the ytick should be assigned automatically with my points in excel sheet but should show just 10 or 15 tickmark in axis.
I assigned like :
fileName1 = 'Time.xls';
a = xlsread(fileName1);
x = a(:,:);
figure(2);
imagesc(log10(SRAM))
hold on
% changing the plots from depth to time
set(gca,'YTick',0:191.437546:262078)
set(gca,'YTickLabel',x)
% Targetting the graph to first 5 meters
axis ([0 120 0 (end/14)*10^5])
ylabel('Time (sec)')
title('Modelled-Depth to Time Image')
hold off
  1 个评论
Jan
Jan 2011-3-18
Please use code formatting as described here: http://www.mathworks.com/matlabcentral/answers/help/markup
It would be easier to help you, if you clarify querries occuring in your former threads instead of starting a new one.

请先登录,再进行评论。

采纳的回答

Fire
Fire 2011-3-22
@Jan Simon and Walter Roberson: I hope now i spelled your name correctly Jan :)
I solved my problem, I just made it simple by using,
Imagesc(x, Time , img)
x = x-axis
Time = y-axis, which i used my time data
img = img data
thats it my problem solved :)
But I used the word from Simon : ' let the matlab do it automatically'. Thanks all for your help :)

更多回答(2 个)

Jan
Jan 2011-3-18
Do not set the XTicks manually. Let Matlab do this automatically for you:
XLen = size(SRAM, 2);
imagesc(log10(SRAM), 'XData', linspace(0, 262078, XLen));
I've suggested this method in your former question already.
ADDED: If you want to change the Y-values instead, the method is equivalent:
YLen = size(SRAM, 1);
imagesc(log10(SRAM), 'YData', linspace(0, 262078, YLen));
  7 个评论
Fire
Fire 2011-3-21
@jim simon: yes its not equidistant.. The values like 1070.03, 1070.07, 1070.10, 1070.12 and so on.. But what I did is I have all the values in excel sheet and I called in my y-axis but now it has all the values but you can imagine that it has 1400 values in my y-axis. How to show just say 10 values from top to bottom ?
@Walter: the Zoom option is seem to work out only if I have the values say just 10 points in my y-axis. I have the problem assigning just 10 values out of 1400 values in my y-axis.
Jan
Jan 2011-3-21
@Elavarasan: You prefer an unusual method to set tickmarks. Look at any scientific publication: There are very good reasons to use equidistant or logarithmic ticks.
Implementing your personally styled tick marks would be not trivial. I would invest more time in assisting, if I see, that you invest the time to use code formatting in your posting, answer to requests for further clarifications, run the posted solutions and explain why they do not match your problem and spend the time to spell my name correctly.
Perhaps other users want to spend more energy on your problem. Good luck.

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2011-3-18
See zoom and in particular the ActionPostCallback . In that callback you would examine the current zoom limits, figure out which ticks you wanted to display, and set() the YTicks and YTicksLabel appropriately.

类别

Help CenterFile Exchange 中查找有关 Annotations 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by