cachai.chplot.polartext

cachai.chplot.polartext(radius, angle, text, center=(0, 0), pad=0.0, **kwargs)[source]

Place text at specified polar coordinates relative to a center point.

Parameters
radiusfloat

Radius coordinate from the center.

thetafloat

Angle in degrees (0° at positive x-axis, increasing counterclockwise).

textstr

Text to diplay.

centertuple, optional

Center coordinates (x,y) (default: (0,0)).

padfloat, optional

Padding value (positive for outward displacement, negative for inward).

Returns
PolarText[source]

An instance of Polar Text (base: matplotlib.text.Text)

Other Parameters
**kwargs

Keyword arguments of matplotlib.text.Text.

Examples

import matplotlib.pyplot as plt
import cachai.chplot as chp

fig, ax = plt.subplots()
ax.plot([0,0],[1,1])
chp.polartext((0,0),1,45,text='Im polar!',pad=0.5,ha='center',va='center')
plt.show()

To see more examples check out the examples section.

Methods

PolarText.set_polar_position(radius=None, angle=None, center=None)[source]

Updates multiple polar coordinates simultaneously.

Parameters
radiusfloat

New radial distance from center.

anglefloat

New angular position in degrees.

centertuple or array-like

New center coordinates for the polar system.

PolarText.set_pad(pad)[source]

Adjusts the radial padding distance between the text and its base polar position.

Parameters
padfloat

New padding value.

PolarText.set_radius(radius)[source]

Updates the radial coordinate of the text relative to the center point.

Parameters
radiusfloat

New radius coordinate.

PolarText.set_angle(angle)[source]

Changes the angular position of the text around the center.

Parameters
anglefloat

New angle coordinate in degrees.

PolarText.set_center(center)[source]

Moves the entire polar coordinate system to a new center point.

Parameters
centertuple or array-like

New center coordinates (x,y).

Other Methods

Inherited from matplotlib.text.Text.