Why I got an added xtick when I try to replace it in a plotyy

1 view (last 30 days)
I have plotted my data with the "plotyy" matlab command. My xtick represents the date in Julian so I've written a piece of code to convert it to gregorian date. When I replace the old xtick (julian date) with my new one (datetick in the following code), the two xtick get added therefore it's unreadable. Why is this happening and how can I do to have only the gregorian date in my plotyy as xtick?
Thanks! ps: I can explain the variables in the following piece of code if necessary
% Plotyy SPL and distance ship-hydrophone according to date UTC
input.distanceMaxMeter = 2000;
figure
[AX,H1,H2] = plotyy(DataMeasure.time,DataMeasure.BW,cat(1,structureAIS.timeJulian),cat(1,structureAIS.rangeMeter));
set(H1,'LineStyle','none','Marker','o','markersize',3)
set(H2,'LineStyle','none','Marker','.')
set(AX(1),'fontsize',14)
set(AX(2),'ylim',[0 input.distanceMaxMeter],'fontsize',14)
set(get(AX(1),'Ylabel'),'String',{'Niveau reçu (dB ref 1µPa²)'})
set(get(AX(2),'Ylabel'),'String','Distance navire CPA/Observer (m)')
xlabel('Date UTC')
legend([H1;H2],'SPL','Ship');
datetick('x','dd/mm/yy','keepticks')

Answers (0)

Categories

Find more on Two y-axis in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!