Graphics, Figures & TablesPGFPlots + GnuPlot + File Name with Spaces....

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

PGFPlots + GnuPlot + File Name with Spaces....

Post by EFaden »

Hey,

Just wondering if anyone has seen this issue or has a fix for it. I am trying to use a GNUPlot PGFPlot to put some data into my latex. My tex file is named Blah Blah.tex. I running with -shell-escape on and am getting the following error....

Code: Select all

set terminal table; set output ""Blah Blah".sin.table"; set format "%.5f" ^ cannot open file; output not changed "Blah Blah.sin.gnuplot", line 1: util.c: No such file or directory
I renamed the file T.tex and it worked fine... it seems that the

Code: Select all

set output ""Blah Blah".sin.table"
should actually be

Code: Select all

set output "Blah Blah.sin.table"
Anyone have a fix for this?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

PGFPlots + GnuPlot + File Name with Spaces....

Post by php1ic »

I don't know what PGFPlots is but do use gnuplot a lot. I don't think it is the space that is causing your problem. It is your quotation marks. If you look at the command

Code: Select all

set output ""Blah Blah".sin.table"
The output is set to whatever is between the first and next set of quotes, not the first and last. In this case it is set to nothing, after which the command Blah is run causing your error. If you want quotes in the name, you need to put them as special characters. Try this instead

Code: Select all

set output "\"Blah Blah\".sin.table"
EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

PGFPlots + GnuPlot + File Name with Spaces....

Post by EFaden »

php1ic wrote:I don't know what PGFPlots is but do use gnuplot a lot. I don't think it is the space that is causing your problem. It is your quotation marks. If you look at the command

Code: Select all

set output ""Blah Blah".sin.table"
The output is set to whatever is between the first and next set of quotes, not the first and last. In this case it is set to nothing, after which the command Blah is run causing your error. If you want quotes in the name, you need to put them as special characters. Try this instead

Code: Select all

set output "\"Blah Blah\".sin.table"
Right.... but the problem is that it is pgfplots that is writing the commands to gnuplot. So I have no control over it. It seems to me to be a bug in pgfplots, but I'm not sure.
php1ic
Posts: 192
Joined: Wed Jan 28, 2009 8:17 pm

Re: PGFPlots + GnuPlot + File Name with Spaces....

Post by php1ic »

I don't think you could call it a bug, it looks like the initial part of the file name is used for different things and in this case, wrapped in quotation marks as it contains a special character.

I was once told by a die hard linux user never to use special characters in a file name as it will cause most programs to not work as you'd expect. This is obviously not true, but it can lead to some unnecessary headaches. Do you absolutely need the space in your file name? If T.tex worked then Blah_Blah.tex or some other variation may also work.
EFaden
Posts: 24
Joined: Thu Jun 04, 2009 2:58 am

PGFPlots + GnuPlot + File Name with Spaces....

Post by EFaden »

php1ic wrote:I don't think you could call it a bug, it looks like the initial part of the file name is used for different things and in this case, wrapped in quotation marks as it contains a special character.

I was once told by a die hard linux user never to use special characters in a file name as it will cause most programs to not work as you'd expect. This is obviously not true, but it can lead to some unnecessary headaches. Do you absolutely need the space in your file name? If T.tex worked then Blah_Blah.tex or some other variation may also work.
That's what I'm going to do, but just figured people may want to fix it.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

PGFPlots + GnuPlot + File Name with Spaces....

Post by localghost »

For me it's totally unclear what you are aiming at and what you do to achieve your goal. It would be helpful if you could answer some questions.
  • What is the job of Gnuplot in this context? (Preprocessor?)
  • What is the job of pgfplots in this context? (Postprocessor?)
  • What does the suffix *.sin.table mean in this context?
At the moment it seems to me that you are using Gnuplot to plot something into a table and afterwards plot it with pgfplots for the final output in your document. Please describe in detail what you desire as final result. A complete minimal working example (MWE) is self-evident.


Best regards
Thorsten
Post Reply