+ Reply to Thread
Results 1 to 8 of 8

Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

  1. #1
    Registered User
    Join Date
    06-18-2019
    Location
    Seattle, WA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    8

    Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    Is there any way in this cruel world to get Excel to format a date axis on a scatter plot by year? We would like the major gridlines to cross at January 1st each new year. If you look at the Major/Minor units under the Axis Options menu, Excel's formatting seems to only allow a number of days for the gridline intervals. This is utterly nonsensical when viewing how the x axis comes out (see screenshot).

    Unfortunately putting in 365 doesn't solve this because of leap years and inconsistencies in real world dates.

    Due to how we receive our data, we cannot use a line chart which enables different axis options. We need to use an XY scatter chart. The line chart screws up the date-to-value relationship, whereas the XY scatter chart preserves it.

    Excel Scatter Chart Format Date Axis.jpg

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    Due to how we receive our data, we cannot use a line chart which enables different axis options. We need to use an XY scatter chart. The line chart screws up the date-to-value relationship, whereas the XY scatter chart preserves it.
    In order to make good suggestions, we may need to know something about how you receive your data and why that screws up a line chart. A line chart is Excel's built in method for getting a date axis -- a date axis is not available to a scatter chart. If we understood how you are receiving your data, we may be able to make suggestions so that this process does not screw up the line chart.

    The other method that comes to mind is to use a "dummy series" to fake an axis. The general procedure is described here: https://peltiertech.com/reciprocal-chart-axis-scale/ Again, we may need to know something about how you are receiving data to make sure that the procedure does not break a dummy axis series as well.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    06-18-2019
    Location
    Seattle, WA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    8

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    Quote Originally Posted by MrShorty View Post
    a date axis is not available to a scatter chart
    That's what I feared...

    Quote Originally Posted by MrShorty View Post
    In order to make good suggestions, we may need to know something about how you receive your data and why that screws up a line chart.
    Here is a mock example of how we receive our data. We can't make any changes to this format. Basically the dates run left to right and each row is a new trend. The dates are unevenly spaced, and the trends will not all have values recorded for each date. There are numerous trends that we do not need to add to the chart. In reality, we have 80 rows, and usually only select 3 to 6 of them to plot.
    Attachment 628757

    Here is an example of the XY scatterplot. Notice how within the Select Data menu, it allows you to choose the X-values and the Y-values. This gets everything to always display in the right place (correct y value matched to each proper date). Notice how the green dataset has data back to 2005.
    Attachment 628759

    When changing the chart time to a line chart, the association between the dates and the Y-values gets lost. Notice how there is only one field now within the Select Data menu. Now notice how all the trends are scrunched into the same dates even though the green trend has data spanning back many years before the others.
    Attachment 628761

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    Attachments did not attach. Be sure you are using the main text editor (click go advanced or edit post or reply to thread) and scroll down to the "manage attachments" link that will bring up the working file uploader.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    While waiting, a few questions for you:

    We can't make any changes to this format.
    I understand that you may not be able to make changes to the format or arrangement of the data as it comes in to Excel. However, are you allowed to make a copy of the data in another part of the spreadsheet that would be arranged/formatted more conducively to a line chart? I see many situations where the OP says not to touch the imported data, but my solution is to use lookups/filters/pivots/etc. to make a rearranged copy of the data.

    Notice how within the Select Data menu, it allows you to choose the X-values and the Y-values.
    As one who almost always uses scatter charts, this is part of what I like about them -- it is easy for each data series to have its own X values range. However, this advantage does not coexist in Excel with the nice date axis that a line chart supports. Sometimes this comes down to a choice between the two chart types. Use a line chart so I can have a date axis, but that means I am more limited in what is going on in the spreadsheet. Or use a scatter chart so I have more flexibility in the spreadsheet, but don't have the nice date axis. Beyond that, there are more advanced techniques that I have hinted at that can allow both scatter chart and date axis to work together, but it definitely takes more work to set up and maintain.

    It might be important to understand what you can do with the data after it is imported and what other restrictions you are facing (how much can you do manually and how much must be automated).

    Maybe something like this (Scatter + line combination chart) would work for you: https://peltiertech.com/line-xy-combination-charts/

  6. #6
    Registered User
    Join Date
    06-18-2019
    Location
    Seattle, WA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    8

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    Quote Originally Posted by MrShorty View Post
    Attachments did not attach. Be sure you are using the main text editor (click go advanced or edit post or reply to thread) and scroll down to the "manage attachments" link that will bring up the working file uploader.
    Apparently now I get an error saying that new users can't use images or links of any kind until they post a few times. Weird since my original post had the image just fine...

  7. #7
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,827

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    I know the forum restricts links to outside sites until something like 10 posts, but there is not supposed to be any restriction on attachments. Know that the paper clip icon does not work for attachments (if that is how you are trying to attach them). The only consistently successful way I know of to upload attachments is by clicking on Go Advanced beneath the quick reply window, and scrolling down beneath the main post editor to the manage attachments link.

  8. #8
    Registered User
    Join Date
    06-18-2019
    Location
    Seattle, WA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    8

    Re: Formatting Date Axis on a Scatter (XY) Plot - Grid lines by Year Month or Day?

    Quote Originally Posted by MrShorty View Post
    While waiting, a few questions for you:

    I understand that you may not be able to make changes to the format or arrangement of the data as it comes in to Excel. However, are you allowed to make a copy of the data in another part of the spreadsheet that would be arranged/formatted more conducively to a line chart? I see many situations where the OP says not to touch the imported data, but my solution is to use lookups/filters/pivots/etc. to make a rearranged copy of the data.
    Yes, we usually can make new sheets or copies of the data. That would be the preferred solution instead of doing battle with excel.

    As an aside, typically our managers/coworkers may gripe about making copies for various reasons that I completely don't agree with. For example, they often want the data linked all the way back to its source, but that just creates more problems 10 times out of 10. I can't tell you how many sheets of ours crash because there's links upon links upon links. Other times, entire workbooks have been wiped out because someone opens a linked workbook without opening the source workbooks first. Frankly, the flexibility that being able to manipulate the data gives us far outweighs the nonsense and BS that comes up trying to force the data as entered into a chart.

+ 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. XY Scatter Plot with 1st of month on X axis
    By teylyn in forum Excel Charting & Pivots
    Replies: 9
    Last Post: 10-04-2016, 03:17 AM
  2. scatter plot date axis scaling problem
    By vRJPv in forum Excel Charting & Pivots
    Replies: 8
    Last Post: 05-24-2016, 02:56 PM
  3. Replies: 1
    Last Post: 04-06-2013, 06:25 AM
  4. Replies: 1
    Last Post: 02-26-2013, 05:56 PM
  5. Can't input date range as x-axis in scatter with straight lines chart using VBA
    By alapatik in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2012, 11:32 AM
  6. Displaying time and date on x axis of scatter plot
    By AJMaine in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 05-14-2009, 06:35 AM
  7. Creating XY Scatter plot with date-scale X-axis?
    By anon4you in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-12-2005, 03:19 PM

Tags for this Thread

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