#| Sample cgn session. This session has been executed on my machine. |#

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

(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 linux.
;Just I use 'linux. Really, does not mind what you use as os. The
;only thing needed is that you use 'w32 on windows. 
;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 ( 'linux :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")

	;Plots a scatter plot. This is too much simple. I'm planning to improve this function
	;at next releases.
	(plot-points '(1 2 3) '(4 5 6) :x_error '(0.1 0.2 0.3) :y_error '(0.4
0.5 0.6))

	;Prints the graphic
	(print-graphic )

#| End of session |#