Suplabel Causes the Second Y Axis Data to Disappear
Show older comments
Hi,
I'm using the function suplabel to put a master title on a graph with 6 subplots. The three subplots on the left are generated using the plotyy function. As long as the superlabel is not used, both sets of data appear on the left side graphs. As soon as I place the superlabel, though, the second dataset disappears in all three graphs (but the ticks and label remain).
I've tried using hold on to keep everything in place, but that doesn't work. I also tried placing the superlabel at the very start of the graph generation, again with no luck. I've included the code below, but I'm not sure how much help it would be.
Appreciate any insights, and thanks in advance.
figure(q1)
subplot(3,2,1)
[ax1,h11,h12]=plotyy(minuteFilter(:,1),minuteFilter(:,5),minuteFilter(:,1),minuteFilter(:,8));
set(ax1(1),'XTick',[736424;736425;736426;736427;736428]);
set(ax1(2),'XTick',[736424;736425;736426;736427;736428]);
datetick(ax1(1),'x',0,'keepticks');
datetick(ax1(2),'x',0,'keepticks');
ylabel(ax1(1),'Sensor Reading');
ylabel(ax1(2),'Temperature, C','rot',-90);
grid on
hold on
title('X Axis Data')
%
subplot(3,2,3)
[ax2,h21,h22]=plotyy(minuteFilter(:,1),minuteFilter(:,6),minuteFilter(:,1),minuteFilter(:,8));
set(ax2(1),'XTick',[736424;736425;736426;736427;736428]);
set(ax2(2),'XTick',[736424;736425;736426;736427;736428]);
datetick(ax2(1),'x',0,'keepticks');
datetick(ax2(2),'x',0,'keepticks');
ylabel(ax2(1),'Sensor Reading');
ylabel(ax2(2),'Temperature, C','rot',-90);
grid on
hold on
title('Y Axis Data')
%
subplot(3,2,5)
[ax3,h31,h32]=plotyy(minuteFilter(:,1),minuteFilter(:,7),minuteFilter(:,1),minuteFilter(:,8));
set(ax3(1),'XTick',[736424;736425;736426;736427;736428]);
set(ax3(2),'XTick',[736424;736425;736426;736427;736428]);
datetick(ax3(1),'x',0,'keepticks');
datetick(ax3(2),'x',0,'keepticks');
ylabel(ax3(1),'Sensor Reading');
ylabel(ax3(2),'Temperature, C','rot',-90);
grid on
hold on
title('Z Axis Data')
%
subplot(3,2,2),plot(minuteFilter(:,5),minuteFilter(:,9),'b.',minuteFilter(:,5),minuteFilter(:,10),'r.',minuteFilter(:,5),minuteFilter(:,11),'k.');
legend('XY','XZ','ZY');
grid on
hold on
title('Calculated Angle as a Function of X Axis Data');
xlabel('X-Axis Sensor Output');
ylabel('Calculated Angle, degrees');
subplot(3,2,4),plot(minuteFilter(:,6),minuteFilter(:,9),'b.',minuteFilter(:,6),minuteFilter(:,10),'r.',minuteFilter(:,6),minuteFilter(:,11),'k.');
legend('XY','XZ','ZY');
grid on
hold on
title('Calculated Angle as a Function of Y Axis Data');
xlabel('Y-Axis Sensor Output');
ylabel('Calculated Angle, degrees');
subplot(3,2,6),plot(minuteFilter(:,7),minuteFilter(:,9),'b.',minuteFilter(:,7),minuteFilter(:,10),'r.',minuteFilter(:,7),minuteFilter(:,11),'k.');
legend('XY','XZ','ZY');
grid on
hold on
title('Calculated Angle as a Function of Z Axis Data');
xlabel('Z-Axis Sensor Output');
ylabel('Calculated Angle, degrees');
hold on
mastertitle={sprintf('%s Using %s & Connector %d,',USR,SN,Conn);'Sensor Outputs (Filtered in 60s Intervals) as a Function of Time'};
suplabel(char(mastertitle),'t');
Accepted Answer
More Answers (0)
Categories
Find more on Two y-axis 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!