Skip to content

Instantly share code, notes, and snippets.

@joyhuang9473
Last active October 15, 2015 13:03
Show Gist options
  • Save joyhuang9473/a6345811b775990bd00b to your computer and use it in GitHub Desktop.
Save joyhuang9473/a6345811b775990bd00b to your computer and use it in GitHub Desktop.
subplot demo with Octave
% subplot demo
t=[0:0.01:0.98];
y1 = sin(2*pi*4*t);
y2 = cos(2*pi*4*t);
subplot(1,2,1);
plot(t,y1);
title('my subplot 1');
subplot(1,2,2);
plot(t,y2);
axis([0.5 1 -1 1]);
title('my subplot 2');
print -dpng 'mySubplot.png';
clf;
close;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment