Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12th June 2012, 10:03 AM
colt Offline
Registered User
 
Join Date: Mar 2005
Posts: 34
linuxfirefox
Simple program to make histograms like graphics.

Hi, I need to do some histogram like graphics, but with different categories. For instance, in the "x" axis I want to put the name of the categories (like: car, airplane, boat, etc..) and in the y-axis the quantity (3,4,1, etc..). I would also like if each category could use different colors for each bar representing it. If these demands can be satisfied, the simpler the program is (easy to use) the better.

Any recommendations?
Reply With Quote
  #2  
Old 12th June 2012, 12:21 PM
george_toolan Offline
Registered User
 
Join Date: Dec 2006
Posts: 1,718
linuxfirefox
Re: Simple program to make histograms like graphics.

Try

Code:
yum install gnuplot
See http://www.google.de/search?q=gnuplot+histogram for details about gnuplot.
Reply With Quote
  #3  
Old 12th June 2012, 07:32 PM
Gareth Jones Online
Official Gnome 3 Sales Rep. (and Adminstrator)
 
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,708
linuxfirefox
Re: Simple program to make histograms like graphics.

Spreadsheets like LibreOffice Calc, Gnumeric, and Calligra Sheets/KChart are probably the easiest GUI tools.

Gnuplot is great for more scientific/publication-quality graphs, and has the most flexible output options (various image formats, PostScript, PDF, SVG, EMF, various TeX/LaTeX/ConTeXt-formats). It does involve typing commands as text though, but this has the advantage of being easier to script if you want lots of similar plots.

There are dozens of others, some more specialized, some just front-ends to Gnuplot, but I'm not familiar with most of them: http://en.wikipedia.org/wiki/List_of_graphing_software.
Reply With Quote
  #4  
Old 12th June 2012, 08:40 PM
RupertPupkin's Avatar
RupertPupkin Offline
Registered User
 
Join Date: Nov 2006
Location: Detroit
Posts: 4,617
linuxfedorafirefox
Re: Simple program to make histograms like graphics.

I'd go with R, which is in the Fedora repos (yum install R). R is a command-line program but it's easy to use. After installing it just run 'R' without the quotes in a terminal window, which gives you a command prompt (>). From there you enter your commands, then enter quit("yes") (or just q("yes"), or the Ctrl-d key combo) when you want to exit. Here's a simple example of the commands to enter at the R command prompt to get a histogram with different colors per category:

Code:
categories <- c("car","airplane","boat","bicycle","skateboard")
quantities <- c(11,3,6,8,12)
barplot(quantities, names.arg=categories, col=rainbow(length(categories)),
        main="Transportation", xlab="Type", ylab="Count")
That barplot command should be all on one line (I just split it into two to make it easier to read here). By default the histogram will appear in a separate window. If you want to save it as an image file, say in a PNG file called myhistogram.png, then you'd use this command before running the barplot command:
Code:
png("myhistogram.png")
In this case the plot won't show up on the screen; you'll have to open the PNG file in an image viewer. Below is a picture of the histogram, along with a picture of the entire R session with the plot being saved as a PNG file in the current directory:
Attached Thumbnails
Click image for larger version

Name:	histogram.png
Views:	46
Size:	15.0 KB
ID:	23252   Click image for larger version

Name:	histogram-Rsession.png
Views:	40
Size:	168.6 KB
ID:	23255  
__________________
OS: Fedora 18 x86_64 | CPU: AMD64 3700+ 2.2GHz | RAM: 2GB PC3200 DDR | Disk: 160GB PATA | Video: ATI Radeon 7500 AGP 64MB | Sound: Turtle Beach Santa Cruz CS4630 | Ethernet: Realtek 8110SC
Reply With Quote
  #5  
Old 13th June 2012, 11:33 AM
colt Offline
Registered User
 
Join Date: Mar 2005
Posts: 34
linuxfirefox
Re: Simple program to make histograms like graphics.

Thanks all for the suggestions, was very useful!
Reply With Quote
  #6  
Old 13th June 2012, 11:53 AM
Adunaic's Avatar
Adunaic Online
Registered User
 
Join Date: Mar 2009
Location: Lancaster, UK
Posts: 883
linuxfirefox
Re: Simple program to make histograms like graphics.

I would agree with using R as well. It is brilliant for quick and clean plots. I would say the only real options are ROOT and R. ROOT is a bit of a pain so I would avoid it unless R cannot do what you want (i.e. the dataset gets to big for R to handle).
Reply With Quote
  #7  
Old 13th June 2012, 12:19 PM
j0534ng31's Avatar
j0534ng31 Offline
Registered User
 
Join Date: May 2011
Location: Gijón, Spain
Age: 40
Posts: 28
linuxfirefox
Re: Simple program to make histograms like graphics.

RupertPupkin:

Wow! I was not aware that such tool (the R Project) existed.

Great info and a very clear/useful sample...

Thank you, sir!
Reply With Quote
Reply

Tags
graphics, histograms, make, program, simple

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
cannot compile a simple c program dash Using Fedora 21 13th February 2009 01:56 PM
How do I make a simple network program? zacharysturgeon Servers & Networking 2 24th April 2008 10:34 AM
Simple V4L program phkahler Programming & Packaging 0 24th April 2007 06:52 PM
Help with simple graphics charlie13 Programming & Packaging 6 15th June 2006 12:26 AM
cant compile simple c++ program... help! sirbrett Programming & Packaging 3 1st September 2005 08:37 PM


Current GMT-time: 23:31 (Wednesday, 22-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat