0

Hell, I need to plot points out of my c++ application. So I simply save my points to a points.txt and then run system("gnuplot 'plotmakro'"); which contains:

set output 'plot.png'
set terminal png
set grid
set multiplot
plot pointsa.txt' ', 'pointb.txt'

Is there a solution so that I get plot2.png, plot3.png when running the makro again?

Tobias
  • 7,282
  • 6
  • 63
  • 85

1 Answers1

0

As far as I understand your problem two possible solutions come to my mind:

  1. sed the output of your gnuplot script to another location before running gnuplot with the newly created script or
  2. output the png to some arbitrary file like tmp_plot.png and change the file name after gnuplot is done to your liking.

However, with both suggestions I somehow feel that there is a nicer and cleaner solution to your problem. Maybe you want to think about your interface between your application an gnuplot...

Woltan
  • 13,723
  • 15
  • 78
  • 104