Auto plot labelling
- I often am asked to chart CSV files in the form
I can use a #proc processdata to rotate the file into the form that
ploticus likes, but I would like to be able to take the label name for
the line/bar/etc. from the 1st entry in the line (or colum when rotated)
also the month entry should be used as the label for the X axis
is this possible/feasible ?
Principal Systems Engineer
Siemens Metering Ltd
mobile 00 44 780884 5979
One way to do this is demonstrated by the script below.
It uses categories to do the months, which works if you won't have any
months missing from your data. If you could have missing months, you
would need to use date scaling in X, which would require a year component
in your month field.
The curve labels are retrieved from the data set using the $dataitem
It's a bit convoluted, and there are several new features in the works
that will allow more flexibility with situations like this, but the
following example should work for now:
// read in the .csv data..
// get the labels..
#set LBL1 = $dataitem( 1, 2 )
#set LBL2 = $dataitem( 1, 3 )
// now remove the first row of data so that we can use field#1 as categories
select: @@1 != month
// set up plotting area..
yrange: 1 10
// do red line..
// do blue line..
// do legend..
On 28 Jan 2002, kevin mulholland wrote:
> I often am asked to chart CSV files in the form
> I can use a #proc processdata to rotate the file into the form that
> ploticus likes, but I would like to be able to take the label name for
> the line/bar/etc. from the 1st entry in the line (or colum when rotated)
> also the month entry should be used as the label for the X axis
> is this possible/feasible ?
> many thanks
> Kevin Mulholland
> Principal Systems Engineer
> Siemens Metering Ltd
> mobile 00 44 780884 5979
> To unsubscribe from this group, send an email to:
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
Stephen C. Grubb scg@...
Scientific Software Engineer, The Jackson Laboratory
600 Main Street Bar Harbor, Maine 04609 USA