1

I just started using gnuplot and I wonder how I can use gnuplot with batch. I have a Script that counts every line and every commentline in a .bat file and saves the result in a csv and dat file. That works fine. Here is how I save my results.

REM ---------------SAVE_RESULTS------------------------START----------------
ECHO Programm;total lines;comment lines> ./Result/%CSV_NAME%
ECHO %Script_Name%;%ALL_Counter%;%REM_Counter% >> ./Result/%CSV_NAME%
ECHO 0 total-lines       %ALL_Counter%> ./TEMP_DAT/%DAT_NAME%
ECHO 1 comment-lines       %REM_Counter% >> ./TEMP_DAT/%DAT_NAME%
REM ---------------SAVE_RESULTS------------------------END------------------

This is a example .dat file

0 total-lines        14
1 comment-lines        7 

Now I tried to call gnuplot in Batch but it doenst realy work that way and I have no idea how it works or if it can even work that way.

REM ---------------PLOTTING_CHART------------------------START--------------
C:\Temp\gnuplot\bin\gnuplot.exe
set boxwidth 0.5
set style fill solid
plot './TEMP_DAT/%DAT_NAME%' using 1:3:xtic(2) with boxes

REM ---------------PLOTTING_CHART------------------------END----------------

I want to make a bar chart and save it as a png

Can someone explain me how I can properly use gnuplot with batch?

1
  • 1
    I find your question very hard to understand! What has gnuplot got to do with counting lines? Maybe you are looking for this... stackoverflow.com/a/18890512/2836621 Commented Jan 16, 2018 at 14:47

1 Answer 1

4

I solved the problem.

REM ---------------PLOTTING_CHART------------------------START--------------
REM create .plt
ECHO set term png>./%PLT_NAME%
ECHO set yrange [0:%ALL_COUNTER%] >>./%PLT_NAME%
ECHO set terminal png size 1024,768>>./%PLT_NAME%
ECHO set terminal pngcairo font "arial,10" size 500,500>>./%PLT_NAME%
ECHO set output "SCP_V1_test.png">>./%PLT_NAME%
ECHO set boxwidth 0.75>>./%PLT_NAME%
ECHO set style fill solid>>./%PLT_NAME%
ECHO set title "SCP Tested File:%Script_Name%">>./%PLT_NAME%
ECHO plot '%SOURCE_PATH%TEMP_DAT\%DAT_NAME%' using 2:xtic(1) with boxes>>./%PLT_NAME%


C:\Temp\gnuplot\bin\wgnuplot.exe -p -e load'./%PLT_NAME%'


REM ---------------PLOTTING_CHART------------------------END----------------

I just create a gnuplot script within my batch script and start it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.