define curve
data example.dat
xcolumn 1
ycolumn 2
limits 0 6.28 -1.3 1.3
box 3 4
relocate x1 0
draw x2 0
set \1 gy
histogram \1

angle 30
relocate 3.4 0
putlabel 9 \g5 device coord = \1

limits x1 x2 y2 y1
connect
relocate x(3) y(3)
angle x(2) y(2) x(3) y(3)
putlabel 7 Sine
angle x(3) y(3) x(4) y(4)
putlabel 9 wave

location gx1 gx2 \1 gy2
limits x1 x2 0 y1
set \2 \1 * -1
histogram \2
end

curve
