Skip to content

Instantly share code, notes, and snippets.

@shane5ul
Created September 18, 2013 16:06
Show Gist options
  • Save shane5ul/6611437 to your computer and use it in GitHub Desktop.
Save shane5ul/6611437 to your computer and use it in GitHub Desktop.
Example of a simple plot in Octave
% Generate Data
x = linspace(0,1);
f1 = x.^2;
f2 = x.^3;
% plot it
h = figure;
plot(x,f1, 'r-', 'LineWidth', 4); hold on;
plot(x,f2, 'b-', 'LineWidth', 4); hold off;
% decorate it
legend('f(x) = x^2','f(x) = x^3','Location','NorthWest');
xlabel('x');
ylabel('f(x)')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment