HI , 
Dear Arun Peri 


  
For graph designing their are many tools in NS2.... like xgraph, trace
graph, gnuplot etc and in windows environment there is a good one that is
sigmaplot. They can be easily downloaded from internet. 

  

For linux version for NS2... Gnu plot is good one and easier one also. Thats
why I recommend you to use gnuplot. becasue tracegraph and xgraph have not
much options. 

  

For Gnuplot I can help you as I can tell you how to start making simple
graph in gnuplot. And I am sure if you will be able to design a simple graph
than it will not be much difficult to enhance your graph expertise.... 

  

STEPS for use and design for gnuplot. 

  

1. If you are using NS2 on LInux system then GNUPLOT will be there by
default. If you are using NS2 on windows system through cygwin then I am not
sure about that. YOu can check it through typing GNUPLOT on terminal window
. If you will get any file missing message like file is not specified than
it means gnuplot is installed and dont have to reisntall it. ALternatively
you can download it from.
http://sourceforge.net/project/showfiles.php?group_id=2055 you will need
.tar.gz for linux and .zip for windows. 

  

2. Installation is very easy. You will find easy methods through foloowing
links 

        
http://homepage.mac.com/marco_coisson/gnuplotGUI/getting_gnuplot.html


         http://www.sarcheck.com/gnuplot/billh.htm

  

         http://www.duke.edu/~hpgavin/gnuplot.html   (GNUPLOT TUTORIAL) 

  

    only in case of windows system you will need instalation and download,
otherwise no need.   

  

  

3. After confirming installation. you must gave to check the environment
variable. in basch file. 

  

4.Following files will be related with your work 

    a. Graph.p       (code file for gnuplot) 

    b. Graph.tr      ( trace file from which gnuplot will take readings for
ploting a graph-- you have to take your readings   

                            from your code 

                           first coloumn is always X-axis and second coloumn
is Y-axis and son on ) 

    c. Graph.eps    ( actual graph image file --can be generated after
running the graph.p file --. It is eps file extension. you can only open in
linux . If windows you can open it through IRFAN VIEW software  otherwise
ADOBE ILLUSTRATOR can also open this file on windows) 

  

5. Now put the graph.p file in the folder where your graph.tr file (yours)
is available and from terminal window go to that destination and just write
GNUPLOT 

    on terminal window you will get GNUPLOT> . 

  

6. please also check the trace file path in GRAPH.P file. it is necessary to
provide file path there in code file. 

  

7. just write GNUPLOT> load "graph.p" 

  

8. and you will have a graph. 

  

" COngratulations on your having a graph successfully" 

  

9. you can exit from gnuplot through EXIT command. 

  

10. for remaining commands for Graph plottiong. you have to explore its
tutorial, mailing list for ns2 (I recommend you to join the mailing list of
libnux. 

     Follwing links can give you much information you need. 

  

     http://t16web.lanl.gov/Kawano/gnuplot/index-e.html

  

     http://www.gnuplot.info/

  

 ========================== 
SAMPLE FILE FOR GRAPH.P 
============================= 
  
set title "XYZ" 
set xlabel "SEC(Seconds) " 
set ylabel "BW" 
set xrange [0:1300] 
set yrange [0:110] 
#set multiplot 
#set size 0.5, 0.5 
#set origin 0.0, 0.5 
  

set grid 
set boxwidth 20 
#plot "/home/XYZ/ns-allinone-2.33/ns-2.33/mygrid/graph/abc.tr"  using 1:2
with lines lt 1 lw 2 title 'My Work' 
plot "/home/XYZ/ns-allinone-2.33/ns-2.33/mygrid/graph/abc.tr" using 1:2
title 'Previous Work' with linespoints , \ 
   "/home/XYZ/ns-allinone-2.33/ns-2.33/mygrid/graph/abc.tr" using 3:4 title
'My Work' with linespoints 

    
#set tmargin 0 
#set bmargin 0 
    
set term post eps enhan "Helvetica" 60   
set out "combine-curve-time.eps" 
#set nomultiplot 
====================================================== 
  
first row represents X axis and second row represents Y axis 
====================================== 
TRACE FILE format 
===================== 
10  9 
30  12 
50  27 
70  28 
90  33 
110  39 
130  43 
150  44 
170  48 
190  52 
210  57 
320  58 
330  60 
370  65 
450  66 
470  68 
490  75 
530  79 
550  81 
1280  100 
================================= 
  
  
  
Hope it will help you. 
  
Regrads 
  
Saim Ghafoor 
M.S Student 
Hanyang University 
South Korea 

  

-- 
View this message in context: 
http://old.nabble.com/Re%3A-help-for-generating-graphs-tp26569593p26590481.html
Sent from the ns-users mailing list archive at Nabble.com.

Reply via email to