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?
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?
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.
Originally Posted by shg
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks