nested_grid_plotter.add_twin_axis_as_datetime#

nested_grid_plotter.add_twin_axis_as_datetime(ax: _AxesBase, initial_datetime: datetime, step: relativedelta, format: str = '%d-%m-%Y', rotation_degrees: float = 15.0, spine_outward_position: float = 48.0, position: Literal['top', 'bottom', 'left', 'right'] = 'bottom', is_hide_opposed_tick_labels: bool = True) _AxesBase[source]#

Add dates to an already existing axis.

Added in version 1.2.

The dates are creating from a first day axis (numbered from x to n), taking the time series first date as the starting date.

Parameters:
  • ax (Axes) – The axis for which to add a twin xaxis.

  • initial_datetime (datetime) – Date associated with the first data point.

  • step (relativedelta) – Unit of time between two data points. The default is “days”.

  • format (str, optional) – Time format for display. The default is “%d-%m-%Y”.

  • rotation_degrees (float, optional) – Rotation angle in degrees to apply to ticks labels (in degrees, counterclockwise). The default is 15.0.

  • spine_outward_position (float, optional) – The spine is placed out from the data area by the specified number of points (Negative values place the spine inwards). The default is 48.0.

  • position (Literal["top", "bottom", "left", "right"]) – Position of the new axis.

Returns:

The created date xaxis.

Return type:

Axes