Browse files

* mu-guile: allow passing extra options to gnuplot in mu:plot-histogram

  • Loading branch information...
1 parent 85f0064 commit 931a14438759b4ac004899b0d32667f063992518 @dlobraico dlobraico committed Mar 18, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 guile/mu/plot.scm
5 guile/mu/plot.scm
@@ -46,7 +46,7 @@ not found."
-(define* (mu:plot-histogram data title x-label y-label #:optional (text-only #f))
+(define* (mu:plot-histogram data title x-label y-label #:optional (text-only #f) (extra-gnuplot-opts '()))
"Plot DATA with TITLE, X-LABEL and X-LABEL. If TEXT-ONLY is true,
display using raw text, otherwise, use a graphical window. DATA is a
list of cons-pairs (X . Y)."
@@ -57,11 +57,12 @@ list of cons-pairs (X . Y)."
(gnuplot (open-pipe "gnuplot -p" OPEN_WRITE)))
(display (string-append
- "set term " (if text-only "dumb" "wxt") "\n"
+ "set term " (if text-only "dumb" "qt") "\n"
"set title \"" title "\"\n"
"set xlabel \"" x-label "\"\n"
"set ylabel \"" y-label "\"\n"
"set boxwidth 0.9\n"
+ (string-join extra-gnuplot-opts "\n")
"plot \"" datafile "\" using 2:xticlabels(1) with boxes fs solid\n")
(close-pipe gnuplot)))

0 comments on commit 931a144

Please sign in to comment.