Hey Zihan!
There's no ready-to-use function in MATLAB that supports what you're asking, but there are certainly some workarounds that I can think of -
- Instead of plotting the three subplots against a single y-axis, you could split them into three separate plots -
figure
subplot(131);
ax1 = gca;
set(ax1, 'xtick', [], 'ytick', []);
xlabel('DateTime1');
ax1top = axes('Position', ax1.Position, 'XAxisLocation', 'top');
Repeat this block of code three times to get your output
- If you want your subplots to be stacked up against each other, then on the figure, select the "Edit Plot" option and select the subplots - you can now move them around using the arrow keys. In this case, suppress the y-axis option for the 2nd and 3rd subplots -
set(gca, 'YColor', 'none');
- Alternatively, consider using the function stackedplot. You can have the properties "concentration" and "date" on the y-axis, and "Altitude" on the x-axis.
Hope this helps!