I do not know if what I am bringing up is a feature or a bug.
I am trying to get a cos x trig plot in degrees generated by gnuplot and plotted by TikZ. My .gnuplot file looks like this:
set table "trig.cosinex.table"; set format "%.5f"
set angles degrees; set samples 500; plot [x=0:360] cos(x)
When I compile my .tex file with Tikz/lualatex, the .gnuplot file becomes
set table "trig.cosinex.table"; set format "%.5f"
set samples 500; plot [x=0:360] cos(x)
The set angles degrees; part is deleted.
The gnuplot-relevant line in my .tex file is:
\draw [domain=0:360, samples=500, smooth] plot[id=cosinex] function {cos(x)}; % anm I missing a prefix here?
Kindly note that:
a. I hand generate the .table file from the .gnuplot file by running it through gnuplot.
b. TikZ/lualatex does not generate a .table file even if it does not exist (contrary to manual?) but only overwrites the .gnuplot file.
My questions are:
- How can I get
TikZto specify the angles to be degrees in the.gnuplotfile that it overwrites? [If overwriting cannot be prevented.] - How to prevent
TikZfrom overwriting my.gnuplotfile in the first place? [After hand-compilation withgnuplot, the.tableis left untouched byTikZduring multiple compilations as specified but the.gnuplotfile is altered as above. So, repeat hand-compilation produces a wrong.tablefile and does not give correct results.]
Thanks.
lualatexandxelatexfrom TeXLive 2011. The log files show 'restricted \write18 enabled` for both formats. I believe that this is sufficient but would appreciate confirmation. – chandra Apr 30 '12 at 13:25restricted\write18is allowed to execute a limited number of prespecified programs, of which gnuplot is not one. You need to runxelatex -shell-escape(lualatexmight have a different option for this). – Andrew Stacey Apr 30 '12 at 13:37--enable-write18seems to work with bothxelatexandlualatexon my system. – chandra Apr 30 '12 at 14:08