LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 07-10-2006, 11:09 AM   #1
hedpe
Member
 
Registered: Jan 2005
Location: Pittsburgh
Distribution: Ubuntu
Posts: 378

Rep: Reputation: 30
gnuplot: how to label x-axis with strings from data file?


Hey guys,

I am having a hard time getting gnuplot to use the first column in my data file as the label for the x-axis when it is a string. For instance, I can easily plot "1 3", x is 1, y is 3, but i can't plot "dog 3" for instance, where X should be labeled "dog".

As a sample of the data file i want to plot:
Code:
dogs 3
cats 2
monkeys 10
I don't need them to be sorted in any manner, the plot should come in the order they are listed, or whatever is default.

Thanks!
George
 
Old 07-10-2006, 10:46 PM   #2
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
I thought it is:
Code:
plot "myfile" using 2:xticlabels(1)
BUT you have to use gnuplot 4.1 for this. Ver 4.0 doesn't work. Unfortunately I am behind a machine which only has 4.0, so cannot tell you for sure.

Take also a look here: http://gnuplot.sourceforge.net/demo_4.1/

jlinkels

Last edited by jlinkels; 07-10-2006 at 10:47 PM.
 
Old 07-11-2006, 11:21 AM   #3
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,236

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
I tried it on the machine with Gnuplot ver 4.1 installed. It is correct.
 
  


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
how to find duplicate strings in vertical column of strings markhod Programming 7 11-02-2005 05:04 AM
Mouse scrolly doesn't work, even though added axis option in config file. RHLinuxGUY Slackware 8 07-23-2005 12:33 AM
GLIBC_2.3.4 not defined in file libc.so.6 when running gnuplot azariaya Linux - Software 7 01-05-2005 05:57 PM
Formatted Strings in Script File mhjones Programming 1 06-07-2004 11:54 AM
How to export graph as JPG file in Gnuplot ninja Linux - Software 1 05-30-2003 10:20 AM


All times are GMT -5. The time now is 12:22 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration