plotnine.positions.position.position
position()
Base class for all positions
Methods
Name | Description |
---|---|
collide | Calculate boundaries of geometry object |
collide2 | Calculate boundaries of geometry object |
compute_layer | Compute position for the layer in all panels |
compute_panel | Positions must override this function |
from_geom | Create and return a position object for the geom |
setup_data | Verify & return data |
setup_params | Verify, modify & return a copy of the params. |
strategy | Calculate boundaries of geometry object |
transform_position | Transform all the variables that map onto the x and y scales. |
collide
collide(data, params)
Calculate boundaries of geometry object
Uses Strategy
collide2
collide2(data, params)
Calculate boundaries of geometry object
Uses Strategy
compute_layer
compute_layer(data, params, layout)
Compute position for the layer in all panels
Positions can override this function instead of compute_panel
if the position computations are independent of the panel. i.e when not colliding
compute_panel
compute_panel(data, scales, params)
Positions must override this function
Notes
Make necessary adjustments to the columns in the dataframe.
Create the position transformation functions and use self.transform_position() do the rest.
See Also
compute_panel
from_geom
from_geom(geom)
Create and return a position object for the geom
Parameters
geom : geom
-
An instantiated geom object.
Returns
out : position
-
A position object
Raises
PlotnineError
-
If unable to create a
position
.
setup_data
setup_data(data, params)
Verify & return data
setup_params
setup_params(data)
Verify, modify & return a copy of the params.
strategy
strategy(data, params)
Calculate boundaries of geometry object
transform_position
=None, trans_y=None) transform_position(data, trans_x
Transform all the variables that map onto the x and y scales.