T O P I C R E V I E W |
SamuelsGrp |
Posted - 09/30/2003 : 2:13:27 PM Hello,
In a line plot, I need to plot a single line in different colors. For example, if X axis is from 1-1000, I want a plot such that line between 300-500 is red and the rest of it is green. Can anyone suggest a technique how to accomplish this ?
Thanks in advance. |
3 L A T E S T R E P L I E S (Newest First) |
SamuelsGrp |
Posted - 10/16/2003 : 11:31:53 AM Thanks a lot Greg. Your technique works like a charm. |
greg |
Posted - 10/15/2003 : 10:28:21 AM The more general solution suggested by Hideo can be accomplished with this script:
// BEGIN SCRIPT wks.col=3; wks.insert(EndX EndY); wks.col3.type=4; wo -s 1 0 2 0; DoMenu 57634; wo -s; wo -s 3 0 4 0; DoMenu 57637; get wcol(1) -e end; wo -s; wo -s 3 1 4 1; DoMenu 36442; wo -s; wo -s 0 end 0 end; DoMenu 36442; wo -s; wo -s 1 0 4 0; wo -p 218 ColoredLineSegments; // END SCRIPT
which assumes your worksheet with columns A(X), B(Y) and C(Y) is active and that you have saved a Template named ColoredLineSegments. In your particular case, that C column should contain 2 where X is 300 to 500 and 3 elsewhere. This script does just that:
// BEGIN SCRIPT col(C)=((col(A)<300)||(col(A)>500))?3:2; // END SCRIPT
TO MAKE THE ColoredLineSegments TEMPLATE: Setup a worksheet as A(X) B(Y) C(X) D(Y) E(Y) Fill a few rows of A(X) with row numbers Fill a few rows of C(X) with row numbers plus 1 Fill a few rows of B(Y) and D(Y) with any values Fill a few rows of E(Y) with integers from 1 to 24 Select columns A(X) to D(Y) and plot as a Vector XYXY plot Double-click on the plot to open Plot Details Set the Arrowhead Length to 0 Click the Color button and choose Indexing : Col(E) Click OK out of Plot Details and File : Save Template As and enter ColoredLineSegments as the template name.
|
Hideo Fujii |
Posted - 09/30/2003 : 5:19:17 PM How about using (XYXY-)Vector Plot? You need to create 3 columns. Second column copied from the first shifted one cell down, and you can set color# in the third column. Then, you can make a vector plot, with color indexed by the third column, and the size=0 for the arrow head.
|