+ Reply to Thread
Results 1 to 7 of 7

Changing X axis scale outwards from middle of graph via line

  1. #1
    Registered User
    Join Date
    07-22-2014
    Location
    Calgary, Canada
    MS-Off Ver
    2007
    Posts
    3

    Changing X axis scale outwards from middle of graph via line

    I have a set of 24 hour data for the x-axis, and then corresponding data values. Within the 24 hours, an event starts, and I've manually set it that time point has become time "0:00", and then all the time before is now "-" relative, and time above is "+" relative, at a frequency of 2 seconds. Ex.
    Column A Column B Column C
    23:48:11 -0:10 19.924545
    23:48:13 -0:08 19.924545
    23:48:15 -0:06 19.924545
    23:48:17 -0:04 19.866797
    23:48:19 -0:02 19.837347
    23:48:21 0:00 19.837347
    23:48:23 0:02 19.793749
    23:48:25 0:04 19.736093
    23:48:27 0:06 19.692526
    23:48:29 0:08 19.750151
    The equation I used was: After event (to get points 0 and above): (B1-$A$1+(B1<$A$1)) Before event: TEXT(ABS(B1-$A$1),"-[m]:ss") Where B1 = value you're subtracting, A1 = event start
    A line graph works, and displays the x axis as shown in the middle column, but when I try to do a XY plot, it shows the same trend, but not the correct x-axis values (i.e. shows 1000, 2000, 3000, etc.). I also tried using value() on the values before since I had to use text, but that also doesn't work since it just turns everything to 0, so a line plot seems to be the only for me to display the x-axis as shown in the column.

    Is there a way to change the x-axis scale so that it shows the time every 5 mins but going OUTWARDS from 0 instead of from the very left.

    i.e. z6Pqswb.png


    So I want the x-axis to make increments outwards from the zero point at nicer time intervals (ex. every 5 mins, instead of every 3min 51s)

    If the only way is to convert the chart type to a XY plot, how can I do this while keeping the x-axis still displaying ex. -0:02, 0:00, 0:02, etc. instead of 1000, 2000, etc.
    Thanks

  2. #2
    Forum Expert cbatrody's Avatar
    Join Date
    04-15-2014
    Location
    Dubai
    MS-Off Ver
    Microsoft Office 365 ProPlus
    Posts
    2,136

    Re: Changing X axis scale outwards from middle of graph via line

    Hi,

    Did you try setting the X-Axis Major Unit to 5 minutes i.e (0.003472)?

  3. #3
    Registered User
    Join Date
    07-22-2014
    Location
    Calgary, Canada
    MS-Off Ver
    2007
    Posts
    3

    Re: Changing X axis scale outwards from middle of graph via line

    Hi,
    I did, but it starts from the very first number instead of in the middle going outwards, so it doesn't show 0:00, but whatever is next (ex. 0:10). It also only works with XY scatter plots, which I can't seem to be able to successfully convert over.

    Quote Originally Posted by cbatrody View Post
    Hi,

    Did you try setting the X-Axis Major Unit to 5 minutes i.e (0.003472)?

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

    Re: Changing X axis scale outwards from middle of graph via line

    The challenge you have -- especially when it comes to create a scatter chart -- is that Excel's default calendar cannot display negative time. This is why you have to create a TEXT() string in the spreadsheet for the negative times, and why you cannot use the same data on a scatter plot.

    One possible solution is to use the optional 1904 date system (under Excel options). Under the 1904 system, Excel can handle negative times, and you should find, for this specific problem, that you don't need special formulas or other considerations to handle the negative times. The main caution in using the 1904 system is that it can create other problems. As a global setting, it will change the calendaring in all of your spreadsheets. So, in fixing this problem, you might create other, unintended problems in other spreadsheets that depend on the 1901 date system. If this spreadsheet needs to be shared, then the other users need to understand that this spreadsheet uses the 1904 system and be prepared to handle the consequences of that switch in their spreadsheets. Used with appropriate understanding and discretion, this might be a good approach.

    Other solutions that come to mind depend on how important it is to you to have the values display as time (m:ss). If you can allow it, delete the time format so the values are the underlying date/time serial number (as a fraction of a day). If you can work directly with the serial number, then you can work with negative values and get your scatter plot to do what you want. Or convert all of your numbers to decimal minutes and completely abandon Excel's built in default calendar (which means abandoning the mm:ss display format).

    As I see it, one way or another you need to get away from using the default 1901 date system to get what you want. I'm not sure what will be the best approach for you.
    Last edited by MrShorty; 07-23-2014 at 11:26 AM.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  5. #5
    Registered User
    Join Date
    07-22-2014
    Location
    Calgary, Canada
    MS-Off Ver
    2007
    Posts
    3

    Re: Changing X axis scale outwards from middle of graph via line

    Hi, thanks for replying.
    I've tried using the 1904 system, and it seems to work, but for some reason I can't get it to plot the negative times. The times show up properly as negative values in the cell, but the negative time values won't show on the x-axis. It remains blank, while everything above 0 would show, so half the x-axis is empty. Do you know how I would be able to get the negative values to show on the plot?

    Thanks

    Quote Originally Posted by MrShorty View Post
    The challenge you have -- especially when it comes to create a scatter chart -- is that Excel's default calendar cannot display negative time. This is why you have to create a TEXT() string in the spreadsheet for the negative times, and why you cannot use the same data on a scatter plot.

    One possible solution is to use the optional 1904 date system (under Excel options). Under the 1904 system, Excel can handle negative times, and you should find, for this specific problem, that you don't need special formulas or other considerations to handle the negative times. The main caution in using the 1904 system is that it can create other problems. As a global setting, it will change the calendaring in all of your spreadsheets. So, in fixing this problem, you might create other, unintended problems in other spreadsheets that depend on the 1901 date system. If this spreadsheet needs to be shared, then the other users need to understand that this spreadsheet uses the 1904 system and be prepared to handle the consequences of that switch in their spreadsheets. Used with appropriate understanding and discretion, this might be a good approach.

    Other solutions that come to mind depend on how important it is to you to have the values display as time (m:ss). If you can allow it, delete the time format so the values are the underlying date/time serial number (as a fraction of a day). If you can work directly with the serial number, then you can work with negative values and get your scatter plot to do what you want. Or convert all of your numbers to decimal minutes and completely abandon Excel's built in default calendar (which means abandoning the mm:ss display format).

    As I see it, one way or another you need to get away from using the default 1901 date system to get what you want. I'm not sure what will be the best approach for you.
    Last edited by FHstudent; 07-23-2014 at 11:51 AM.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Changing X axis scale outwards from middle of graph via line

    In order to get 0 at the axis you will need a Min value and Major Unit that are divisible.
    Cheers
    Andy
    www.andypope.info

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

    Re: Changing X axis scale outwards from middle of graph via line

    Unfortunately, I don't really know what to suggest. I rarely work with Excel's date/time system -- preferring to simply enter times as decimal minutes or decimal seconds and treat them accordingly.

    Out of curiosity, I tried this in Excel XP/2002. It seemed to work just fine in 2002, but would not display the axis correctly in 2007. Is this functionality that was lost in the "upgrade" to 2007? Perhaps one solution to this variation of the problem is to downgrade to an earlier version of Excel.

+ 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. x axis labels/scale move to middle of chart w/neg & pos line cht
    By rak in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  2. [SOLVED] x axis labels/scale move to middle of chart w/neg & pos line cht
    By rak in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  3. [SOLVED] x axis labels/scale move to middle of chart w/neg & pos line cht
    By rak in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 PM
  4. [SOLVED] x axis labels/scale move to middle of chart w/neg & pos line cht
    By bj in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-06-2005, 05:05 AM
  5. [SOLVED] x axis labels/scale move to middle of chart w/neg & pos line cht
    By rak in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 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