How to make a simple x vs y graph in Google docs

6 replies · 6K views · last reply
sp3sp2sp
Messages
100
Reaction score
4
If I select two columns of data what are the steps to make a simple x vs y graph of that data? I know its sort of a dumb question but i can't see how to do this. It automatically suggests any graph other than a basic x vs y. Thanks for any help
 
I assume you want the data displayed as points rather than lines, bars, wedges, etc.

Select the data you want to plot.
In the menu at the top, choose Insert --> Chart. The default is a line graph.
In the Chart Editor, choose Data --> Chart type --> Scatter chart. This gives you points instead of a line.

Google Sheets screenshot: two columns of x values 1 to 20 and y values 1 to 400 (squares of x), with a scatter chart titled 'y vs. x' plotting the points along a rising curve.
 
Attachments
  • Google Sheets screenshot: two columns of x values 1 to 20 and y values 1 to 400 (squares of x), with a scatter chart titled 'y vs. x' plotting the points along a rising curve.
    graph.gif
    23.9 KB · Views: 1,410
Thanks for the steps jtbell appreciate it. I did exactlt as you specified and I can get the scatter chart but the x-axis is always missing. I attached pic of what it looks like. Its just random numbers. Thanks for any more help
 
Attachments
That looks like it's plotting the x and y values separately, blue and red respectively. I have to go out soon, but later today I'll try to reproduce your result and see how the steps differ from the way I made my plot.

In the meantime, try adding labels to the top of each column of data (like my x and y) and include them when you select the data. Maybe that makes a difference.
 
I tried to copy your data by reading the x and y values from your graph. Here's what I got immediately after choosing Insert --> Chart:

Google Sheets column chart editor and bar chart with X-axis range A2:A7 and Series B2:B7, showing bars at x-labels 2, 5, 6, 8, 16, 20 with values 45, 47, 30, 52, 57, 20.


Then after changing it to a scatter chart, without touching any of the other settings in the chart editor:

Google Sheets chart editor screenshot: scatter chart of data in columns A and B, with X-axis set to A2:A7 and Series set to B2:B7, plotted as blue points.


As you can see, I have both x and y axes, and a single set of points. In the chart editor, there are ranges for "X-axis" and "Series". I bet you have a blank "X-axis" and two "Series".

[added] Aha! I deleted the "X-axis" range in the chart editor, and added a second "Series" with the range A2:A7:

Google Sheets scatter chart editor screenshot showing a spreadsheet with two columns of numbers and a scatter plot of blue and red points on a grid, with series ranges B2:B7 and A2:A7.

The graph looks like what you have, except that the colors are switched. If you have something similar in the chart editor, try deleting one of the "Series" and putting it in the "X-axis".
 
Attachments
  • Google Sheets column chart editor and bar chart with X-axis range A2:A7 and Series B2:B7, showing bars at x-labels 2, 5, 6, 8, 16, 20 with values 45, 47, 30, 52, 57, 20.
    graph2.gif
    35.6 KB · Views: 907
  • Google Sheets chart editor screenshot: scatter chart of data in columns A and B, with X-axis set to A2:A7 and Series set to B2:B7, plotted as blue points.
    graph3.gif
    32 KB · Views: 1,125
  • Google Sheets scatter chart editor screenshot showing a spreadsheet with two columns of numbers and a scatter plot of blue and red points on a grid, with series ranges B2:B7 and A2:A7.
    graph4.gif
    33.1 KB · Views: 859
Wouldn't hurt to know what program do you use. For example I am not 100% sure Excel and OpenOffice Calc work the same way.
 
Thank you again for this help. I finally found out that if I select data columns in separate steps then it will plot the points and plot line.
Im trying to plot pressure vs temp to extrapolate value for absolute zero, but the graph looks pretty bad with the values i got from lab. I think I should repeat lab
btw Borek this is all in google docs.
Line graph of cmH2O against deg C, with pressure rising from about 1001 at 22.6 deg C to about 1007.6 at 24.4 deg C, with a steeper jump between 23.5 and 23.7 deg C.
 
Attachments
  • Line graph of cmH2O against deg C, with pressure rising from about 1001 at 22.6 deg C to about 1007.6 at 24.4 deg C, with a steeper jump between 23.5 and 23.7 deg C.
    chart.png
    2.8 KB · Views: 918