+ Reply to Thread
Results 1 to 9 of 9

How to make clustered scatter plot with custom error bars?

Hybrid View

  1. #1
    Registered User
    Join Date
    04-20-2017
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2016 (Windows)
    Posts
    4

    How to make clustered scatter plot with custom error bars?

    Hi all,
    I'm looking for help making a clustered plot where the X-axis is categorical data and the Y axis is numerical data with custom error bars in the Y axis. Each cluster contains percent errors corresponding to three dimensions (i.e. X/Y/Z) and the clusters are different settings in which the error is measured. The custom error bars reflect results of a statistical test I calculated outside of Excel.

    I can currently do this with a clustered column chart (see image below), but would like to represent the plotted data as points (as in a scatter plot) rather than columns while retaining the error bars around them. The result would be identical to the graph below but with points placed where the columns are currently. I've attached an example file containing the same chart and its underlying data.

    Any advice on how to do this in Excel would be very much appreciated. I'm also open to solutions using software other than Excel.

    Edit: In hindsight, 'scatter plot' was a poor choice of words in the title. What I'm looking for is something that plots the exact same data as shown below (agregates only, not individual measurements as in a true scatter plot) but simply using dots/circles in place of columns.


    Excel Chart Question - Example.png
    Attached Files Attached Files
    Last edited by jmikes; 04-20-2017 at 02:22 PM.

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: How to make clustered scatter plot with custom error bars?

    Your sample file only includes the summary statistics and not the raw data that I assume you want to plot on the chart as points. Assuming you have the data elsewhere for the "scatter chart":

    1) Create several series of (x,y) pairs for each point you want to chart. I am not sure what you are going for, but it might be arranged in the spreadsheet like:
    x for setting1 x -- setting1 x -- x for setting1 y -- setting1 y -- x for setting1 z -- setting1 z -- ...
    1 -- setting1 x1 -- 2 -- setting1 y1 -- 3 -- setting1 z1 -- ...
    1 -- setting1 x2 -- 2 -- setting1 y2 -- 3 -- setting1 z2 --...
    and so on
    2) create a scatter chart based on the first 2 columns, then add the remaining pairs of columns as additional data series (I usually use the Select Data Dialog for this).
    3) For the error bars, add a 7th data series to the chart that places a point where you want the error bars to originate from, then add error bars to that series and format as desired.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: How to make clustered scatter plot with custom error bars?

    Your sample file only includes the summary statistics and not the raw data that I assume you want to plot on the chart as points. Assuming you have the data elsewhere for the "scatter chart":

    1) Create several series of (x,y) pairs for each point you want to chart. I am not sure what you are going for, but it might be arranged in the spreadsheet like:
    x for setting1 x -- setting1 x -- x for setting1 y -- setting1 y -- x for setting1 z -- setting1 z -- ...
    1 -- setting1 x1 -- 2 -- setting1 y1 -- 3 -- setting1 z1 -- ...
    1 -- setting1 x2 -- 2 -- setting1 y2 -- 3 -- setting1 z2 --...
    and so on
    2) create a scatter chart based on the first 2 columns, then add the remaining pairs of columns as additional data series (I usually use the Select Data Dialog for this).
    3) For the error bars, add a 7th data series to the chart that places a point where you want the error bars to originate from, then add error bars to that series and format as desired.

    On edit: then, to get the "category axis", I would use a technique like this http://peltiertech.com/Excel/Charts/Y_CategoryAxis.html to "replace" the scatter charts horizontal axis with the setting1 and setting2 labels.

  4. #4
    Registered User
    Join Date
    04-20-2017
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2016 (Windows)
    Posts
    4

    Re: How to make clustered scatter plot with custom error bars?

    Hi there,
    Thanks for taking time to offer help with this.
    In hindsight, 'scatter plot' was a poor choice of words as I am not looking to plot raw data, only the aggregate numbers shown in the image above. I'm simply looking to replace the columns in the above plot with individual points/circles, similar in appearance to what a scatter plot would use, with the same error bars as shown in the bar graph. As a result, the file I uploaded should contain all of the necessary data to produce such a plot (assuming it can be done with Excel).

    I've edited my original post to clarify.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: How to make clustered scatter plot with custom error bars?

    If I am understanding correctly, it should be as simple as converting your column chart to a line chart. Try this:

    1) Select B2:G4
    2) Insert a line chart
    3) Format the data series to have the desired marker shape and size and no line
    4) Add error bars to the series and format as desired

    Is that what you are looking for?

  6. #6
    Registered User
    Join Date
    04-20-2017
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2016 (Windows)
    Posts
    4

    Re: How to make clustered scatter plot with custom error bars?

    This is very close and I suspect a step in the right direction but not quite what I was envisioning.
    Following your advice, I get something like the image included below. We now have points with error bars rather than columns with error bars, which is what I'm looking for, however because the points are stacked vertically on each other the error bars overlap and are difficult to read. Ideally I would like the points to be staggered on the horizontal access so they don't overlap.
    I could conveivably make this shift by plotting a scatter plot where I artifically assign X values that are slightly different for points in a cluster (e.g. X/Y/Z of setting 1 are given X-coordinates of 0.8/1.0/1.2), however this would seem to require hiding the X axis and manually adding text boxes on top of the graph to label the categories as Setting 1/Setting 2 which is rather unwieldy.

    I'm realizing my question is effectively equivalent to this one from Stack Overflow. It has a solution that involves an external, downloadable package for Excel so I think that solves my problem for the time being. Having said that, if there was a native solution in Excel that didn't require an external download that might be preferable for anyone reading this post in future.

    I'll leave this post open for another day in case anyone has an excel-native solution and mark it as solved tomorrow if I don't hear from anyone.


    Excel Chart Question - Example 2.png

  7. #7
    Registered User
    Join Date
    03-04-2020
    Location
    Newcastle, Aus
    MS-Off Ver
    2016
    Posts
    1

    Re: How to make clustered scatter plot with custom error bars?

    Hi There,

    I know this is quite an old thread but I encounted this issue today and have had success in staggering data points and thought I would share for people experiencing this problem in future.
    I staggered my data set and error data seperately, this allowed me to have blank data points (empty cells) that spaced the data appropriately. I followed the same stagger pattern for my error bars and then used the custom error bar feautre to match the data.

    Attachment 665914

  8. #8
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP, 2007, 2024
    Posts
    16,460

    Re: How to make clustered scatter plot with custom error bars?

    You must have done something different than I did -- maybe left row 3 out of the chart horizontal axis range or something. I get the same thing as in your picture (where all the series are vertical over the two categories) if I simply change your original chart from a column to a line chart. Did you try it with both row 3 and 4 as the category axis (making a multi-level category axis)?

  9. #9
    Registered User
    Join Date
    04-20-2017
    Location
    Ontario, Canada
    MS-Off Ver
    Office 2016 (Windows)
    Posts
    4

    Re: How to make clustered scatter plot with custom error bars?

    You're correct, to get a graph like what I posted above simply requires changing the graph type and then hiding the lines connecting the markers.
    The extra steps I described above are required in order to get a graph that looks like the image below, where each marker is offset horizontally so that they don't overlap. This was the type of end result that I was looking for originally.

    Thanks again for your help!

    Excel Chart Question - Example 3.png

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Negative Error Bars in Clustered Column Charts
    By Thomas_Da in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 07-01-2016, 02:02 PM
  2. [SOLVED] creating step chart through scatter plot with x y error bars excel 2007
    By fight2 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 02-16-2015, 11:14 AM
  3. Excel Scatter Plot Error Bars All Show Same Standard Deviation
    By spaine in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 01-20-2015, 03:30 PM
  4. Creating scatter plot with mean/ SD error bars
    By aldo2014 in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 04-24-2014, 10:48 AM
  5. markers for error bars in clustered column graph
    By Andreea C. in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 11-20-2013, 10:18 AM
  6. How to make custom error bars stay in PivotChart
    By cammyron in forum Excel General
    Replies: 1
    Last Post: 02-05-2009, 05:50 AM
  7. [SOLVED] Custom data labels on a scatter plot
    By Bradfro in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-20-2005, 08:06 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1