On Wed, 30 Jan 2013, Allin Cottrell wrote:
On Wed, 30 Jan 2013, savos schmagges wrote:
> Is it possible to plot two or even more scatter plots in one
> graph?
Is this a passable approximation to what you have in mind?
<hansl>
set echo off
set messages off
nulldata 40
loop i=1..2 --quiet
x$i = normal()
cf = (-1)^i
y$i = cf*x$i + normal()
ols y$i 0 x$i --quiet
a$i = $coeff[1]
b$i = $coeff[2]
end loop
string fname = "my_thing.gp"
outfile @dotdir/@fname --write
printf "set key off\n"
printf "plot '-' using 1:2, "
printf "'-' using 1:2, "
printf "%g + %g*x, ", a1, b1
printf "%g + %g*x\n", a2, b2
loop i=1..$nobs
printf "%g %g\n", x1[i], y1[i]
end loop
printf "e\n"
loop i=1..$nobs
printf "%g %g\n", x2[i], y2[i]
end loop
printf "e\n"
outfile @dotdir/@fname --close
gnuplot --input="@dotdir/@fname" --output=display
</hansl>
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------