y-axis looks very clustered ?
Ältere Kommentare anzeigen
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 Kommentar
Jan
am 18 Mär. 2011
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.
Akzeptierte Antwort
Weitere Antworten (2)
Jan
am 18 Mär. 2011
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 Kommentare
Fire
am 18 Mär. 2011
Jan
am 18 Mär. 2011
Sorry that I did not get your question. You ask, what I'm trying to do? I'm trying to assist you. And you are welcome.
It is very hard for me as non native speaker to understand your English and the unformatted code does not make it easier. I asked you for clarification in your other threads, but unfortunately you did not answer. This does not increase your chance to get your problem solved, Elavarasan.
You do not want to change the X-axis, but the Y-axis? Then simply change the 'XData' to 'YData' and insert the necessary changes in the LINSPACE command. I do not think, that this transfer is too hard.
Fire
am 18 Mär. 2011
Jan
am 18 Mär. 2011
Ok. So you do not want equidistant steps on the Y-axis, but just these values, which really occur in the measurement data?
Walter Roberson
am 19 Mär. 2011
To show the right tick marks after the zoom, see my answer.
Fire
am 21 Mär. 2011
Jan
am 21 Mär. 2011
@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
am 18 Mär. 2011
0 Stimmen
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.
Kategorien
Mehr zu Axis Labels finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!