2

I'm trying to save an .eps file in a folder that doesn't exist yet. I wrote the following gnuplot script:

plot [0:0.13][0:55] 'example/x_-4_U.xy'
set output 'output/x=-4.eps'
replot

The script only works if the "output" folder is already there . Can I create this folder with gnuplot?

Thanks.

2 Answers 2

3

You can use the system command:

system "mkdir output"

on Linux, I seem to remember that it is md output on Windows.

Combined with string operators, this is rather flexible:

dir = "output1"
command = "mkdir " . dir
system command

works nicely.

Sign up to request clarification or add additional context in comments.

Comments

1

You can concatenate the name of the output file with the folder name:

folderout = 'output/'
plot [0:0.13][0:55] 'example/x_-4_U.xy'
set output folderout.'x=-4.eps'
replot

Sincerely.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.