y-axis looks very clustered ?

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
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.

Melden Sie sich an, um zu kommentieren.

 Akzeptierte Antwort

Fire
Fire am 22 Mär. 2011

0 Stimmen

@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 :)

Weitere Antworten (2)

Jan
Jan am 18 Mär. 2011

1 Stimme

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
Fire am 18 Mär. 2011
what ur trying to do ??
Its just making my x-axis and y-axis the same. I don't want to change my x-axis from the data. my question is just want to change the y-axis because matlab shows the no. of steps it did in y-axis but I want the y-axis to be plotted by excel and I did that too by calling the excel file in it.
But it plotted all the points in excel but I want only like some points to be shown in y-axis but when i zoomed in it shows the values for the zoomed portion.
I don't know whether you got my question ?
Jan
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
Fire am 18 Mär. 2011
Hi Jan simon,
I didn't mean it in harsh way by asking what ur trying to do?? I meant in a way how ur doing that.. may be it changes the meaning sorry.
once again il explain my problem.
I don't want to disturb my x-data or x=axis. let it be like that and Y-axis shows the no. of steps and even I don't want that. Instead of iteration steps I want to include the values from my excel sheet. i imported the values in the y-axis but now the y-axis showing all my values which is approximately 1400 values in my y-axis and that is too clustered.
I want just say 15 YTicks in my y-axis and then when I zoom , it should show again some 15 YTicks but for the depth values it related to..
I mean, i have 40 meters layers. in my y-axis it should show like 1 meter to 40 meter with 5 difference. I can make it like 1:5:40 and assign the ticks but when I zoom into 5 meters its showing just 1 tick in my y-axis instead I want another 10 ticks should be shown say from 0 0.5 1 1.5 till 5 meters but its not showing that...
Jan
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
Walter Roberson am 19 Mär. 2011
To show the right tick marks after the zoom, see my answer.
Fire
Fire am 21 Mär. 2011
@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 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.

Melden Sie sich an, um zu kommentieren.

Walter Roberson
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.

Produkte

Tags

Gefragt:

am 18 Mär. 2011

Community Treasure Hunt

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

Start Hunting!

Translated by