LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-28-2011, 10:06 AM   #1
ixma
LQ Newbie
 
Registered: May 2011
Posts: 6

Rep: Reputation: Disabled
Making graphs of a simulation


Hi plz anyone can help me in making My simulation graphs in Ns-2.34 in ubuntu how i can make them. my simualtion is about Home automation lighting control and i wnated to make 6 graphs

1) time VS Residaul energy ( remaining enregy of the nodes)like sensors (we have mentioned Insteon sensor and Switchlinc Dimmer)
use 9V battery in them. the 9V should be converted in joules and Energy on Y-axis should be in Joules and time on X-axis should be of simulation time
The graph would be showing after running the simulation 3000 times how much energy is remaining or how much energy is consumed in the nodes after sending 2000 packets.

2) Packet size Vs Delay, Delay on Y-axis and Packet size on X-axis with there units and the graph would be showing if Pacjet size increases how much delay is created.

3) Throughput Vs Badwidth. througput on Y-axis and Bandwidth on X-axis

4) Packets Loss Vs data rate
5) Packets sent Vs data rate
6) Packets received Vs data rate

The graphs mentioned above should be created from the trace file of the simulation.


PLZ PLZ anyone can help ssome sugestions
 
Old 05-29-2011, 10:26 PM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
You might try extracting the data from the trace files to create files of just the data sets. Then use something like gnuplot to plot the data. The gnuplot documentation also includes a sample of using gnuplot with LaTeX. If the trace files are in a regular format, look at Awk or any general purpose scripting language to extract your datasets.

There is also a GraphViz package that might do the trick. It has plug-ins for a number of languages.

You could also use the graph package with METAPOST to produce graphs in your documentation.

A lot depends how you want to (or need to) publish your results.

Last edited by jschiwal; 05-29-2011 at 10:28 PM.
 
Old 05-29-2011, 10:28 PM   #3
eightcien
LQ Newbie
 
Registered: May 2011
Posts: 5

Rep: Reputation: 0
Try Gnuplot

Gnuplot (http://www.gnuplot.info/) can be used to produce very nice plots. You can use the program interactively to generate a plot that looks good, then save the commands to a file so that you can execute them again in "batch mode" on all your data.

In your case, a simple way to get started is to create a file containing two numeric values per line: the first column contains the x-axis values and the second column contains the y-axis values. Start gnuplot and type the following command at the prompt, where "my.data" is the name of the file containing your x/y values:

Code:
plot 'my.data'
That should display a simple 2D graph. Typing "help" at the gnuplot prompt gives you access to an online manual. Typing "help plot" will tell you everything you need to know about the "plot" command.

If you know Python (or are willing to learn), then matplotlib (http://matplotlib.sourceforge.net/) is excellent as well.
 
Old 05-30-2011, 01:11 AM   #4
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
If you post a sample of your data file(s), there will probably be a long list of example code to demonstrate parsing the data and feeding it to gnuplot. The list will no doubt include all of the common scripting languages, as well as few we've never heard of, and an assortment of other obscure (but interesting) methods. One of the usual suspects will demonstrate a 7 character one-liner that runs in less-than-zero time.
--- rod.
 
Old 05-30-2011, 11:03 AM   #5
ixma
LQ Newbie
 
Registered: May 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
thanx

hey thanx all, i m trying gnuplot now but can anyone tell how gnu plot works with Ns2.34??? :/
 
Old 05-30-2011, 11:09 AM   #6
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Gnuplot is just a general purpose piece of software for plotting. You need to give it data that it can understand, as others have hinted. Where is the data from ns-2 stored, or is it just printed to stdout? Is it in ASCII or binary? I don't think Gnuplot can read binary files (I've not used it in a while, so I don't remember), so you may just have to use plain ASCII.
 
Old 05-30-2011, 11:22 AM   #7
ixma
LQ Newbie
 
Registered: May 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
have to write awk file to extract data from trace file and then give awk command and plot graph by giving xgraph command now i cannot understand how i will plot graph using gnu plot and how i will give data to it...
 
Old 05-30-2011, 11:26 AM   #8
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Read the documentation to see what kind of format Gnuplot requires and modify your AWK scripts accordingly?

Also, please make sure you use punctuation in your posts. It's difficult to read posts that are essentially one long sentence.
 
Old 05-30-2011, 11:36 AM   #9
ixma
LQ Newbie
 
Registered: May 2011
Posts: 6

Original Poster
Rep: Reputation: Disabled
thanx
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ns-2.34 graphs ixma Ubuntu 1 05-30-2011 03:38 PM
Making graphs khaleel5000 General 9 05-19-2011 07:41 AM
NS2 network simulation problem:Change queue parameters dynamically during simulation raeisy Linux - Networking 1 11-21-2010 12:30 PM
Acoustic simulation program or (sound wave simulation program) tarotint Linux - Software 2 02-24-2010 05:04 AM
perl/graphviz -- making clickable/scrollable graphs mistersnorfles Programming 1 08-27-2007 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration