point
Point plots show the point estimates of the central tendency (mean) of numerical columns with error bars.
Usage
gurita point [-h] [-x COLUMN] [-y COLUMN] ... other arguments ...
Arguments
Argument |
Description |
Reference |
---|---|---|
|
display help |
|
|
select column for the X axis |
|
|
select column for the Y axis |
|
|
Orientation of plot. Allowed values: v = vertical, h = horizontal. Default: v. |
|
|
controlling the order of the plotted points |
|
|
group columns by hue |
|
|
order of hue columns |
|
|
log scale X axis |
|
|
log scale Y axis |
|
|
range limit X axis |
|
|
range limit Y axis |
|
|
column to use for facet rows |
|
|
column to use for facet columns |
|
|
wrap the facet column at this width, to span multiple rows |
See also
Similar functionality to point plots are provided by:
Point plots are based on Seaborn’s catplot library function, using the kind="point"
option.
Simple example
Point plot showing the mean age
for passengers on the titanic by passenger class
:
gurita point -y age -x class < titanic.csv
The output of the above command is written to point.class.age.png
:
Getting help
The full set of command line arguments for point plots can be obtained with the -h
or --help
arguments:
gurita point -h
Selecting columns to plot
-x COLUMN, --xaxis COLUMN
-y COLUMN, --yaxis COLUMN
Point plots can be plotted for numerical columns and optionally grouped by categorical columns.
If no categorical column is specified, a single column point plot will be generated showing the distribution of the numerical column.
Note
By default the orientation of the point plot is vertical. In this scenario
the numerical column is specified by -y
, and the (optional) categorical column is specified
by -x
.
However, the orientation of the point plot can be made horizontal using the --orient h
argument.
In this case the sense of the X and Y axes are swapped from the default, and thus
the numerical column is specified by -x
, and the (optional) categorical column is specified
by -y
.
In the following example the distribution of age
is shown for each value in the class
column,
where the boxes are plotted horizontally:
gurita point -x age -y class --orient h < titanic.csv
Controlling the order of the plotted points
--order VALUE [VALUE ...]
By default the order of the categorical columns displayed in the point plot is determined from their occurrence in the input data.
This can be overridden with the --order
argument, which allows you to specify the exact ordering of columns based on their values.
In the following example the point columns of the class
column are displayed in the order of First
, Second
, Third
:
gurita point -y age -x class --order First Second Third < titanic.csv
Grouping columns with hue
--hue COLUMN
The data can be further grouped by an additional categorical column with the --hue
argument.
In the following example the distribution of age
is shown for each value in the class
column, and further sub-divided by the sex
column:
gurita point -y age -x class --hue sex < titanic.csv
By default the order of the columns within each hue group is determined from their occurrence in the input data.
This can be overridden with the --hueorder
argument, which allows you to specify the exact ordering of columns within each hue group, based on their values.
In the following example the sex
values are displayed in the order of female
, male
:
gurita point -y age -x class --hue sex --hueorder female male < titanic.csv
It is also possible to use both --order
and --hueorder
in the same command. For example, the following command controls
the order of both the class
and sex
categorical columns:
gurita point -y age -x class --order First Second Third --hue sex --hueorder female male < titanic.csv
Log scale
--logx
--logy
The distribution of numerical values can be displayed in log (base 10) scale with --logx
and --logy
.
It only makes sense to log-scale the numerical axis (and not the categorical axis). Therefore, --logx
should be used when numerical columns are selected with -x
, and
conversely, --logy
should be used when numerical columns are selected with -y
.
For example, you can display a log scale point plot for the age
column grouped by class
(when the distribution of age
is displayed on the Y axis) like so. Note carefully that the numerical data is displayed on the Y-axis (-y
), therefore the --logy
argument should be used to log-scale the numerical distribution:
gurita point -y age -x class --logy < titanic.csv
Axis range limits
--xlim LOW HIGH
--ylim LOW HIGH
The range of displayed numerical distributions can be restricted with --xlim
and --ylim
. Each of these flags takes two numerical values as arguments that represent the lower and upper bounds of the range to be displayed.
It only makes sense to range-limit the numerical axis (and not the categorical axis). Therefore, --xlim
should be used when numerical columns are selected with -x
, and
conversely, --ylim
should be used when numerical columns are selected with -y
.
For example, you can display range-limited range for the age
column grouped by class
(when the distribution of age
is displayed on the Y axis) like so.
Note carefully that the numerical
data is displayed on the Y-axis (-y
), therefore the --ylim
argument should be used to range-limit the distribution:
gurita point -y age -x class --ylim 10 30 < titanic.csv
Facets
--frow COLUMN
--fcol COLUMN
--fcolwrap INT
Point plots can be further divided into facets, generating a matrix of point plots, where a numerical value is further categorised by up to 2 more categorical columns.
See the facet documentation for more information on this feature.
gurita point -y age -x class --fcol sex < titanic.csv