how to control my datetick() axes
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
hi guys
i am trying to use datetick() in combination with a subplot. Program fetches data from a device and updates the plot each time i recieve a sample. That means that the vector i am plotting keeps getting larger and larger.
I have some problem with the axes and the resolution of my plot. It seems like there is a fixed time interval between the date ticks, and if the firs data point of my data has a time that is in between this interval, the plot line starts out in the middle of the plot. Is there a way to control the interval between the date ticks ??
Another question: when using the "data cursor" tool, in the toolbar of my figure window, it only shows the datenum ID number. Is it possible to make it show the date tick instead?
here is my plotting code:
axes(subplot(3,1,1))
plot(handles.TempData(:,4),handles.TempData(:,1),'r')
datetick('x','dd-mmm HH:MM:SS')
title('Frequency vs time')
xlabel('Time')
ylabel('Frequency [mHz]')
grid on
0 Kommentare
Akzeptierte Antwort
Titus Edelhofer
am 13 Feb. 2012
Hi,
take a look at the parameters for datetick. I guess the "keeplimits" is what you are looking for. For the second question: yes, it is.
doc datacursormode
and look at the example for the property "updatefcn".
Titus
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!