\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{textcomp}

\usepackage{ifluatex,ifxetex}
\ifluatex
  \usepackage{fontspec}
  \setmainfont{Free Serif}
\else\ifxetex
  \usepackage{fontspec}
  \setmainfont{FreeSerif}
\else
  \usepackage{ucs}
  \SetUnicodeOption{mathletters}
  \usepackage[utf8x]{inputenc}
\fi\fi

\usepackage{gnuplot-lua-tikz}
\pagestyle{empty}
\usepackage[active,tightpage]{preview}
\PreviewEnvironment{tikzpicture}
\setlength\PreviewBorder{\gpbboxborder}
\begin{document}

\begin{tikzpicture}[gnuplot]
%% generated with GNUPLOT 5.4p8 (Lua 5.3; terminal rev. Jun 2020, script rev. 118)
%% Thu Oct 26 18:10:59 2023
\path (0.000,0.000) rectangle (12.500,8.750);
\gpcolor{color=gp lt color border}
\gpsetlinetype{gp lt border}
\gpsetdashtype{gp dt solid}
\gpsetlinewidth{1.00}
\draw[gp path] (1.688,0.985)--(1.868,0.985);
\node[gp node right] at (1.504,0.985) {$-0.01$};
\draw[gp path] (1.688,1.663)--(1.868,1.663);
\node[gp node right] at (1.504,1.663) {$0$};
\draw[gp path] (1.688,2.341)--(1.868,2.341);
\node[gp node right] at (1.504,2.341) {$0.01$};
\draw[gp path] (1.688,3.018)--(1.868,3.018);
\node[gp node right] at (1.504,3.018) {$0.02$};
\draw[gp path] (1.688,3.696)--(1.868,3.696);
\node[gp node right] at (1.504,3.696) {$0.03$};
\draw[gp path] (1.688,4.374)--(1.868,4.374);
\node[gp node right] at (1.504,4.374) {$0.04$};
\draw[gp path] (1.688,5.052)--(1.868,5.052);
\node[gp node right] at (1.504,5.052) {$0.05$};
\draw[gp path] (1.688,5.730)--(1.868,5.730);
\node[gp node right] at (1.504,5.730) {$0.06$};
\draw[gp path] (1.688,6.408)--(1.868,6.408);
\node[gp node right] at (1.504,6.408) {$0.07$};
\draw[gp path] (1.688,7.085)--(1.868,7.085);
\node[gp node right] at (1.504,7.085) {$0.08$};
\draw[gp path] (1.688,7.763)--(1.868,7.763);
\node[gp node right] at (1.504,7.763) {$0.09$};
\draw[gp path] (1.688,8.441)--(1.868,8.441);
\node[gp node right] at (1.504,8.441) {$0.1$};
\draw[gp path] (1.688,0.985)--(1.688,1.165);
\node[gp node center] at (1.688,0.677) {$0$};
\draw[gp path] (2.878,0.985)--(2.878,1.165);
\node[gp node center] at (2.878,0.677) {$10000$};
\draw[gp path] (4.068,0.985)--(4.068,1.165);
\node[gp node center] at (4.068,0.677) {$20000$};
\draw[gp path] (5.258,0.985)--(5.258,1.165);
\node[gp node center] at (5.258,0.677) {$30000$};
\draw[gp path] (6.449,0.985)--(6.449,1.165);
\node[gp node center] at (6.449,0.677) {$40000$};
\draw[gp path] (7.639,0.985)--(7.639,1.165);
\node[gp node center] at (7.639,0.677) {$50000$};
\draw[gp path] (8.829,0.985)--(8.829,1.165);
\node[gp node center] at (8.829,0.677) {$60000$};
\draw[gp path] (10.019,0.985)--(10.019,1.165);
\node[gp node center] at (10.019,0.677) {$70000$};
\draw[gp path] (11.209,0.985)--(11.209,1.165);
\node[gp node center] at (11.209,0.677) {$80000$};
\draw[gp path] (1.688,8.441)--(1.688,0.985)--(11.947,0.985);
\node[gp node center,rotate=-270] at (0.108,4.713) {\(P\) (MW)};
\node[gp node center] at (6.817,0.215) {Time (sec)};
\node[gp node right] at (10.663,4.528) {\(PD_{51}\)};
\gpcolor{rgb color={0.580,0.000,0.827}}
\draw[gp path] (10.847,4.528)--(11.763,4.528);
\draw[gp path] (1.688,7.763)--(1.759,7.763)--(1.831,7.763)--(1.902,7.763)--(1.974,7.763)%
  --(2.045,7.763)--(2.116,7.763)--(2.188,7.763)--(2.259,7.763)--(2.331,7.763)--(2.402,7.763)%
  --(2.473,7.763)--(2.545,7.763)--(2.616,7.763)--(2.688,7.763)--(2.759,7.763)--(2.831,7.763)%
  --(2.902,7.763)--(2.973,7.763)--(3.045,7.763)--(3.116,7.763)--(3.188,7.763)--(3.259,7.763)%
  --(3.330,7.763)--(3.402,7.763)--(3.473,7.763)--(3.545,7.763)--(3.616,7.763)--(3.687,7.763)%
  --(3.759,7.763)--(3.830,7.763)--(3.902,7.763)--(3.973,7.763)--(4.044,7.763)--(4.116,7.763)%
  --(4.187,7.763)--(4.259,7.763)--(4.330,7.763)--(4.402,7.763)--(4.473,7.763)--(4.544,7.763)%
  --(4.616,7.763)--(4.687,7.763)--(4.759,7.763)--(4.830,7.763)--(4.901,7.763)--(4.973,7.763)%
  --(5.044,7.763)--(5.116,7.763)--(5.187,7.763)--(5.258,7.763)--(5.330,7.763)--(5.401,7.763)%
  --(5.473,7.763)--(5.544,7.763)--(5.615,7.763)--(5.687,7.763)--(5.758,7.763)--(5.830,7.763)%
  --(5.901,7.763)--(5.973,7.763)--(6.044,7.763)--(6.115,7.763)--(6.187,7.763)--(6.258,7.763)%
  --(6.330,7.763)--(6.401,7.763)--(6.472,7.763)--(6.544,7.763)--(6.615,7.763)--(6.687,7.763)%
  --(6.758,7.763)--(6.829,7.763)--(6.901,7.763)--(6.972,7.763)--(7.044,7.763)--(7.115,7.763)%
  --(7.186,7.763)--(7.258,7.763)--(7.329,7.763)--(7.401,7.763)--(7.472,7.763)--(7.543,7.764)%
  --(7.615,7.764)--(7.686,7.764)--(7.758,7.764)--(7.829,7.764)--(7.901,7.764)--(7.972,7.764)%
  --(8.043,7.765)--(8.115,7.765)--(8.186,7.765)--(8.258,7.765)--(8.329,7.765)--(8.400,7.766)%
  --(8.472,7.768)--(8.543,7.768)--(8.615,7.770)--(8.686,7.770)--(8.757,7.770)--(8.829,7.777)%
  --(8.900,7.782)--(8.972,7.788)--(9.043,7.788)--(9.114,7.788)--(9.186,7.788)--(9.257,7.788)%
  --(9.329,7.788)--(9.400,7.788)--(9.472,7.788)--(9.543,7.789)--(9.614,7.789)--(9.686,7.789)%
  --(9.757,7.791)--(9.829,7.792)--(9.900,7.792)--(9.971,7.794)--(10.043,7.802)--(10.114,7.809)%
  --(10.186,7.809)--(10.257,7.809)--(10.328,7.809)--(10.400,7.809)--(10.471,7.809)--(10.543,7.809)%
  --(10.614,7.829)--(10.685,7.829)--(10.757,7.829)--(10.828,7.829)--(10.900,7.834)--(10.971,7.834)%
  --(11.042,7.834)--(11.114,7.834)--(11.185,7.840)--(11.257,7.852)--(11.328,7.860)--(11.400,7.869)%
  --(11.471,7.869)--(11.542,7.869)--(11.614,7.869)--(11.685,7.883)--(11.757,7.883)--(11.828,7.898)%
  --(11.899,7.898)--(11.947,7.905);
