Same plot for two functions
Thomas G.
deepblue4711 at gmx.net
Wed May 14 14:01:03 CDT 2008
Hello George,
another option is the command
hold on/off
A little example using some more options:
% Create "time"-vector
t = [1:1/10:2*pi];
% Open figure number 1
figure(1)
% Clear the figure
clf
% Plot a sine-wave
% - --> full line
% r --> color is red
% d --> marker diamond
plot(t,sin(t),'-rd')
% Tell octave to hold the plot
hold on
% Plot cosine with double frequency
% . --> print only points
%o --> marker circle
% b --> line is blue
plot(t,cos(2*t),'.ob')
% Switch on the grid
grid on
% Give some description
xlabel('Time / s')
ylabel(' \phi / -')
title('This is an example')
Regard
Thomas
george brida schrieb:
> Dear friends,
> if I have two functions of variable t, how to represent them in the
> same plot?
> Say, f(t)=2*t and g(t)=t*t
> Thank you very much
> ------------------------------------------------------------------------
>
> _______________________________________________
> Help-octave mailing list
> Help-octave at octave.org
> https://www.cae.wisc.edu/mailman/listinfo/help-octave
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080514/8549e839/attachment.html
More information about the Help-octave
mailing list