!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!                                                                      !
! GLE - Graphics Layout Engine <http://www.gle-graphics.org/>          !
!                                                                      !
! Modified BSD License                                                 !
!                                                                      !
! Copyright (C) 2009 GLE.                                              !
!                                                                      !
! Redistribution and use in source and binary forms, with or without   !
! modification, are permitted provided that the following conditions   !
! are met:                                                             !
!                                                                      !
!    1. Redistributions of source code must retain the above copyright !
! notice, this list of conditions and the following disclaimer.        !
!                                                                      !
!    2. Redistributions in binary form must reproduce the above        !
! copyright notice, this list of conditions and the following          !
! disclaimer in the documentation and/or other materials provided with !
! the distribution.                                                    !
!                                                                      !
!    3. The name of the author may not be used to endorse or promote   !
! products derived from this software without specific prior written   !
! permission.                                                          !
!                                                                      !
! THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR   !
! IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED       !
! WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE   !
! ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY       !
! DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL   !
! DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE    !
! GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS        !
! INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER !
! IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR      !
! OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN  !
! IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.                        !
!                                                                      !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

size 15 6

include "../../script/manual.gle"
manual_graph_mode

sub noisy_sin x
   if (x = -2*pi) or (x = 2*pi) then return 0
   else return sin(x)+0.3*rnd(1)
end sub

dy = 0
dy2 = -0.1
gw = pagewidth()/3
gh = pageheight()/2

labelsize = 0.30

sub do_graph t$ m$
   begin graph
      size gw gh
      scale 0.8 0.68
      title t$ dist 0.22 hei labelsize
      yaxis dticks 0.5 hei labelsize
      xaxis format "pi" min -2*pi max 2*pi dticks pi hei labelsize
      let d1 = noisy_sin(x) step pi/50
      d1 \expr{m$} line color red
   end graph
end sub

sub do_graph2 m$
   do_graph m$ m$
end sub

amove 0.1 gh+dy
do_graph "Noisy Sine" ""

amove gw+0.1 gh+dy
do_graph "svg\_smooth 1" "svg_smooth 1"

amove 2*gw+0.1 gh+dy
do_graph "svg\_smooth 5" "svg_smooth 5"

amove 0.1 dy2
do_graph2 "deresolve 10"

amove gw+0.1 dy2
do_graph2 "deresolve 10 average"

amove 2*gw+0.1 dy2
do_graph2 "deresolve 10 average smooth"

