2

I am currently making a script to plot rectangles. This is my script:

set style line 1 bgnd
set style line 2 lt rgb "cyan"

set object 1 rect from 0,0 to 1,4 fc lt 2
set object 2 rect from -1,1 to 0,5 fc rgb "gold"
set object 5 rect from 0, -3 to 2, -2 fc ls 2 fs pattern 1 bo -1

The problem is that I just can see the plot on the terminal for 1 second maybe. How can I have the plot longer to save it?

Vinicius Placco
  • 1,683
  • 2
  • 14
  • 24

1 Answers1

1

You mention that you want to have the plot longer to save it. If you want to save the plot and not only look at it, I'd suggest setting a terminal and output on your script before executing:

set terminal png
set output "myfile.png"

When you execute your script, nothing will show on the screen and myfile.png will be created on the current directory. If you type on gnuplot:

set terminal

It will give you a list of available terminals. However, if you only want to have a quick look at the plot and not save it, then I'd use the -persist option on the link mentioned in the comments. Hope it helps!

Vinicius Placco
  • 1,683
  • 2
  • 14
  • 24