y-axis looks very clustered ?
1 次查看(过去 30 天)
显示 更早的评论
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
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.
采纳的回答
更多回答(2 个)
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 个评论
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
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.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!