1

Is there a way to make gnuplot plots from tables as per:

#+PLOT: title:"Grades in Physics and Mathematics" ind:2 deps:(3 4) type:2d with:histograms set:"yrange [0:]" set:"xlabel 'Student'" set:"ylabel 'grades'"
|---+--------+-------------+---------|
|   | Grades | Mathematics | Physics |
|---+--------+-------------+---------|
| # | Ben    |         9.2 |     9.9 |
| # | Tom    |         6.7 |     7.7 |
| # | Tim    |         7.5 |     6.7 |
| # | Dean   |         8.0 |     7.0 |

...automatically show the image of the plot when you export to HTML?

  • There is a file option with which you can output the graph to a file here. I could not make it work though. – DJJ Dec 16 '17 at 8:51
1

An alternative option would be

#+Name: mytable
|---+--------+-------------+---------|
|   | Grades | Mathematics | Physics |
|---+--------+-------------+---------|
| # | Ben    |         9.2 |     9.9 |
| # | Tom    |         6.7 |     7.7 |
| # | Tim    |         7.5 |     6.7 |
| # | Dean   |         8.0 |     7.0 |

#+BEGIN_SRC gnuplot :var  data=mytable :file output.png :export results
set title "Grades in Physics and Mathematics"
set style data histogram
set xlabel "Student"
set ylabel "Grades"
set auto x
plot data using 2:xtic(1) ti col, '' u 3 ti col
#+END_SRC

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.