-   Linux - Newbie (
-   -   plot the xgraph (

adel.elkabbany 03-20-2011 09:16 PM

plot the xgraph
dear sir:

how can i plot x graph Ubuntu by using awk scripts indicating how can i change

awk files into xgr files, thanks in advance.


adel.elkabbany 03-20-2011 09:19 PM

dear sir:

how can i plot x graph on Ubuntu by using awk scripts indicating how can i change

awk files into xgr files, thanks in advance.

linuxubuntu adel.elkabbany is online now Click to check your reputation for this post Edit/Delete Message

knudfl 03-21-2011 01:18 AM

2 Attachment(s)
Welcome to LQ.

The package : sudo apt-get install xgraph

Please have a look into the examples in the xgraph source code :
xgraph-12.1/examples/ \
Animation.xg bar.xg surface2.xg surface3.xg surface.xg xgtest.xg
... to know the possible formatting.
Also, the suffix xg, xgr : Not really required, is just an indicator,
that tells xgraph can run it. Suffix .txt or no suffix will do as well.
Two small examples are attached : data.txt, dropRate.txt.

knudfl 03-22-2011 06:53 PM

About using awk filters to make xgraph do plots :

Please read this LQ post ( # 4 about ns2 trace files )


adel.elkabbany 03-24-2011 06:41 PM


adel.elkabbany 03-24-2011 06:47 PM

sudo apt-get install xgraph
sudo apt-get install xgraph

adel.elkabbany 03-24-2011 06:51 PM

sudo apt-get install xgraph(what is this?)

knudfl 03-24-2011 07:01 PM


sudo apt-get install xgraph ( what is this ? )
Asking questions about xgraph probably means, you will also want the application.

'sudo apt-get install xgraph' is the command to install the package xgraph.
""Ubuntu Documentation: Installing applications.""

xgraph-12.1/examples/ : xgraph_12.1.orig.tar.gz


adel.elkabbany 04-02-2011 05:19 AM

dear sir:
i use ns-2.34 on ubuntu,i want to plot xgraph(throughput,delay,deliver ratio vs time).

when i run avgStats.awk with the command awk -f avgStats.awk > avgStats.xgr in a terminal,it creates a file avgState.xgr but it's an empty file, i don't know the reason----------------(1)
how i can convert awk file into xgr file?
i use awk files because it include all parameters i want to plot to get the results against time.
according a reply from lq, i put the command:

awk -f avgStats.awk src=2 dst=3 flow=0 pkt=1000 > stats.out

but it give the below message :

awk: avgStats.awk:4: fatal: cannot open file `' for reading (No such file or directory)
(it can't read '')---------------------------(2)
what i do? thanks in advance------------------------(3)


knudfl 04-02-2011 06:22 AM

'avgStats.awk' is a script, that will write six lines of statistics
from some, not all See the file
The package trace2stats (which means trace to statistics) was shown
as the first hit in a Google search, mainly because it was first.
You are supposed to find / read all other hits yourself.

Also : Read the awk documentation

If you want to know how plots can be done in ns2, then run the included examples.
1) ns-allinone-2.34/ns-2.34/tcl/ex/wireless-scripts/runall.cmd
2) ns-allinone-2.34/ns-2.34/tcl/ex/red-pd/
..... And none of these use xgraph, but gv and gnuplot, to show the result.


adel.elkabbany 04-06-2011 12:27 PM

dear knunfi: thanks a lot for u useful replay and u advise to change to gnuplot, and the question is:

how can i use the awk files(for throughput,delay and delivery ratio ) to show the results graphically with gnuplot? what is the commands?

thanks in advance.


knudfl 04-06-2011 01:20 PM

I don't think, you can use "the awk files". Most of the awk scripting
is for a specific trace file. You will simply have to continue your search,
or write a script yourself. Hence the awk documentation link.
And awk scripts are not used, if things are too complex ..

Run the examples ns-allinone-2.34/ns-2.34/tcl/ex/wireless-scripts/runall.cmd etc.
to see how things can work.

Other examples

knudfl 04-08-2011 10:14 AM

Some interesting information here : "instantThroughputStll.awk"

knudfl 05-04-2011 12:52 PM

More awk scripts ....
> > droppackets.awk totalpacketssent.awk, totalpacketsreceived.awk,
p-d-f.awk instantJitter.awkcwnd.awk

And ..

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