Created
November 19, 2015 14:49
-
-
Save paulgribble/ecd11869d306a3ac870e to your computer and use it in GitHub Desktop.
MATLAB "hold on" subplot demo for Gavin
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = 1:50; | |
figure | |
subplot(1,2,1) | |
hold on | |
plot(x, randn(size(x)),'bs-') | |
plot(x,sin(x),'r+-') | |
set(gca,'ylim',[-3 3]) | |
plot(x,repmat(1,size(x,2)),'r-','linewidth',2) | |
plot(x,repmat(-1,size(x,2)),'r-','linewidth',2) | |
subplot(1,2,2) | |
hold on | |
plot(x, rand(size(x))*2 - 1,'bs-') | |
plot(x,cos(x),'r+-') | |
set(gca,'ylim',[-3 3]) | |
plot(x,repmat(1,size(x,2)),'r-','linewidth',2) | |
plot(x,repmat(-1,size(x,2)),'r-','linewidth',2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment