| Search Locate Previous Next | Contents |
Scatter plots can take a matrix of values, with the X-variable in column-1 and as many Y-variables as required in columns 2-n. It may be more convenient to specify the y-data as a simple vector and split it automatically with a category variable:
chSet 'xvar' farm chSet 'cvar' year chScatter yield
This style is likely to be particularly useful if the data has come from a database table, where it can be quite tedious to separate the values on the basis of one or more category columns (say Sales in tonnes by region). If the category variable is text, it is sorted alphabetically and the unique values are used as the keys. This is also a convenient way to generate a grouped barchart or multiple piechart.
There are two simple cover functions vs and by in the RainPro workspace to allow expressions like:
chScatter yield vs variety by year
You can experiment with the infamous barley data here!
See also ...
chBoxplot box and whisker charts
CategoriseInto categorisation buckets
Tease separation of scatter plots
Versus scatter versus this