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

12th June 2012, 10:03 AM
|
|
Registered User
|
|
Join Date: Mar 2005
Posts: 34

|
|
|
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?
|

12th June 2012, 12:21 PM
|
|
Registered User
|
|
Join Date: Dec 2006
Posts: 1,718

|
|
|
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.
|

12th June 2012, 07:32 PM
|
|
Official Gnome 3 Sales Rep. (and Adminstrator)
|
|
Join Date: Jul 2011
Location: Leamington Spa, UK
Age: 30
Posts: 1,708

|
|
|
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.
|

12th June 2012, 08:40 PM
|
 |
Registered User
|
|
Join Date: Nov 2006
Location: Detroit
Posts: 4,617

|
|
|
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:
__________________
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
|

13th June 2012, 11:33 AM
|
|
Registered User
|
|
Join Date: Mar 2005
Posts: 34

|
|
|
Re: Simple program to make histograms like graphics.
Thanks all for the suggestions, was very useful!
|

13th June 2012, 11:53 AM
|
 |
Registered User
|
|
Join Date: Mar 2009
Location: Lancaster, UK
Posts: 883

|
|
|
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).
|

13th June 2012, 12:19 PM
|
 |
Registered User
|
|
Join Date: May 2011
Location: Gijón, Spain
Age: 40
Posts: 28

|
|
|
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!
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 23:31 (Wednesday, 22-05-2013)
|
|
 |
 |
 |
 |
|
|