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");