:cache yes
makes the settings on #+RESULTS
be erased whenever execute the block.
For example, I want an image file be resized into width 12cm for LaTeX -> PDF exporting. However, #+ATTR_LATEX: :width 12cm :float c
on top of #+RESULTS[fce2...]:
will be erased (if the image is need to be updated after compared the SHA1) when evaluate the block...
#+tblname: standard
| Standard Conc(ppm) | Value |
|--------------------+----------------|
| 0 | 0 |
| 10 | 0.264 |
| 20 | 0.52 |
| 30 | 0.739 |
#+begin_src gnuplot :cache yes :var standard=standard :file plots/standard.png
reset
set terminal pngcairo size 800,800 enhanced font 'WenQuanYiZenHei,14'
set xlabel "Standard Conc.(ppm)"
set ylabel "Value"
set style up points
set grid
set pointsize 5
stats standard using 1:2 name "STD"
# f(x)=a*(x)+b
line(x)=STD_slope*(x)+STD_intercept
set xrange [0:40]
set yrange [0:]
set xtics 0, 10, 40
set ytics 0, 0.1, 1
unset key
set label 1 sprintf("r = %4.4f\nR^2 = %4.4f\ny = %4.4f x + %.4f",STD_correlation, STD_correlation**2, STD_slope, STD_intercept) at graph 0.1, graph 0.9
plot standard u 1:2 notitle,\
line(x) title 'Linear Fit'
#+end_src
#+ATTR_LATEX: :width 12cm :float c
#+RESULTS[fce2bedf80238d089cc3e5d79570ccf6520eddaf]:
[[file:plots/standard.png]]