waterstrider123 · 2022-10-28 21:09
I have some exercise information recorded in a table in one of my org files and I was trying to plot the table in a graph and have the graph pop up beneath the table.
Here is the type of data that I am trying to plot:
https://preview.redd.it/mbmv05pq2mw91.png?width=579&format=png&auto=webp&s=c3502579449c12d39096ea83ec93ded70a4a7880
I am running emacs on WSL2 on a windows computer and I installed gnuplot from the ubuntu terminal first. Then I also included the following in my `init.el` file: `use-package gnuplot :straight t`. I then placed my cursor near the table and ran `M-x org-plot/gnuplot` as mentioned in the [manual](https://orgmode.org/manual/Org-Plot.html). I did not get any errors but I am not sure where the graph was created? How can I make the graph pop up in the org file?
yantar92 · 2022-10-28 23:44
The following works for me:
#+plot: title:"Cardio Exercise"
|------------+----------+----------+------|
| Date | Calories | Distance | Laps |
|------------+----------+----------+------|
| 2022-05-03 | 266 | 1.977 | 8 |
|------------+----------+----------+------|
| 2022-05-10 | 260 | 1.962 | 8 |
|------------+----------+----------+------|
| 2022-05-24 | 150 | 1.100 | 5 |
|------------+----------+----------+------|
| 2021-05-31 | 286 | 2.090 | 9 |
|------------+----------+----------+------|
paulmccombs · 2022-10-31 02:51
On my Mac the plot popped up in a new gnuplot window.
I was briefly able to get it to show up in my org file by using the 'file' plot option and then created a link to the file below and toggled on viewing inline images with C-c C-x C-v. But it just stopped working after I had been messing with it for a few minutes.
I got many warnings and one error installing the gnuplot package. This seemed very promising right up until it just stopped working. It may be a Mac specific issue. Let me know if the below solution works for you.
*** Test Area
+PLOT: title:"Cardio Exercise" file:"./images/gnuplot_test.png"
| Date | Calories | Distance | Laps |
|------------+----------+----------+------|
| 2022-10-26 | 266 | 1.977 | 8 |
| 2022-10-28 | 260 | 1.962 | 8 |
| 2022-10-29 | 150 | 1.100 | 5 |
| 2022-10-30 | 286 | 2.090 | 9 |
|------------+----------+----------+------|
[[./images/gnuplot_test.png]]
waterstrider123 · 2022-11-03 01:38
ya your tables work it seems that something is wrong with the format of my table.