2

I have this set of data

x       y  
0.5 306.3
1   622.3
2   1230.1
3   2017.7
4   2589
5   3175.4
6   3751.9
9   5585.7
12  7388.8
15  9218.8
20  12042.8
25  15056.5
30  18081.2
45  27095.3
60  35609.2
80  47263.1

When I plot x vs y with R I obtain an almost linear plot, when I plot them with Libre Office Calc I obtain a parabolic plot.

How is that possible?

Which one is the right one?

Glen_b
  • 257,508
  • 32
  • 553
  • 939
Donbeo
  • 3,001
  • 5
  • 31
  • 48
  • 2
    Excuse me, why did you delete the plot I went to the trouble of including for illustration? It was nothing other than a cleaner, larger (i.e. non-screenshot) version of the same plot you linked to in comments. Why remove it? If you included a link to the plot, you intended it to be seen. I made it easier to be seen, and in the correct context (in your question). What's up? – Glen_b May 19 '13 at 09:50
  • Sorry my mistakes, it's my first time with this forum and I still do not know how does it works. – Donbeo May 20 '13 at 09:44
  • Okay; I put it in my answer instead, so at least people can see it. – Glen_b May 20 '13 at 11:15

2 Answers2

8

From the look of your link below, you obtained this plot:

OP's line plot

It looks like you're just plotting y vs its index in Libre Office Calc.

Let's look at the difference - first in R:

R gives (using plot(x,y)):

y vs x plot

But if you plot y vs its index and plot lines (plot(y, type="l", col=4)), you get:

y vs index as line plot

If you don't tell Libre Office Calc to do a scatter plot, by default it does a barplot of the series. Instead you seem to have got it to do a line plot of just the $y$ series. You can, for example, get that (the top plot in my answer) by selecting the $y$ column and then Insert, Chart and then choosing Line and then clicking on the third plot, "Lines only".

Libre Office Calc will produce the correct plot if you tell it the right things:

y vs x in Libre Office Calc

You can do this as follows:

Select both data columns. Insert then Chart

The Chart Wizard window should pop up (if you're using a recent version, anyway, mine were done in 4.0.0.3).

Choose the XY (Scatter) option.

Click Finish (or choose one of the related plots there, like the line-and-points or the line-only plot and then click Finish).

Glen_b
  • 257,508
  • 32
  • 553
  • 939
  • My r plot is look like your. But my libre office plot is this one https://docs.google.com/file/d/0B3FIuCA5bZUaakNtNDhrWE5Vc1k/edit?usp=sharing On the x axes i do not have the index – Donbeo May 19 '13 at 09:23
  • thanks probability I'm making some mistakes with libre office is the first time I use it. Thanks for help – Donbeo May 19 '13 at 09:27
  • 2
    Yes you do have the index of the $y$ points, it's just not *telling* you that you do. – Glen_b May 19 '13 at 09:45
0

Just to reiterate what was mentioned above:

To have your provided values along the x-axis, you must choose "XY Scatter", and NOT Line graph or anything else...

So highlight your two columns of data, choose Insert -> graph -> XY Scatter, and it should create a "data range" for your "x axis". The "x axis" data range field does NOT appear and is not create-able (that I can tell) when you select a line graph...

Matt
  • 1