help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Same plot for two functions


From: Thomas G.
Subject: Re: Same plot for two functions
Date: Wed, 14 May 2008 21:01:03 +0200
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

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 address@hidden https://www.cae.wisc.edu/mailman/listinfo/help-octave


reply via email to

[Prev in Thread] Current Thread [Next in Thread]