+ Reply to Thread
Results 1 to 2 of 2

How can I plot the correct line graph from my data?

  1. #1
    Registered User
    Join Date
    05-22-2020
    Location
    New Hampshire
    MS-Off Ver
    Office 2019
    Posts
    1

    How can I plot the correct line graph from my data?

    I have spreadsheet where each row defines a straight line in 2D. There are 4 values per row: the start X1,Y1 and end X2,Y2 of the line
    How can I put these lines into a line plot, preferably with each line a different color?
    Attached Files Attached Files

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

    Re: How can I plot the correct line graph from my data?

    Are you required to use this data layout, or do you have the flexibility to copy/move these data around? Are you required to use a line chart, or can you use an XY scatter chart?

    I would use a scatter chart rather than a line chart for this.

    Excel's charts expect to see the X values for a data series together and the Y values for a series together. It would be tedious with as many lines as you have, but I would first try:
    1) Switch the Y1 and X2 columns so X2 is in column B and Y1 is in column C.
    2) Select an empty cell somewhere and insert a (hopefully blank) scatter chart (lines with or without markers, as you prefer). If Excel populates the source data range, then go into the Select Data dialog and delete the source data range and/or all of the data series that Excel chose to include.
    3) While still in the Select Data dialog, add a new data series and
    3a) fill out the name field with the value or reference you want.
    3b) Select A2:B2 for the Xvalues field
    3c) Select C2:D2 for the Yvalues field.
    4) Repeat step 3 for every data series (A3:B3,C3:D3 etc.).

    You should have a nice scatter chart with lines connecting each pair of points that you have defined.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. [SOLVED] Can't plot the line graph based on the data in the table
    By Vitalite in forum Excel Charting & Pivots
    Replies: 7
    Last Post: 06-23-2017, 02:34 PM
  2. Making one line graph with two different time interval data from 2 plot
    By sohel_for in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 01-30-2016, 11:10 PM
  3. VBA code to plot the line graph for each row data in a worksheet
    By krkarthik in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2015, 12:14 AM
  4. line graph not plotting correct data
    By AWITCHER in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 04-16-2015, 10:33 AM
  5. Macros to plot data in a line graph
    By taimysho0 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 05:27 PM
  6. [SOLVED] How do you plot real time data into a line graph?
    By jonathan@ibbotsons in forum Excel Charting & Pivots
    Replies: 5
    Last Post: 10-30-2013, 09:49 AM
  7. [SOLVED] How do I plot both line and column data on same graph?
    By Jackie in forum Excel Charting & Pivots
    Replies: 1
    Last Post: 05-03-2005, 01:06 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