hot to make graphics from ns3

153 views
Skip to first unread message

Stefania Zinno

unread,
Nov 3, 2014, 5:36:37 PM11/3/14
to ns-3-...@googlegroups.com
Hi everybody, can anyone please recommend some kinda way to print out nice graphics (throughput, network load etc) in ns3?

Konstantinos

unread,
Nov 3, 2014, 5:40:29 PM11/3/14
to ns-3-...@googlegroups.com

Stefania Zinno

unread,
Nov 3, 2014, 5:46:22 PM11/3/14
to ns-3-...@googlegroups.com
This shows only how to print out graphs from functions. I used already gnu plot and i need more like this kinda:


// Gnuplot parameter

      std::string fileNameWithNoExtension = "TimeVsThroughput";

      std::string graphicsFileName        = fileNameWithNoExtension + ".png";

      std::string plotFileName            = fileNameWithNoExtension + ".plt";

      std::string plotTitle               = "Time vs Throughput";

      std::string dataTitle               = "Throughput";

      std::string fileNameWithNoExtension1 = "TimeVsPacketLoss";

      std::string graphicsFileName1        = fileNameWithNoExtension1 + ".png";

      std::string plotFileName1            = fileNameWithNoExtension1 + ".plt";

      std::string plotTitle1               = "Time vs Packet Loss";

      std::string dataTitle1               = "Packet Loss";

      // Instantiate the plot and set its title.

      Gnuplot gnuplot (graphicsFileName);

      gnuplot.SetTitle (plotTitle);

      gnuplot.SetTerminal ("png"); // Make the .PNG file, which the plot file will be when it is used with Gnuplot

      gnuplot.SetLegend ("Time (seconds)", "Throughput (kbps)");   // Set the labels for each axis

      Gnuplot2dDataset dataset; // Instantiate the dataset, set its title, and make the points be plotted along with connecting lines.

      dataset.SetTitle (dataTitle);

      dataset.SetStyle (Gnuplot2dDataset::LINES_POINTS);

      Gnuplot gnuplot1 (graphicsFileName1);

      gnuplot1.SetTitle (plotTitle1);

      gnuplot1.SetTerminal ("png"); // Make the .PNG file, which the plot file will be when it is used with Gnuplot

      gnuplot1.SetLegend ("Time (seconds)", "Packet Loss (%)");   // Set the labels for each axis

      Gnuplot2dDataset dataset1; // Instantiate the dataset, set its title, and make the points be plotted along with connecting lines.

      dataset.SetTitle (dataTitle1);

      dataset.SetStyle (Gnuplot2dDataset::LINES_POINTS);

Stefania Zinno

unread,
Nov 3, 2014, 5:47:37 PM11/3/14
to ns-3-...@googlegroups.com
I would also really appreciate a way to process callbacks results.. 


Il giorno lunedì 3 novembre 2014 23:40:29 UTC+1, Konstantinos ha scritto:
Reply all
Reply to author
Forward
0 new messages