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 |
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. |
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' If you know Python (or are willing to learn), then matplotlib (http://matplotlib.sourceforge.net/) is excellent as well. |
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. |
thanx
hey thanx all, i m trying gnuplot now but can anyone tell how gnu plot works with Ns2.34??? :/
|
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.
|
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...
|
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. |
thanx
|
All times are GMT -5. The time now is 03:26 AM. |