\gpcolor{color=gp lt color border}
\node[gp node right] at (10.663,4.159) {\(UD_{51}\)};
\gpcolor{rgb color={0.000,0.620,0.451}}
\draw[gp path] (10.847,4.159)--(11.763,4.159);
\draw[gp path] (1.688,7.763)--(1.712,7.382)--(1.736,7.382)--(1.759,7.382)--(1.783,7.382)%
  --(1.807,7.382)--(1.831,7.382)--(1.855,7.382)--(1.878,7.382)--(1.902,7.382)--(1.926,7.382)%
  --(1.950,7.382)--(1.974,7.382)--(1.997,7.382)--(2.021,7.382)--(2.045,7.382)--(2.069,7.382)%
  --(2.093,7.382)--(2.116,7.382)--(2.140,7.382)--(2.164,7.382)--(2.188,7.382)--(2.212,7.382)%
  --(2.235,7.382)--(2.259,7.382)--(2.283,7.382)--(2.307,7.382)--(2.331,7.382)--(2.354,7.382)%
  --(2.378,7.382)--(2.402,7.382)--(2.426,7.382)--(2.450,7.382)--(2.473,7.382)--(2.497,7.382)%
  --(2.521,7.382)--(2.545,7.382)--(2.569,7.382)--(2.593,7.382)--(2.616,7.382)--(2.640,7.382)%
  --(2.664,7.382)--(2.688,7.382)--(2.712,7.382)--(2.735,7.382)--(2.759,7.382)--(2.783,7.382)%
  --(2.807,7.382)--(2.831,7.382)--(2.854,7.382)--(2.878,7.382)--(2.902,7.382)--(2.926,7.382)%
  --(2.950,7.382)--(2.973,7.382)--(2.997,7.382)--(3.021,7.382)--(3.045,7.382)--(3.069,7.382)%
  --(3.092,7.382)--(3.116,7.382)--(3.140,7.382)--(3.164,7.382)--(3.188,7.382)--(3.211,7.382)%
  --(3.235,7.382)--(3.259,7.382)--(3.283,7.382)--(3.307,7.382)--(3.330,7.382)--(3.354,7.382)%
  --(3.378,7.382)--(3.402,7.382)--(3.426,7.382)--(3.449,7.382)--(3.473,7.382)--(3.497,7.382)%
  --(3.521,7.382)--(3.545,7.382)--(3.568,7.382)--(3.592,7.382)--(3.616,7.382)--(3.640,7.382)%
  --(3.664,7.382)--(3.687,7.382)--(3.711,7.382)--(3.735,7.382)--(3.759,7.382)--(3.783,7.382)%
  --(3.806,7.382)--(3.830,7.382)--(3.854,7.382)--(3.878,7.382)--(3.902,7.382)--(3.925,7.382)%
  --(3.949,7.382)--(3.973,7.382)--(3.997,7.382)--(4.021,7.382)--(4.044,7.382)--(4.068,7.382)%
  --(4.092,7.382)--(4.116,7.382)--(4.140,7.382)--(4.163,7.382)--(4.187,7.382)--(4.211,7.382)%
  --(4.235,7.382)--(4.259,7.382)--(4.283,7.382)--(4.306,7.382)--(4.330,7.382)--(4.354,7.382)%
  --(4.378,7.382)--(4.402,7.382)--(4.425,7.382)--(4.449,7.382)--(4.473,7.382)--(4.497,7.382)%
  --(4.521,7.382)--(4.544,7.382)--(4.568,7.382)--(4.592,7.382)--(4.616,7.382)--(4.640,7.382)%
  --(4.663,7.382)--(4.687,7.382)--(4.711,7.382)--(4.735,7.382)--(4.759,7.382)--(4.782,7.382)%
  --(4.806,7.382)--(4.830,7.382)--(4.854,7.382)--(4.878,7.382)--(4.901,7.382)--(4.925,7.382)%
  --(4.949,7.382)--(4.973,7.382)--(4.997,7.382)--(5.020,7.382)--(5.044,7.382)--(5.068,7.382)%
  --(5.092,7.382)--(5.116,7.382)--(5.139,7.382)--(5.163,7.382)--(5.187,7.382)--(5.211,7.382)%
  --(5.235,7.382)--(5.258,7.382)--(5.282,7.382)--(5.306,7.382)--(5.330,7.382)--(5.354,7.382)%
  --(5.377,7.382)--(5.401,7.382)--(5.425,7.382)--(5.449,7.382)--(5.473,7.382)--(5.496,7.382)%
  --(5.520,7.382)--(5.544,7.382)--(5.568,7.382)--(5.592,7.382)--(5.615,7.382)--(5.639,7.382)%
  --(5.663,7.382)--(5.687,7.382)--(5.711,7.382)--(5.734,7.382)--(5.758,7.382)--(5.782,7.382)%
  --(5.806,7.382)--(5.830,7.382)--(5.853,7.382)--(5.877,7.382)--(5.901,7.382)--(5.925,7.382)%
  --(5.949,7.382)--(5.973,7.382)--(5.996,7.382)--(6.020,7.382)--(6.044,7.382)--(6.068,7.382)%
  --(6.092,7.382)--(6.115,7.382)--(6.139,7.382)--(6.163,7.382)--(6.187,7.382)--(6.211,7.382)%
  --(6.234,7.382)--(6.258,7.382)--(6.282,7.382)--(6.306,7.382)--(6.330,7.382)--(6.353,7.382)%
  --(6.377,7.382)--(6.401,7.382)--(6.425,7.382)--(6.449,7.382)--(6.472,7.382)--(6.496,7.382)%
  --(6.520,7.382)--(6.544,7.382)--(6.568,7.382)--(6.591,7.382)--(6.615,7.382)--(6.639,7.382)%
  --(6.663,7.382)--(6.687,7.382)--(6.710,7.382)--(6.734,7.382)--(6.758,7.382)--(6.782,7.382)%
  --(6.806,7.382)--(6.829,7.382)--(6.853,7.382)--(6.877,7.382)--(6.901,7.382)--(6.925,7.382)%
  --(6.948,7.382)--(6.972,7.382)--(6.996,7.382)--(7.020,7.382)--(7.044,7.382)--(7.067,7.382)%
  --(7.091,7.382)--(7.115,7.382)--(7.139,7.382)--(7.163,7.382)--(7.186,7.382)--(7.210,7.382)%
  --(7.234,7.382)--(7.258,7.382)--(7.282,7.382)--(7.305,7.382)--(7.329,7.382)--(7.353,7.382)%
  --(7.377,7.382)--(7.401,7.382)--(7.424,7.382)--(7.448,7.382)--(7.472,7.382)--(7.496,7.382)%
  --(7.520,7.382)--(7.543,7.382)--(7.567,7.382)--(7.591,7.382)--(7.615,7.382)--(7.639,7.382)%
  --(7.662,7.382)--(7.686,7.382)--(7.710,7.382)--(7.734,7.382)--(7.758,7.382)--(7.782,7.382)%
  --(7.805,7.382)--(7.829,7.382)--(7.853,7.382)--(7.877,7.382)--(7.901,7.382)--(7.924,7.382)%
  --(7.948,7.382)--(7.972,7.382)--(7.996,7.382)--(8.020,7.382)--(8.043,7.382)--(8.067,7.382)%
  --(8.091,7.382)--(8.115,7.382)--(8.139,7.382)--(8.162,7.382)--(8.186,7.382)--(8.210,7.382)%
  --(8.234,7.382)--(8.258,7.382)--(8.281,7.382)--(8.305,7.382)--(8.329,7.382)--(8.353,7.382)%
  --(8.377,7.382)--(8.400,7.382)--(8.424,7.382)--(8.448,7.382)--(8.472,7.382)--(8.496,7.382)%
  --(8.519,7.382)--(8.543,7.382)--(8.567,7.382)--(8.591,7.382)--(8.615,7.382)--(8.638,7.382)%
  --(8.662,7.382)--(8.686,7.382)--(8.710,7.382)--(8.734,7.382)--(8.757,7.382)--(8.781,7.382)%
  --(8.805,7.382)--(8.829,7.382)--(8.853,7.382)--(8.876,7.382)--(8.900,7.382)--(8.924,7.382)%
  --(8.948,7.382)--(8.972,7.382)--(8.995,7.382)--(9.019,7.382)--(9.043,7.382)--(9.067,7.382)%
  --(9.091,7.382)--(9.114,7.382)--(9.138,7.382)--(9.162,7.382)--(9.186,7.382)--(9.210,7.382)%
  --(9.233,7.382)--(9.257,7.382)--(9.281,7.382)--(9.305,7.382)--(9.329,7.382)--(9.352,7.382)%
  --(9.376,7.382)--(9.400,7.382)--(9.424,7.382)--(9.448,7.382)--(9.472,7.382)--(9.495,7.382)%
  --(9.519,7.382)--(9.543,7.382)--(9.567,7.382)--(9.591,7.382)--(9.614,7.382)--(9.638,7.382)%
  --(9.662,7.382)--(9.686,7.382)--(9.710,7.382)--(9.733,7.382)--(9.757,7.382)--(9.781,7.382)%
  --(9.805,7.382)--(9.829,7.382)--(9.852,7.382)--(9.876,7.382)--(9.900,7.382)--(9.924,7.382)%
  --(9.948,7.382)--(9.971,7.382)--(9.995,7.382)--(10.019,7.382)--(10.043,7.382)--(10.067,7.382)%
  --(10.090,7.382)--(10.114,7.382)--(10.138,7.382)--(10.162,7.382)--(10.186,7.382)--(10.209,7.382)%
  --(10.233,7.382)--(10.257,7.382)--(10.281,7.382)--(10.305,7.382)--(10.328,7.382)--(10.352,7.382)%
  --(10.376,7.382)--(10.400,7.382)--(10.424,7.382)--(10.447,7.382)--(10.471,7.382)--(10.495,7.382)%
  --(10.519,7.382)--(10.543,7.382)--(10.566,7.382)--(10.590,7.382)--(10.614,7.382)--(10.638,7.382)%
  --(10.662,7.382)--(10.685,7.382)--(10.709,7.382)--(10.733,7.382)--(10.757,7.382)--(10.781,7.382)%
  --(10.804,7.382)--(10.828,7.382)--(10.852,7.382)--(10.876,7.382)--(10.900,7.382)--(10.923,7.382)%
  --(10.947,7.382)--(10.971,7.382)--(10.995,7.382)--(11.019,7.382)--(11.042,7.382)--(11.066,7.382)%
  --(11.090,7.382)--(11.114,7.382)--(11.138,7.382)--(11.162,7.382)--(11.185,7.382)--(11.209,7.382)%
  --(11.233,7.382)--(11.257,7.382)--(11.281,7.382)--(11.304,7.382)--(11.328,7.382)--(11.352,7.382)%
  --(11.376,7.382)--(11.400,7.382)--(11.423,7.382)--(11.447,7.382)--(11.471,7.382)--(11.495,7.382)%
  --(11.519,7.382)--(11.542,7.382)--(11.566,7.382)--(11.590,7.382)--(11.614,7.382)--(11.638,7.382)%
  --(11.661,7.382)--(11.685,7.382)--(11.709,7.382)--(11.733,7.382)--(11.757,7.382)--(11.780,7.382)%
  --(11.804,7.382)--(11.828,7.382)--(11.852,7.382)--(11.876,7.382)--(11.899,7.382)--(11.923,7.382)%
  --(11.947,7.382);
