ofstream fout("CmdMedio.gpl");
fout << "#ESTE ES UN SCRIPT PARA CASO MEDIO\n";
fout << "set title \"" << nombre_metodo << "\""<< endl;
fout << "set key left vertical inside " << endl;
fout << "set xlabel \" Talla (n)\"" << endl;
fout << "set ylabel \" Talla (ms)\"" << endl;
switch (orden) {
case CUADRADO:
fout << "Cuadrado(x)= a*x*x+b*x+c" << endl;
fout << "fit Cuadrado(x) \"" + nombre_metodo + ".dat\" using 1:2 via a, b, c" << endl;
fout << "plot \"" + nombre_metodo + ".dat\" using 1:2 title \"" + nombre_metodo + "\", Cuadrado(x)" << endl;
break;
case NLOGN:
fout << "NLogN(x)= a*x*log(x)+b*x+c" << endl;
fout << "fit NlogN(x) \"" + nombre_metodo + ".dat\" using 1:2 via a, b, c" << endl;
fout << "plot \"" + nombre_metodo + ".dat\" using 1:2 title \"" + nombre_metodo + "\", NlogN(x)" << endl;
break;
case N:
fout << "N(x)= a*x*+b" << endl;
fout << "fit N(x) \"" + nombre_metodo + ".dat\" using 1:2 via a, b" << endl;
fout << "plot \"" + nombre_metodo + ".dat\" using 1:2 title \"" + nombre_metodo + "\", N(x)" << endl;
break;
case LOGN:
fout << "LogN(x)= a*log(x)+b" << endl;
fout << "fit LogN(x) \"" + nombre_metodo + ".dat\" using 1:2 via a, b" << endl;
fout << "plot \"" + nombre_metodo + ".dat\" using 1:2 title \"" + nombre_metodo + "\", LogN(x)" << endl;
break;
case LOGLOGN:
fout << "LogLogN(x)= a*log(log(x))+b" << endl;
fout << "fit LogLogN(x) \"" + nombre_metodo + ".dat\" using 1:2 via a, b" << endl;
fout << "plot \"" + nombre_metodo + ".dat\" using 1:2 title \"" + nombre_metodo + "\", LogLogN(x)" << endl;
break;
}
fout << "set terminal pdf" << endl;
fout << "set output\"" + nombre_metodo + ".pdf\"" << endl;
fout << "replot" << endl;
fout << "pause - 1" << endl;
fout.close();
system("CmdMedio.gpl");
cout << "Grafica creada en " << nombre_metodo << ".pdf" << endl;
system("pause");
{"html5":"htmlmixed","css":"css","javascript":"javascript","php":"php","python":"python","ruby":"ruby","lua":"text\/x-lua","bash":"text\/x-sh","go":"go","c":"text\/x-csrc","cpp":"text\/x-c++src","diff":"diff","latex":"stex","sql":"sql","xml":"xml","apl":"apl","asterisk":"asterisk","c_loadrunner":"text\/x-csrc","c_mac":"text\/x-csrc","coffeescript":"text\/x-coffeescript","csharp":"text\/x-csharp","d":"d","ecmascript":"javascript","erlang":"erlang","groovy":"text\/x-groovy","haskell":"text\/x-haskell","haxe":"text\/x-haxe","html4strict":"htmlmixed","java":"text\/x-java","java5":"text\/x-java","jquery":"javascript","mirc":"mirc","mysql":"sql","ocaml":"text\/x-ocaml","pascal":"text\/x-pascal","perl":"perl","perl6":"perl","plsql":"sql","properties":"text\/x-properties","q":"text\/x-q","scala":"scala","scheme":"text\/x-scheme","tcl":"text\/x-tcl","vb":"text\/x-vb","verilog":"text\/x-verilog","yaml":"text\/x-yaml","z80":"text\/x-z80"}