#!/usr/bin/gnuplot -persist
reset
NO_ANIMATION = 1
set terminal png size 1920, 1080
set output 'graph1.png'
set size 1, 1
set key left box
set title "Кусочно-линейный график"
set xlabel "Количество элементов, шт"
set ylabel "Время, мкс"
set grid
plot './preproc/average_O0_A0_S0.txt' with linespoints title 'O0 a[i]' lc "red"
replot './preproc/average_O0_A1_S0.txt' with linespoints title 'O0 *(a + n)' lc "blue"
replot './preproc/average_O0_A2_S0.txt' with linespoints title "O0 *p" lc "green"
replot './preproc/average_O2_A0_S0.txt' with linespoints title "O2 a[i]" lc "yellow"
replot './preproc/average_O2_A1_S0.txt' with linespoints title "O2 *(a + n)" lc "black"
replot './preproc/average_O2_A2_S0.txt' with linespoints title "O2 *p" lc "purple"
I use this Gnuplot code to build 6 plots in one png image. But the replot commands don't work. Only the first plot is built. The image is attached (press the button). All used files exist and have the same structure as the first one. Thank you.
A png file can only contain one image. That is a limitation of the PNG format. Also - I think the "replot" command is not what you want in any case. Please expand your question to decribe what the result should look like.
edit
I need 6 lines in one coordinate system, they should share the same axes
In that case you want only a single plot command with the individual components separated by commas (see response from theozh).