Saturday, August 21, 2010

Drawing bar plot with R

Our extreme online solvers contain drawing pages to enable anyone with Internet connection to generate charts, graphs, and diagrams using R. Here we discuss the generation of bar graphs.

Our bar graph generation page is accessed at solvers/rplotpage/bar.
The page allows the user to specify the following:

  • gX, gY plot width and height in inches.
  • nvars - number of columns in data.
  • reading - Data is read rowwise if set to "by row", otherwise the reading is columnwise if reading is set to "by column"
  • type- a choice of whether the bars are to be drawn beside each other or stacked with each other.
  • orientation- whether to draw the bars vertically or horizontally.
  • axis - True if axis is to be drawn.
  • log? - use logarithm of values to display the bars.
  • border - color of the border.
  • data - text area for entering data.
  • color -whether to use color specified for each bar in the fields below.
  • density-whether to add hatching to each bar drawn.
  • Main - graph title
  • sub - subtitle
  • xlab - label along X-axis
  • ylab - label along Y-axis

Here is a snapshot of a sample input page:



And here is the resulting image when the submit button is clicked.


The default bar-plot does not include 3-D types. The R-software concentrate on creating excellent statistical analytical tools and quick visualizations and not on junk charts. We recommend the reader to use other free software like gnumeric, openoffice, kspread and others.

No comments:

Post a Comment