+ Reply to Thread
Results 1 to 11 of 11

Changing chart axis labels

  1. #1
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Changing chart axis labels

    Hi, I have attached the following file containing a chart which is a peak chart, based on the data in the first to columns

    In the bottom axis (m/z) i want the lavels to go up in 20 starting from 40, 60, 80 upto 360. I have tried selecting the chart data horizonal (catagory) access labels and in putting in the lables manually but it just groups them up at the start.

    I'd appreciate anyones help.

    peak chart.xlsx

    John

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Changing chart axis labels

    I suspect you are requiring a scatter chart for this (mass spec?) data rather than a bar chart. Right click and select chart type.
    Martin

  3. #3
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Changing chart axis labels

    Hi, its not for the chromatagram which is the what the scatter chart will create, it is for the spectra (peak profile), which you need line charts to create.

  4. #4
    Forum Contributor
    Join Date
    11-07-2012
    Location
    .
    MS-Off Ver
    2003 - 2013 for Windows
    Posts
    121

    Re: Changing chart axis labels

    Hello

    with a column chart like this, the X axis is a category axis, which means that its values are treated as text, even if they are numbers. You can format the X axis to show only every 20th label, but since the data is not that regular, that won't help.

    But you can create the desired labels in a separate column and apply them to the chart. Open the chart's Select Data dialog and in the right hand pane click the Edit button to edit the source for the X axis (Category) labels. Select the manually created column and hit OK.

    See attached.
    Attached Files Attached Files
    regards, LMP

  5. #5
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Changing chart axis labels

    You could try the scatter chart approach by inserting extra points on the X axis before and after each of the real data points.

    e.g.

    m/z Absolute Intensity
    40 0
    40 7495
    40 0
    41.05 0
    41.05 317943
    41.05 0
    42.05 0
    42.05 17088
    42.05 0
    43.05 0
    43.05 202497
    43.05 0


    The macro below will do the inserts if you have the m/z header in A1. You may need to make the lines on the chart very thin to be able to see the detail.

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.

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

    Re: Changing chart axis labels

    What if you use xy-scatter with error bars?
    Attached Files Attached Files
    Cheers
    Andy
    www.andypope.info

  7. #7
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Changing chart axis labels

    Hi Andy - you solution seems to be the one that's going to give the best effect - I've messed around with all of them.

    I just can seem to format my existing chart to get it to look like yours - I've tried matching all of the properties, but keep coming up with a chromatogram - what am I doing wrong?

    I have Excel 2010 fyi.

    Cheers
    John

  8. #8
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Changing chart axis labels

    Please see attached for an example with the extra 0 values.
    Attached Files Attached Files

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

    Re: Changing chart axis labels

    Change chart to xy-scatter
    Select series and add Error bars.
    Delete X error bars
    Format Y error bars to Minus 100% no cap.
    Format X axis, Min=40,Major=20

  10. #10
    Forum Contributor
    Join Date
    08-14-2012
    Location
    Derby, England
    MS-Off Ver
    Excel 2010
    Posts
    257

    Re: Changing chart axis labels

    Hi Andy, Ive managed to add the error bars, but when I click the series after adding the error bars it deletes the whole lot and gives me a line of best fit.

    Can you assist?

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

    Re: Changing chart axis labels

    I guess you have not selected the error bars when you delete.

    Use the Element selection dropdown on the Format tab to select X Error bars, then delete

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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