\gpcolor{color=gp lt color border}
\node[gp node right] at (10.663,3.790) {\(P_{51}\)};
\gpcolor{rgb color={0.337,0.706,0.914}}
\draw[gp path] (10.847,3.790)--(11.763,3.790);
\draw[gp path] (1.688,1.663)--(1.759,1.282)--(1.831,1.282)--(1.902,1.282)--(1.974,1.282)%
  --(2.045,1.282)--(2.116,1.282)--(2.188,1.282)--(2.259,1.282)--(2.331,1.282)--(2.402,1.282)%
  --(2.473,1.282)--(2.545,1.282)--(2.616,1.282)--(2.688,1.282)--(2.759,1.282)--(2.831,1.282)%
  --(2.902,1.282)--(2.973,1.282)--(3.045,1.282)--(3.116,1.282)--(3.188,1.282)--(3.259,1.282)%
  --(3.330,1.282)--(3.402,1.282)--(3.473,1.282)--(3.545,1.282)--(3.616,1.282)--(3.687,1.282)%
  --(3.759,1.282)--(3.830,1.282)--(3.902,1.282)--(3.973,1.282)--(4.044,1.282)--(4.116,1.282)%
  --(4.187,1.282)--(4.259,1.282)--(4.330,1.282)--(4.402,1.282)--(4.473,1.282)--(4.544,1.282)%
  --(4.616,1.282)--(4.687,1.282)--(4.759,1.282)--(4.830,1.282)--(4.901,1.282)--(4.973,1.282)%
  --(5.044,1.282)--(5.116,1.282)--(5.187,1.282)--(5.258,1.282)--(5.330,1.282)--(5.401,1.282)%
  --(5.473,1.282)--(5.544,1.282)--(5.615,1.282)--(5.687,1.282)--(5.758,1.282)--(5.830,1.282)%
  --(5.901,1.282)--(5.973,1.282)--(6.044,1.282)--(6.115,1.282)--(6.187,1.282)--(6.258,1.282)%
  --(6.330,1.282)--(6.401,1.282)--(6.472,1.282)--(6.544,1.282)--(6.615,1.282)--(6.687,1.282)%
  --(6.758,1.282)--(6.829,1.282)--(6.901,1.282)--(6.972,1.282)--(7.044,1.282)--(7.115,1.282)%
  --(7.186,1.282)--(7.258,1.282)--(7.329,1.281)--(7.401,1.281)--(7.472,1.281)--(7.543,1.281)%
  --(7.615,1.281)--(7.686,1.281)--(7.758,1.281)--(7.829,1.281)--(7.901,1.281)--(7.972,1.281)%
  --(8.043,1.280)--(8.115,1.280)--(8.186,1.280)--(8.258,1.280)--(8.329,1.280)--(8.400,1.279)%
  --(8.472,1.277)--(8.543,1.277)--(8.615,1.275)--(8.686,1.275)--(8.757,1.275)--(8.829,1.268)%
  --(8.900,1.263)--(8.972,1.257)--(9.043,1.257)--(9.114,1.257)--(9.186,1.257)--(9.257,1.257)%
  --(9.329,1.257)--(9.400,1.256)--(9.472,1.256)--(9.543,1.256)--(9.614,1.256)--(9.686,1.256)%
  --(9.757,1.254)--(9.829,1.253)--(9.900,1.253)--(9.971,1.250)--(10.043,1.243)--(10.114,1.236)%
  --(10.186,1.236)--(10.257,1.236)--(10.328,1.236)--(10.400,1.236)--(10.471,1.236)--(10.543,1.236)%
  --(10.614,1.216)--(10.685,1.216)--(10.757,1.216)--(10.828,1.216)--(10.900,1.211)--(10.971,1.211)%
  --(11.042,1.211)--(11.114,1.211)--(11.185,1.205)--(11.257,1.193)--(11.328,1.185)--(11.400,1.176)%
  --(11.471,1.176)--(11.542,1.176)--(11.614,1.176)--(11.685,1.162)--(11.757,1.162)--(11.828,1.146)%
  --(11.899,1.146)--(11.947,1.203);
\gpcolor{color=gp lt color border}
\draw[gp path] (1.688,8.441)--(1.688,0.985)--(11.947,0.985);
%% coordinates of the plot area
\gpdefrectangularnode{gp plot 1}{\pgfpoint{1.688cm}{0.985cm}}{\pgfpoint{11.947cm}{8.441cm}}
\end{tikzpicture}
%% gnuplot variables
\end{document}
