Skip to content

Instantly share code, notes, and snippets.

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