#| Sample cgn session.  |#

#| ...................|#

(use-package :cgn)

;The with-gnuplot macro should be the prefered way to use cgn.
; Here you can see an example of using It on windows.
;Just I use 'w32. The path paramether is optional, use It only 
;if gnuplot (pgnuplot.exe renamed to gnuplot.exe on windows) 
;isn't at the path.
(with-gnuplot ( 'w32 :path "c:/gnuplot/pgnuplot.exe" )

	;Plots a function
	(plot-function "cos(x)*exp(x)")

	;sets the title
	(set-title "My example")

	;sets the grid
	(set-grid 'on)

	;sets the x, y range
	(set-range 'x 0 10)
	(set-range 'y 1 20)

	;Saves a postscript copy of the screen
	(postscript-copy "myfile.ps")

	;Saves the session for restarting later
	(save-cgn "session1.cgn")

	;Loads the session saved before
	(load-cgn "session1.cgn")

	;Prints the graphic
	(print-graphic )

#| End of session |#