pgf-tikz / pgfplots

pgfplots - A TeX package to draw normal and/or logarithmic plots directly in TeX in two and three dimensions with a user-friendly interface and pgfplotstable - a TeX package to round and format numerical tables. Examples in manuals and/or on web site.
http://pgfplots.sourceforge.net/
198 stars 33 forks source link

Unable to use an absolute path with `table/search path` #407

Closed kjshen closed 2 years ago

kjshen commented 2 years ago

Hello,

I've successfully used the table/search path option to specify a relative path to my table data, for example:

\pgfplotsset{
    table/search path={../data/}
}
\addplot+ table {dataset1/test_data.dat};

However, I was unable to use an absolute path such as

\pgfplotsset{
    table/search path={C:/Users/kjshen/data/}
}
\addplot+ table {dataset1/test_data.dat};

to plot data from a different directory.

Is there any mistake with my path specification or is the option only meant for relativ paths?

hmenke commented 2 years ago

Related? https://github.com/pgf-tikz/pgfplots/issues/402

kjshen commented 2 years ago

Related? #402

I don't fully understand the workaround there and if it applies to this case

In my understanding, the workaround is for standalone plots in a different directory and not for reading .dat file.

Mo-Gul commented 2 years ago

The given example (of course with another data file and other paths) works perfectly fine for me. Which version of TikZ and PGFPlots are you using?

kjshen commented 2 years ago

Hi,

the example code I gave in my post was not correctly reflecting the path on my machine. I've now found that the path I was using contained empty spaces, so adding double quotes " resolved my issue.

This works fine:

\pgfplotsset{
    table/search path={C:/Users/"path with spaces"/data/}
}
\addplot+ table {dataset1/test_data.dat};

So just wrong end user application here. Thanks for looking into it!