How to apply datetick property on non active plot
Show older comments
Hi community,
I've build a figure including subplots:
function testfunc(data,attrib)
tiledlayout(2,2);
l1=nexttile;
plot(data(:,1),data(:,2),"r")
hold on
plot(data(:,1),data(:,4),"b")
legend(char(attrib(1,2)),char(attrib(1,4)));
%datetick('x',10)
hold off
l2=nexttile;
plot(data(end-250:end,1),data(end-250:end,2),"r")
hold on
plot(data(end-250:end,1),data(end-250:end,4),"b");
legend(char(attrib(1,2)),char(attrib(1,4)));
%datetick('x',3);
hold off
l3=nexttile;
bar(data(:,1),data(:,8),1.1,'g');
legend(char(attrib(1,8)));
%datetick('x',10);
l4=nexttile;
bar(data(end-250:end,1),data(end-250:end,8),1.1,'g');
legend(char(attrib(1,8)));
%datetick('x',3);
end
I want to set the datetick property for all subplots after the compete code is executed. How to handle this?
Thx.!
Answers (1)
nouseforaname
on 18 Jun 2020
0 votes
Categories
Find more on Dates and Time in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!