Adding a second set of data to a scatter chart

I'm plotting x-y on a scatter chart from a table. I want to add another set of data, that is, add it on the same chart. The second set of data is on another table on the same page as the first. Both sets of data have the same x and y coordinates. I can create a second chart and overlay the charts, but that is far from ideal.


I saw one old post that said to Cmd-option select the second set after selecting the chart. That just created a copy for me.


This page from Apple https://support.apple.com/kb/PH17006?locale=en_US&viewlocale=en_US says after selecting "Edit Data References" to "Add data from a range of cells: Drag over the table cells" which only adds Y data. I can't see how to get both x and y from the second set. But as far as I can tell this page does not deal with scatter charts (just pretends they don't exist).


Numbers 6.0 on Mojave 10.14.4.

iMac 27" 5K, macOS 10.14

Posted on May 3, 2019 10:49 AM

Reply
Question marked as Top-ranking reply

Posted on May 3, 2019 7:17 PM

Crikey.


I think both of our answers are based on assumptions from the sparsity of information in your original post.


I also think that this may do what you want. You need to switch round your columns.


This is your first test:



This is your second test, before adding its data to the chart:



Now click on the chart and choose Edit Data References:


Click at the top of the first column:



Now click at the top of the second column:



At the moment, both of the columns in the second table are referenced to y, which is not what you want, so...


Click at the top of the first column in the second table, and deselect Share X Values:




And you get this:



Which I think is what you want:


Hope it helps,


H

Similar questions

10 replies
Question marked as Top-ranking reply

May 3, 2019 7:17 PM in response to MtnBiker

Crikey.


I think both of our answers are based on assumptions from the sparsity of information in your original post.


I also think that this may do what you want. You need to switch round your columns.


This is your first test:



This is your second test, before adding its data to the chart:



Now click on the chart and choose Edit Data References:


Click at the top of the first column:



Now click at the top of the second column:



At the moment, both of the columns in the second table are referenced to y, which is not what you want, so...


Click at the top of the first column in the second table, and deselect Share X Values:




And you get this:



Which I think is what you want:


Hope it helps,


H

May 3, 2019 4:49 PM in response to MtnBiker

As I understand it a scatter chart has just one set of 'x' data and multiple sets of 'y' data. By default the 'x' data is retrieved from the first column of the first table.


I have a table and scatter chart like this:



To add extra data to the chart, I create the new table, ignore its first column (the x data) and add the various columns of y data.


To do this I click on the chart, then on Edit Data References, which gives me this:


The x and y values are highlighted in the first table.


Now I click on the first header row of y data in the second table and add it to the chart:



I can now click on the header in the second column of the second table and add its data to the chart:


Hope this makes some sort of sense. Deselecting "Share X Values" seems to lead to a world of pain, but that's probably something I'm not understanding.


(And if someone can explain why my x axis starts with December when my data starts with January I would be much enlightened.)


Hope it helps,


H





May 3, 2019 3:47 PM in response to MtnBiker

Here's what works for me.


I started with the 'Scatter Chart' sheet in the 'Charting Basics' template at File > New in your menu and added an extra series.




I clicked the chart and then ' Edit Data References'



Then dragged the bottom right corner of the data area right to include the new series.



Then in the lower left corner chose 'Share X Values'




Giving this:




Your data table may be set up slightly differently but playing with these various controls should give you what you want.


SG

May 3, 2019 7:04 PM in response to HD

@HD "As I understand it a scatter chart has just one set of 'x' data and multiple sets of 'y' data. By default the 'x' data is retrieved from the first column of the first table." Do you think this is a restriction that Numbers has? If so I'm not going to succeed. Of course in real life this isn't true but maybe Apple thinks differently.

May 4, 2019 9:54 AM in response to HD

Still not sure what "Sharing X Values" means. But I had missed that this procedure is deselecting, not selecting. In any case it works.


Also I hadn't sorted out what was dependent on what (I wasn't even thinking about dependency; I knew how I wanted the chart to look. My old brain cells took a while, but I guess y is dependent on x in this case—the number of bars depends on how much has been used. Still running this test—took me a while to be consistent on how I did it.


FWIW my old battery isn't too bad; on a recent trip I thought it wasn't lasting long enough. Charging iPhone (mainly used as a GPS because off the grid), camera batteries, and a smaller battery to charge the iPhone during the day (I think that wasted a lot of power—not sure I'm going to take the time to test that, but I should). Plot not shown, but I'll redo it as an exercise. Here's the baseline running now (Changed to polynomial based on how it looked with your samples. Should be linear but presumably the bar algorithm isn't right):



Thanks again to both for your help. PS I put the link to this in my notes in case I forget. Scatter charts in Excel and Numbers were always a struggle.

May 3, 2019 6:20 PM in response to HD

Thank you RGIII and HG for your very detailed answers. Both of your examples assume one value per month, but that's not the general case nor is it my case.


Here's two sets of sample data:

First set used for chart shown


Another similar test run, but the large value is not charging an iPhone.


I will reread both your answers to see if I'm missing something.


FWIW I'm testing how a 24,000 mAh battery charges my iPhone. I'm trying to determine if another battery is worn out. I have two similar batteries of different ages. So the new one will act a baseline. I don't expect 100% as there must be some losses and the phone is on while charging which will use some power which I'm not accounting for either. The left hand (y) value is the number of bars showing on the battery which give a crude idea of how much is left. Again having a baseline will give me a reference. And the x value is the theoretical percentage of the battery that was used. Calculated by dividing the power used ( The second line of data: iPhone from 45 % to 67% of its capacity of 2716 mAh, so in this case 22% of 2716 divided by 24000). Fit line is linear as a reference.


Again thank you for responding.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Adding a second set of data to a scatter chart

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.