Image quality control using racket plot/no-gui -
i using rakcet language's plot/no-gui library render functions , increase dpi of images created plot-file call. (also style comments appreciated)
an example function plotting:
#lang racket (require math) (require plot/no-gui) (plot-file (list (axes) (inverse-interval (λ (x) 1) (λ (x) -1) -3.00000 3.000000) (function (lambda (x) (* (expt 3 x) (sin (* 20 x)))) -1 1)) "images/plot_000000.jpg" #:y-min -4 #:y-max 4)
the size of plot controlled parameters plot-width
, plot-height
. image doesn't have dpi - dpi describes screen.
try this:
#lang racket (require math) (require plot/no-gui) (define scale 4) (plot-width (* scale (plot-width)) (plot-height (* scale (plot-height)) (plot-file (list (axes) (inverse-interval (λ (x) 1) (λ (x) -1) -3.00000 3.000000) (function (lambda (x) (* (expt 3 x) (sin (* 20 x)))) -1 1)) "images/plot_000000.jpg" #:y-min -4 #:y-max 4)
Comments
Post a Comment