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
- radius
float Radius coordinate from the center.
- theta
float Angle in degrees (0° at positive x-axis, increasing counterclockwise).
- text
str Text to diplay.
- center
tuple, optional Center coordinates (x,y) (default: (0,0)).
- pad
float, optional Padding value (positive for outward displacement, negative for inward).
- radius
- Returns
PolarText[source]An instance of Polar Text (base:
matplotlib.text.Text)
- Other Parameters
**kwargsKeyword 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
- radius
float New radial distance from center.
- angle
float New angular position in degrees.
- center
tupleorarray-like New center coordinates for the polar system.
- radius
- PolarText.set_pad(pad)[source]
Adjusts the radial padding distance between the text and its base polar position.
- Parameters
- pad
float New padding value.
- pad
- PolarText.set_radius(radius)[source]
Updates the radial coordinate of the text relative to the center point.
- Parameters
- radius
float New radius coordinate.
- radius
- PolarText.set_angle(angle)[source]
Changes the angular position of the text around the center.
- Parameters
- angle
float New angle coordinate in degrees.
- angle
- PolarText.set_center(center)[source]
Moves the entire polar coordinate system to a new center point.
- Parameters
- center
tupleorarray-like New center coordinates (x,y).
- center
- Other Methods
Inherited from
matplotlib.text.Text.