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?

1 Answer 1

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...

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

1 Comment

Ah, yeah. It's really that simple... Just renaming the file after plotting :-) Thanks!

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.