I still can not create something usable in matlab.
The task is pretty simple. I have two files: devideHistory.log deals.log In both files lets consider only first two column. So first file contains X and Y which should form graphic. Second file contains X and Y of markers that should be displayed on the graphic. With help of this community such program was created
clear
fDevide = fopen('devideHistory.log');
data = textscan(fDevide, '%f:%f:%f:%f %f,%f %f,%f');
fclose(fDevide);
% hh:min:sec:millisec
secvec = [60*60 60 1 1e-3];
x = [data{1:4}] * secvec';
flvec = [1 1e-16];
y = [data{5:6}] * flvec';
xindays = x / (24*60*60);
plot(xindays, y);
% set(gca, 'YTickLabel', get(gca,'YTick'))
% datetick('x', 'HH:MM:SS');
hold on
fDeals = fopen('deals.log');
data = textscan(fDeals, '%f:%f:%f:%f %f,%f %f,%f %f,%f %f');
fclose(fDeals);
% hh:min:sec:millisec
secvec = [60*60 60 1 1e-3];
x = [data{1:4}] * secvec';
flvec = [1 1e-16];
y = [data{5:6}] * flvec';
xindays = x / (24*60*60);
plot(xindays, y, 'go','MarkerSize',6,'LineWidth',3);
% i need to set enough precision on Y but this doesn't work because
% while zooming labels doesn't update
set(gca, 'YTickLabel', get(gca,'YTick'))
% i want to have "time" on X but this doesn't work because
% while zooming new labels doesn't appear
datetick('x', 'HH:MM:SS');
Result:
But I have two problems with zooming feature:
- while zooming in labels from X disappear and as a result there are not labels at X at all how to always display "labels" on axis X
- while zooming labels on Y is not updated as a result markers are displayed on the wrong position why while zooming marker changes position?
Well my task is pretty simple and straightforward. Are there simple and straightforward solution in matlab for it? Code above already contains several "hacks" and still doesn't work as expected. I'm afraid contining hacking it doesn't make sense. Could someone suggest another approach? Probably matlab just not suitable for my needs?