#+LANGUAGE: en\r
#+PROPERTY: session *R* \r
#+PROPERTY: cache yes \r
-#+PROPERTY: results graphics \r
+#+PROPERTY: results file graphics \r
#+PROPERTY: exports both \r
#+PROPERTY: tangle yes \r
#+OPTIONS: toc:nil \r
| 46.7443082659106 |\r
\r
Plotting the function using coord_polar in ggplot2 does not work as intended. Unexpectedly, the x axis keeps extending instead of circling back once a full circle is reached. Turns out coord_polar might not really be intended to plot elements in polar vector format.\r
-#+BEGIN_SRC R :session R :results output graphics :file ../pics/golden_spiral-coord_polar-fail.png :exports both\r
+#+BEGIN_SRC R :session R :results output file graphics :file ../assets/golden_spiral-coord_polar-fail.png :exports both\r
ggplot(data.frame(x = seq_theta, y = dist_from_origin), aes(x,y)) +\r
geom_point() +\r
coord_polar(theta="x")\r
#+END_SRC\r
\r
#+RESULTS:\r
-[[file:../pics/golden_spiral-coord_polar-fail.png]]\r
+[[file:../assets/golden_spiral-coord_polar-fail.png]]\r
\r
To ensure what I was trying to do is possible, I employ a specialised plotfunction instead\r
-#+BEGIN_SRC R :session R :results output graphics :file ../pics/golden_spiral-plotrix.png :exports both\r
+#+BEGIN_SRC R :session R :results output file graphics :file ../assets/golden_spiral-plotrix.png :exports both\r
plotrix::radial.plot(dist_from_origin, seq_theta,rp.type="s", point.col = "blue")\r
#+END_SRC\r
\r
\r
* Result\r
With everything now ready in the right coordinate system, it's now only a matter of setting some options to make the output look acceptable.\r
-#+BEGIN_SRC R :session R :results output graphics :file ../pics/golden_spiral-ggplot-coord-fixed.png :width 800 :height 800 :exports both\r
+#+BEGIN_SRC R :session R :results output file graphics :file ../assets/golden_spiral-ggplot-coord-fixed.png :width 800 :height 800 :exports both\r
ggplot(df, aes(x=X1,y=X2)) +\r
geom_path(color="blue") +\r
theme(panel.grid.minor = element_blank(),\r