From 5106b6d6782ef7d6b2a1ce9a800b584ae818fb49 Mon Sep 17 00:00:00 2001 From: Christian Wolf Date: Mon, 24 Jul 2017 13:02:43 +0200 Subject: [PATCH] Added patch by Peter Barnes (dumb terminal support) --- eplot | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/eplot b/eplot index 49048c0..81748e0 100755 --- a/eplot +++ b/eplot @@ -24,6 +24,7 @@ # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # ************************************************************************** # Changelog: +# 2.08 24.07.2017: -added dumb terminal support by Peter Barnes # 2.07 03.05.2007: -bugfix case where input file is empty # 2.06 09.12.2005: -bugfix style not set when single plot from stdin # 2.05 19.11.2005: -no dummy titles are displayed (tmp files etc.); bugfixes @@ -81,6 +82,7 @@ Output file format options: -a --pdf Output to the pdf file foo.pdf -e --emf Output to the emf file foo.emf -o Specify the output filename + -d --dumb Output to dumb terminal (ascii art) Output formatting options: -r set the range of x and y axis values @@ -90,7 +92,9 @@ Output formatting options: -l set the type of curve (lines,points,linespoints,...) -w set the line width (default: 1) -x provide x-axis options + --xlog log x-axis -y provide y-axis options + --ylog log y-axis -t set the title(s) of the curve(s) (separated by @) -I set the order of the line styles (separated by ,) (e.g. -I "2,1,3,4,5") @@ -176,7 +180,11 @@ class OptionController when /^-o$|^--output$/ @o["OutputFileSpecified"]=checkOptArg(xargv,i) i=i+1 - + + # ---- Do we print to dumb terminal? + when /^-d$|^--dumb$/ + com=com+"set terminal dumb;\n" + # ---- Multiple curves in a single diagram from different files when /^-m$|^--mulfrmul$/ @o["MulFrMul"]=true @@ -228,8 +236,16 @@ class OptionController when /^-x$|^--xlabel$/ com=com+"set xlabel \""+checkOptArg(xargv,i)+"\";\n" i=i+1 - - # ---- the y-axis label + + # ---- log x-axis + when /^--xlog$/ + com=com+"set logscale x;\n" + + # ---- log y-axis + when /^--ylog$/ + com=com+"set logscale y;\n" + + # ---- the y-axis label when /^-y$|^--ylabel$/ com=com+"set ylabel \""+checkOptArg(xargv,i)+"\";\n" i=i+1 @@ -377,7 +393,7 @@ class Controller # ---- print the options com="echo '\n"+getStyleString+@oc["MiscOptions"] com=com+"set multiplot;\n" if doMultiPlot - com=com+"plot "+@oc["Range"]+comString+"\n'| gnuplot -persist" + com=com+"plot "+@oc["Range"]+comString+"\n'| gnuplot -persist" printAndRun(com) # ---- convert to PDF if @oc["DoPDF"]