LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-01-2011, 02:38 AM   #1
naren123.k
Member
 
Registered: Jan 2011
Posts: 85

Rep: Reputation: 17
gnuplot graph using trace file


hi all
can any one tell me how to plot graphs for trace files generated in ns2
using xgraph and gnuplot.
 
Old 05-01-2011, 04:42 AM   #2
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by naren123.k View Post
hi all
can any one tell me how to plot graphs for trace files generated in ns2
using xgraph and gnuplot.
How about reading documentation, e.g. http://gnuplot.info/documentation.html ?
 
Old 05-02-2011, 12:56 AM   #3
naren123.k
Member
 
Registered: Jan 2011
Posts: 85

Original Poster
Rep: Reputation: 17
but i am not getting the right command to start with gnuplot.
when i enter GNUPLOT i am getting error message like this..

[root@localhost ~]# GNUPLOT
bash: GNUPLOT: command not found
[root@localhost ~]#
 
Old 05-02-2011, 04:27 AM   #4
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by naren123.k View Post
but i am not getting the right command to start with gnuplot.
when i enter GNUPLOT i am getting error message like this..

[root@localhost ~]# GNUPLOT
bash: GNUPLOT: command not found
[root@localhost ~]#
Why do you want to run 'gnuplot' as 'root' user ?

And where in the 'gnuplot' documentation (what page number, which paragraph exactly) it is written that the program name (the command) should be entered in capital letters ?

What does the fact that you don't know how to even start 'gnuplot' has to do with your plotting needs described in the first post ?
 
Old 05-02-2011, 04:34 AM   #5
naren123.k
Member
 
Registered: Jan 2011
Posts: 85

Original Poster
Rep: Reputation: 17
i tried this as i am new to this anyways, can you tell me how to extract "s" "r" from trace files into filename.dat for plotting graphs??
Attached Files
File Type: txt test.txt (26.0 KB, 141 views)
 
Old 05-02-2011, 05:25 AM   #6
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 454Reputation: 454Reputation: 454Reputation: 454Reputation: 454
Quote:
Originally Posted by naren123.k View Post
i tried this as i am new to this anyways, can you tell me how to extract "s" "r" from trace files into filename.dat for plotting graphs??
Sorry, but you can't formulate a question.

The thread name is misleading - in reality you seem have at least two problems:
  1. not reading the documentation;
  2. not knowing what parsing is.

I am still waiting for an answer regarding all capital letters in GNUPLOT. And if not yet, you need to understand from 'gnuplot' documentation which formats are understood by 'gnuplot'.

Regarding the second item - I do not know what part of the information from the attached text file you need to plot, which part of the information is supposed to be used as X axis values and which - as Y axis values.

General info on parsing:

http://en.wikipedia.org/wiki/Parsing -> http://en.wikipedia.org/wiki/Lexical_analysis - probably lexical analysis is more important in your case.

In simple practical cases the 'cut' utility might suffice - read

man 1 cut
.

You might need to run 'cut' a number of times. You might also need 'paste' utility in order to combine columns in separate files into columns in a single file:

man 1 paste
.

For more complex parsing you might need 'awk' (I am not an 'awk' user) - look up on the web

awk tutorial
.

'awk' also can produce the needed output, i.e. to me it looks that with 'awk' you won't need 'paste' (and maybe you won't need 'paste' even with 'cut').

I prefer to use Perl for my parsing and text processing needs - if you are to learn Perl, a good place to start from is http://perldoc.perl.org/ -> http://perldoc.perl.org/index-overview.html , http://perldoc.perl.org/index-tutorials.html , http://perldoc.perl.org/index-faq.html .

And also read

man perl

- to begin with.

Perl takes longer to learn though.
 
Old 11-06-2013, 02:42 AM   #7
somaroy
LQ Newbie
 
Registered: Nov 2013
Posts: 1

Rep: Reputation: Disabled
Smile Extracting "r" and "s"

Use "^r" tr1.tr > tr2.tr


Please tell the next step to proceed as i dont know what to do after this

Last edited by somaroy; 11-06-2013 at 02:44 AM.
 
  


Reply



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
plot trace file into a graph tootz Linux - Software 14 04-26-2012 03:07 AM
[SOLVED] How to get the graph in Image format through GNUPLOT mq15 Linux - Software 6 02-04-2010 04:16 AM
how to create this graph in gnuplot Exoskeletor Programming 3 01-03-2010 04:22 PM
LXer: Gplot simplifies gnuplot graph creation LXer Syndicated Linux News 0 02-27-2008 11:30 PM
How to export graph as JPG file in Gnuplot ninja Linux - Software 1 05-30-2003 09:20 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:12 PM.

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
Open Source Consulting | Domain Registration