How to label axis in plot?

hello,

how to label x and y axis in plot?

i want to add some units and physic name of plotted value but i only get x axis and y axis :

i want instead to have for example t and rhoe or B.

Also having a way to 'line' the points would be better.

I'm in the context to plotting to a file, but this should not be important:

(plot-file (points Lplot-x
	    		       #:sym 'dot
	    		       #:color "blue"
			       #:label title-x)
	    	       
		       image-x-filename
		       image-type)

regards,

Damien

i find a solution for the first part of question:

(parameterize
	     ([plot-y-label      (string-append physic " (" valor-unit ")")]
	      [plot-x-label      "time t (minutes)"])
	     (plot-file (points Lplot-x
				#:sym 'dot
				#:color "blue"
				#:label title-x)
	    	       
			image-x-filename
			image-type))

reading this page:

https://docs.racket-lang.org/plot/ticks_and_transforms.html

it uses:

https://docs.racket-lang.org/reference/parameters.html#(form._((lib._racket%2Fprivate%2Fmore-scheme..rkt)._parameterize))

https://docs.racket-lang.org/guide/parameterize.html

but not really an easy solution and i really do not understand why it works like this and is so complex.

lines with this code:

#lang reader SRFI-105

        {x-label <- "time t (minutes)"}
	    {y-label <- (string-append physic " (" valor-unit ")")}
	    

	    (parameterize
	     ([plot-x-label      x-label]
	      [plot-x-far-label  x-label]
	      [plot-y-label      y-label]
	      [plot-y-far-label  y-label])
	     (plot-file (list
			 (points Lplot-x
				 #:line-width 2
				 ;;#:sym 'dot
				 #:color "blue"
				 #:label title-x)
			 (lines Lplot-x #:color 2 #:width 2))
			image-x-filename
			image-type))
1 Like