user80551
user80551

Reputation: 1164

Multiple parametric or parametric and non-parametric plots on same graph

Is there a way to have

set size square
set parametric
set trange[-5:5]
plot ((((t-1)**2)-(4))/2),t

and

plot x-1

on the same graph?

Upvotes: 3

Views: 3301

Answers (1)

slitvinov
slitvinov

Reputation: 5768

I think a "normal" plot is a special case of "parametric" and you can use

set size square
set parametric
set trange [-5:5]
plot ((((t-1)**2)-(4))/2), t, t, t-1 t "x-1"

enter image description here

or with different ranges

set size square
set parametric
set trange [0:1]

# maps [0:1] -> [A:B]
p(t)= A + t*(B-A)

plot A=-5, B=5,  ((((p(t)-1)**2)-(4))/2), p(t), \
     A=-2, B=10, p(t),                    p(t)-1 t "x-1"

enter image description here

Upvotes: 4

Related Questions