9

I am relatively new to gnuplot and I am trying to plot some data and save it to a png file for a report. I am running gnuplot from a java-program using exec("gnuplot") but whenever I try to read data from a file and plot it, the plot contains the full path name of the datafile and prints it over part of my plot.

This makes the plot look rather ugly and unfit for my report. Is there a command or something that I can use to remove the path name or do I have to use Photoshop to render it away manually after generating a .png?

3
  • What gnuplot code do you use to provide the plot? Commented Dec 6, 2012 at 11:45
  • Do you mean the structure of the data-files, the actual java-code I use to call gnuplot or just the commands I give gnuplot? Commented Dec 6, 2012 at 12:58
  • The java code is written like this: Process process = Runtime.getRuntime().exec("gnuplot"); OutputStream s = process.getOutputStream(); OutputStreamWriter w = new OutputStreamWriter(s); Then I write something along the lines of this to the OutputStreamWriter: "set terminal pngcairo size 500,500; set output "\image.png"\; plot "\ path \" \n" The data file is basically just a .dat file with 2 numbers on each line seperated with a tab Commented Dec 6, 2012 at 13:08

1 Answer 1

13

The filename is the default title. If you do not want it to be shown, just turn it off:

plot "/path/to/file" notitle
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks! The weird part is that when I tried using the set title command, I would get a new title positioned at the top of the plot, over the coordinate system while the filename was still displayed lower on the picture, over parts of the plot.
set title sets the title of the whole picture. plot ... title sets the title for that particular plot and defaults to the filename of function being plotted.

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.