Hi Xypron, Thank you very much for doing these 2 illustrations i.e. formatting gnuplot data in mathprog and graphing ( 2 D bar graph and 3D bar graphs).
I am more incline to incorporated the gnuplot scripts in MathProg model for 2 reasons: The first reason,, it would generate the gnuplot scripts instantly and I just open the gnuplot file in other tab in GUSEK or GLPK lab and click run - wgnuplot.exe will produce the graph. Note: GUSEK gnuplot supports already i.e. gnuplot.properties file. The second reason is, if I open my models 2 years from now, I will not be seeking the gnuplot that goes with my MathProg model. I could just click and run and the gnuplot file is generated. No searching for the gnuplot file. Xypron, probably you can write other documentation about GLPK/MathProg, MathProg IDE's (GUSEK), more ODBC examples, Language Bindings, Graphs, XML, Mac OS X, etc.? You can title it -" Hidden features and Hacks in GLPK/MathProg" or any other title. You can ask glpk / mathprog user group to contribute as well. I think Andrew is more incline to write "formal" documentation. However, new comers and users always ask basic questions and useable features of glpk/mathprog to address their basic needs. Just a thought. Thanks again for the examples. Regards, Noli On 6/13/10, glpk xypron <[email protected]> wrote: > Hello Noli, > > another fancy plot of transp.mod can be generated by adding the > following lines to the model: > > solve; > > printf '' > 'transp.dat'; > for { i in I } { > for { j in J } { > printf '%i "%s"', sum{k in I: k < i} 1, i >> 'transp.dat'; > printf ' %i "%s"', sum{l in J: l < j} 1, j >> 'transp.dat'; > printf ' %f', x[i,j] >> 'transp.dat'; > printf '\n' >> 'transp.dat'; > > printf '%i "%s"', sum{k in I: k < i} 1, i >> 'transp.dat'; > printf ' %i "%s"', sum{l in J: l <= j} 1, '' >> 'transp.dat'; > printf ' %f', x[i,j] >> 'transp.dat'; > printf '\n' >> 'transp.dat'; > } > printf '\n' >> 'transp.dat'; > for { j in J } { > printf '%i "%s"', sum{k in I: k <= i} 1, '' >> 'transp.dat'; > printf ' %i "%s"', sum{l in J: l < j} 1, j >> 'transp.dat'; > printf ' %f', x[i,j] >> 'transp.dat'; > printf '\n' >> 'transp.dat'; > > printf '%i "%s"', sum{k in I: k <= i} 1, '' >> 'transp.dat'; > printf ' %i "%s"', sum{l in J: l <= j} 1, '' >> 'transp.dat'; > printf ' %f', x[i,j] >> 'transp.dat'; > printf '\n' >> 'transp.dat'; > } > printf '\n' >> 'transp.dat'; > } > data; > > set I := San-Diego Seattle; > > set J := Chicago New-York Topeka; > > > And calling gnuplot with > > reset > set terminal png font "Arial, 16" transparent size 800,800 > set output "transp.png" > set title 'Result of transp.mod' > set xtic offset first .5, first -.25, first 0 mirror > set ytic offset first .25, first .5, first 0 mirror > set nokey > set pm3d > set palette gray > set grid x y z > splot 'transp.dat' using 1:3:5:xtic(2):ytic(4) with pm3d > exit > > Resulting in the appended image. > > Best regards > > Xypron > -- > GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT! > Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome > _______________________________________________ Help-glpk mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-glpk
