discrimintools.set_axis#
- discrimintools.set_axis(p, x_lim=None, y_lim=None, x_label=None, y_label=None, title=None, add_hline=True, add_vline=True, add_grid=True, ggtheme=None)[source]#
-
Set axis to plotnine graph
- Parameters:
-
p (class) – An object of class ggplot.
x_lim (None, list or tuple, default = None) – The range of the plotted
xvaluesy_lim (None, list or tuple, default = None) – The range of the plotted
yvaluesx_label (None or str, default = None) – The label text of
x.y_label (None or str, default = None) – The label text of
y.title (None or str, default = None) – The title of the graph you draw.
add_hline (bool, default = True) – To add a horizontal line.
add_vline (bool, default = True) – To add a vertical line.
add_grid (bool, default = True) – To add grid customization.
ggtheme (function, default = None) – Plotnine theme name.
- Returns:
-
p – A object of class ggplot.
- Return type:
-
class
Examples
>>> from plotnine import ggplot >>> from discrimintools import set_axis >>> p = set_axis(ggplot())
Fig. 24 Set axis ggplot#