I thought I might try and polish up some of my own graphs that I have made but I seem to run into some difficulty trying to input files.
So far the problem seems to be isolated with LyX's working directory. (I choose this forum because it might not have been).
I have taken code from the internet so not to mess things up so here is the following:
Code: Select all
\usepackage{setspace}
\usepackage{tikz}
\usepackage{pgfplots}
\usepackage{filecontents}
\pgfplotsset{compat=newest}
\onehalfspacing
\begin{filecontents}{datax.dat}
1 3 6
2 4 5
3 3 7
4 1 2
5 1 1
\end{filecontents}Code: Select all
\begin{tikzpicture}
\begin{axis}[xlabel={$x$},ylabel={Column Data}]
% Graph column 2 versus column 0
\addplot table[x index=0,y index=2,col sep=space] {datax.dat};
\addlegendentry{Column 3}% y index+1 since humans count from 1
% Graph column 1 versus column 0
\addplot table[x index=0,y index=1,col sep=space] {datax.dat};
\addlegendentry{Column 2}
\end{axis}
\end{tikzpicture}I placed "datax.dat" file in my working directory (as in LyX -> preferences -> paths -> working directories and changed the name of the test file "datax.dat" to my file and it found nothing. I placed it in the directory of where my file was saved and still nothing.
The error I get is:
"could not read table file"
I have tried
\addplot file {file.dat} and I get the error:"file could not be opened"
Still... The following code works on TeXShop... This makes me believe it is a working directory issue. I tried adding the following path "\foo\bar\file.dat" and nothing.
Any help is extremely appreciated.
Thank you in advanced,
regards,
Charlotte.
---------------------------------
Update: Okay I have found the problem but no fix yet, I got fed up and closed lyx. A popup opened saying "unable to removetemp folder". I went to investigate and there are the files.
(Path: /var/folders/kj/8jc2m9kn5h167wwm3dmvw47h0000gn/T)
However after closing down clicking okay the files delete themselves. I tried changing the directory to another folder and the files still delete themselves.