8

I need to plot a graph, given some data, where on X axis will be names of data and on Y axis those data, and it will be given by a table, and it will be line graph with the data connected. If there was a possibility to draw more data into one graph, it's even better.

I know MS Excel can do exactly that, but I don't have MS Excel anymore.

I have installed R and tried to learn it, and I can do things like histograms, but I still have no idea how to do basic 2D graph with given data. It's like R was not build for this...

I think mathematica can do that somehow, but I don't have mathematica too.

edit: I will also add I am using Mac OS X, but I have linux and windows VM too, so the system doesn't really matter

edit2: as Idigas asked, I would more preferred programming than spreadsheed solution, but I don't care that much

3
  • You want a spreadsheet solution or a programming solution ?
    – Rook
    Feb 2, 2010 at 0:56
  • Idigas: can be both I guess, I would prefer programming solution though, because it's "cleaner" Feb 2, 2010 at 1:13
  • Why not scilab ? It's free ... works nicely ...
    – Rook
    Feb 2, 2010 at 1:14

7 Answers 7

5

Try R again. This time, use ggplot2. Here's an example of data points snagged from the website.

geom_point

That graph was done using the built-in mtcars dataset, with the following code:

> p <- ggplot(mtcars, aes(wt, mpg))
> p + geom_point(aes(colour = factor(cyl)))

Stackoverflow.com has a small ggplot2 user base. Otherwise, the ggplot2 Google Group is a great place to ask questions.

4
  • If you are using R, this is a great suggestion, but Karel sounded as if R was picked out of desperation in the hope that it was a path to a graph solution, not because of any real familiarity with R. Feb 3, 2010 at 23:40
  • I guess I took Karel's desire for a programming solution to heart, and I stand by my answer. Importing a text file into an R data frame and plotting in ggplot2 is IMHO the best programming solution, with matplotlib (suggested by Benjamin) as a close second.
    – fideli
    Feb 4, 2010 at 5:50
  • I am looking at my older questions and I have found this one again. I learned R in the end, really anything is possible there, thanks for your solution. The only thing I don't like is the sometimes really weird syntax. Aug 9, 2010 at 12:35
  • 1
    Agreed on syntax. It's the main thing I have against using R or suggesting it.
    – fideli
    Aug 16, 2010 at 13:13
6

You could always use google docs? It has a spreadsheet application with similar functionality to excel, ie can draw graphs based on data tables. Just click Insert -> Chart

alt text

It is entirely online, and does not require downloading of any software. Also supports sharing / collaboration.

5

If you are looking for a solution you can program, try gnuplot. Many programs like R or octave can interact with gnuplot. Or you can run gnuplot standalone. It can read text files containing data and render them as plots. As far as line plots go, it can do anything from this:

bivariate example

to this

world map

Some useful links:

  1. Making plots using Ocatve, gnuplot & LaTex
  2. Demo scripts for gnuplot 4.2
  3. Gnuplot tutorial
4

You might want to give matplotlib a try.

matplotlib uses python, so you can do complex computation programatically and also directly access existing modules for e.g. linear algebra and mathematical functions. Heck, you can even do symbolic math in python.

matplotlib has an convenient front-end (pylab) modeled much after MatLab(tm) or gnuplot that also makes it very usable interactively.

enter image description here

3

Openoffice is probably the "best" alternative to MS Office. It will do pretty much anything that MS Office can, although perhaps not quite as elegant in some cases.

1
  • If you are used to spreadsheets, I would go with openoffice. It's intended to emulate excel. Feb 2, 2010 at 3:18
1

One other alternative is Google Chart Tools

0

I found out Plot (mac os x only) is the thing I really like the most so far.

3
  • You like it better than Grapher?
    – waiwai933
    Feb 2, 2010 at 1:26
  • OK, now I declare myself idiot, because I totally forgot about existence of Grapher.app. Resubmit this comment as a new answer and I will accept it as the best answer. sigh Feb 2, 2010 at 1:33
  • 1
    oh, maybe not. more than I play with both, I really like Plot more. Feb 2, 2010 at 1:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .