Code Reference
starplot.PlotStyle
Defines all the styling properties for a plot
base
class-attribute
instance-attribute
base: PlotBaseStyle = PlotBaseStyle(font_name='Inter', text_stroke_width=4)
Default base styles for undefined style properties. This is a way to apply some styles to everything in the plot, unless a style explicitly sets one of these values.
axes
class-attribute
instance-attribute
Styling for the axes of the plot, which is where the map is plotted.
figure
class-attribute
instance-attribute
figure: FigureStyle = FigureStyle()
Styling for the figure of the plot, which is the surrounding region outside the axes.
This area can include: title, legend (if plotted 'outside'), and padding between the axes (map region) and edge of image.
title
class-attribute
instance-attribute
title: TitleStyle = TitleStyle(
font_size=85,
font_weight=FontWeight.BOLD,
stroke_width=0,
zorder=ZOrder.LAYER_5,
anchor_point=AnchorPoint.BOTTOM_CENTER,
padding_bottom=24,
)
Styling for the title of the plot
table
class-attribute
instance-attribute
table: TableStyle = TableStyle(
header=LabelStyle(
font_size=32,
zorder=ZOrder.LAYER_5,
stroke_width=0,
font_weight=FontWeight.BOLD,
anchor_point=AnchorPoint.BOTTOM_CENTER,
),
cell=LabelStyle(
font_size=32,
stroke_width=0,
zorder=ZOrder.LAYER_5,
anchor_point=AnchorPoint.BOTTOM_CENTER,
),
padding_top=24,
)
Styling for the data table of the plot, which is always plotted below the axes. Currently, this is only available in optic plots.
star
class-attribute
instance-attribute
star: ObjectStyle = ObjectStyle(
marker=MarkerStyle(zorder=ZOrder.LAYER_3 + 1, size=20, stroke=None),
label=LabelStyle(
font_size=40,
font_weight=FontWeight.BOLD,
zorder=ZOrder.LAYER_3 + 2,
offset_x="auto",
offset_y="auto",
),
)
Styling for stars
bayer_labels
class-attribute
instance-attribute
bayer_labels: LabelStyle = LabelStyle(
font_size=36,
font_weight=FontWeight.LIGHT,
font_name="GFS Didot",
zorder=ZOrder.LAYER_4,
anchor_point=AnchorPoint.TOP_LEFT,
offset_x="auto",
offset_y="auto",
)
Styling for Bayer labels of stars
flamsteed_labels
class-attribute
instance-attribute
flamsteed_labels: LabelStyle = LabelStyle(
font_size=26,
font_weight=FontWeight.LIGHT,
zorder=ZOrder.LAYER_4,
anchor_point=AnchorPoint.BOTTOM_LEFT,
offset_x="auto",
offset_y="auto",
)
Styling for Flamsteed number labels of stars
planets
class-attribute
instance-attribute
planets: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="circle", size=28, zorder=ZOrder.LAYER_3, opacity=1
),
label=LabelStyle(
font_size=32,
font_weight=FontWeight.BOLD,
offset_x="auto",
offset_y="auto",
),
)
Styling for planets
moon
class-attribute
instance-attribute
moon: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="circle",
size=50,
fill="#c8c8c8",
opacity=1,
zorder=ZOrder.LAYER_4,
),
label=LabelStyle(
font_size=32,
font_weight=FontWeight.BOLD,
offset_x="auto",
offset_y="auto",
),
)
Styling for the moon
sun
class-attribute
instance-attribute
sun: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="star_8", size=80, fill="#000", zorder=ZOrder.LAYER_4 - 100
),
label=LabelStyle(font_size=32, font_weight=FontWeight.BOLD),
)
Styling for the Sun
dso_open_cluster
class-attribute
instance-attribute
dso_open_cluster: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="circle",
dash_array=DashArray.DOTTED,
dash_capstyle=CapStyle.ROUND,
stroke_width=2,
zorder=ZOrder.LAYER_3 - 1,
),
label=LabelStyle(offset_x="auto", offset_y="auto"),
)
Styling for open star clusters
dso_association_stars
class-attribute
instance-attribute
dso_association_stars: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="circle",
dash_array=DashArray.DOTTED,
dash_capstyle=CapStyle.ROUND,
stroke_width=2,
zorder=ZOrder.LAYER_3 - 1,
),
label=LabelStyle(offset_x="auto", offset_y="auto"),
)
Styling for associations of stars
dso_globular_cluster
class-attribute
instance-attribute
dso_globular_cluster: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="circle_cross",
fill="#555",
opacity=0.8,
stroke_width=1.2,
zorder=ZOrder.LAYER_3 - 1,
),
label=LabelStyle(offset_x="auto", offset_y="auto"),
)
Styling for globular star clusters
dso_galaxy
class-attribute
instance-attribute
dso_galaxy: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="ellipse", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(offset_x="auto", offset_y="auto"),
)
Styling for galaxies
dso_nebula
class-attribute
instance-attribute
dso_nebula: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(offset_x="auto", offset_y="auto"),
)
Styling for nebulas
dso_planetary_nebula
class-attribute
instance-attribute
dso_planetary_nebula: ObjectStyle = ObjectStyle(
marker=MarkerStyle(
symbol="circle_crosshair",
stroke_width=1.6,
size=26,
zorder=ZOrder.LAYER_3 - 1,
),
label=LabelStyle(offset_x="auto", offset_y="auto"),
)
Styling for planetary nebulas
dso_double_star
class-attribute
instance-attribute
dso_double_star: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="circle_line", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(offset_x=1, offset_y=-1),
)
Styling for double stars
dso_dark_nebula
class-attribute
instance-attribute
dso_dark_nebula: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", fill="#000", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(),
)
Styling for dark nebulas
dso_supernova_remnant
class-attribute
instance-attribute
dso_supernova_remnant: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", fill="#000", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(),
)
Styling for supernova remnants
dso_nova_star
class-attribute
instance-attribute
dso_nova_star: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", fill="#000", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(),
)
Styling for nova stars
dso_nonexistant
class-attribute
instance-attribute
dso_nonexistant: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", fill="#000", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(),
)
Styling for 'nonexistent' (as designated by OpenNGC) deep sky objects
dso_unknown
class-attribute
instance-attribute
dso_unknown: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", fill="#000", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(),
)
Styling for 'unknown' (as designated by OpenNGC) types of deep sky objects
dso_duplicate
class-attribute
instance-attribute
dso_duplicate: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="square", fill="#000", zorder=ZOrder.LAYER_3 - 1),
label=LabelStyle(),
)
Styling for 'duplicate record' (as designated by OpenNGC) types of deep sky objects
constellation_lines
class-attribute
instance-attribute
Styling for constellation lines
constellation_borders
class-attribute
instance-attribute
constellation_borders: LineStyle = LineStyle(
stroke="#000",
width=2.5,
dash_array=(3, 6),
opacity=0.5,
zorder=ZOrder.LAYER_3,
)
Styling for constellation borders
constellation_labels
class-attribute
instance-attribute
constellation_labels: LabelStyle = LabelStyle(
font_size=40,
zorder=ZOrder.LAYER_3,
anchor_point=AnchorPoint.CENTER,
stroke_width=0,
)
Styling for constellation labels
milky_way
class-attribute
instance-attribute
milky_way: PolygonStyle = PolygonStyle(
fill="#d9d9d9", opacity=0.36, stroke_width=0, zorder=ZOrder.LAYER_1
)
Styling for the Milky Way
gridlines
class-attribute
instance-attribute
gridlines: PathStyle = PathStyle(
line=LineStyle(
stroke="#888",
width=1,
dash_array=DashArray.SOLID,
opacity=0.6,
zorder=ZOrder.LAYER_2,
),
label=LabelStyle(
font_size=32,
fill="#000",
opacity=1,
anchor_point=AnchorPoint.BOTTOM_CENTER,
stroke_width=0,
zorder=ZOrder.LAYER_5 + 1000,
),
)
Styling for gridlines and their labels
ecliptic
class-attribute
instance-attribute
ecliptic: PathStyle = PathStyle(
line=LineStyle(
stroke="#777",
width=3,
dash_array=(2, 6),
cap_style=CapStyle.ROUND,
opacity=1,
zorder=ZOrder.LAYER_3 - 1,
),
label=LabelStyle(
font_size=30,
fill="#777",
opacity=1,
stroke_width=8,
stroke="#000",
zorder=ZOrder.LAYER_3,
),
)
Styling for the Ecliptic
celestial_equator
class-attribute
instance-attribute
celestial_equator: PathStyle = PathStyle(
line=LineStyle(
stroke="#999",
width=4,
dash_array=DashArray.DASHED_DOTS,
cap_style=CapStyle.ROUND,
zorder=ZOrder.LAYER_3,
),
label=LabelStyle(
font_size=30,
fill="#999",
stroke_width=8,
stroke="#000",
zorder=ZOrder.LAYER_3,
),
)
Styling for the Celestial Equator
galactic_equator
class-attribute
instance-attribute
galactic_equator: PathStyle = PathStyle(
line=LineStyle(
stroke="#999",
width=4,
dash_array=DashArray.SOLID,
opacity=0.8,
zorder=ZOrder.LAYER_3,
),
label=LabelStyle(
font_size=30,
fill="#7c7c7c",
opacity=1,
stroke_width=8,
stroke="#000",
zorder=ZOrder.LAYER_3,
),
)
Styling for the Galactic Equator
horizon
class-attribute
instance-attribute
horizon: PathStyle = PathStyle(
line=LineStyle(
stroke="#fff",
width=135,
dash_array=DashArray.SOLID,
cap_style=CapStyle.ROUND,
opacity=1,
zorder=ZOrder.LAYER_5,
),
label=LabelStyle(
anchor_point=AnchorPoint.CENTER,
fill="#000",
font_size=98,
font_weight=FontWeight.BOLD,
stroke_width=0,
zorder=ZOrder.LAYER_5,
),
)
Styling for the horizon
ground
class-attribute
instance-attribute
ground: PolygonStyle = PolygonStyle(fill='#000', zorder=10000)
Styling for the ground (only applies to horizon plots)
zenith
class-attribute
instance-attribute
zenith: ObjectStyle = ObjectStyle(
marker=MarkerStyle(symbol="triangle", size=24, fill="#000", opacity=0.8),
label=LabelStyle(font_size=14, font_weight=FontWeight.BOLD),
)
Styling for the zenith marker
optic_fov
class-attribute
instance-attribute
optic_fov: PolygonStyle = PolygonStyle(
fill=None, stroke="red", dash_array=(2, 3), stroke_width=3, zorder=-1000
)
Styling for optic fields of view
arrow
class-attribute
instance-attribute
arrow: ArrowStyle = ArrowStyle(
fill="hsl(0, 99%, 31%)",
stroke="#ff0019",
stroke_width=2,
zorder=ZOrder.LAYER_4,
)
Styling for arrows
tissot
class-attribute
instance-attribute
tissot: PolygonStyle = PolygonStyle(fill='#2e62ae', stroke_width=0)
polygon
class-attribute
instance-attribute
polygon: PolygonStyle = PolygonStyle()
Default styling for polygons
circle
class-attribute
instance-attribute
circle: PolygonStyle = PolygonStyle()
Default styling for circles
ellipse
class-attribute
instance-attribute
ellipse: PolygonStyle = PolygonStyle()
Default styling for ellipses
rectangle
class-attribute
instance-attribute
rectangle: PolygonStyle = PolygonStyle()
Default styling for rectangles
marker
class-attribute
instance-attribute
marker: ObjectStyle = ObjectStyle()
Default styling for markers
load_from_file
staticmethod
load_from_file(filename: str) -> PlotStyle
Load a style from a YAML file. The returned style is an extension of the default PlotStyle
(see [PlotStyle.extend][starplot.styles.PlotStyle.extend]), so you only need to define
properties you want to override from the default.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Filename of style file |
required |
Returns:
| Name | Type | Description |
|---|---|---|
PlotStyle |
PlotStyle
|
A new instance of a PlotStyle |
dump_to_file
Save the style to a YAML file. ALL style properties will be written to the file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
str
|
Filename of style file |
required |
extend
extend(*args, **kwargs) -> PlotStyle
Adds one or more dicts of style overrides to the style and returns a new instance with those overrides.
Styles are added in sequential order, so if the first style arg has a property that is also in the last style arg, then the resulting style will have the value from the last style (similar to how CSS works).
Example Usage
Create an extension of the default style with the light blue color scheme, map optimizations, and change the constellation line color to red:
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
args
|
One or more dicts of styles to add |
()
|
Returns:
| Name | Type | Description |
|---|---|---|
PlotStyle |
PlotStyle
|
A new instance of a PlotStyle |
starplot.styles.PlotBaseStyle
Default base styles for all child styles that have these values set to None / null
This is a way to apply some styles to everything in the plot, unless a style specifically sets one of these values.
For example, if all object label styles have font_name = None then the base font name will be used.
font_family
class-attribute
instance-attribute
Font family (e.g. 'monospace', 'sans-serif', 'serif', etc) to use if a style's font family is set to None
font_name
class-attribute
instance-attribute
Name of the base font to use if a style's font is set to None
text_stroke
class-attribute
instance-attribute
Color of border (also known as 'halos' in map design) around text if a style's value is set to None
starplot.styles.AxesStyle
Styling for the axes of the plot, which is where the map is plotted.
background
class-attribute
instance-attribute
background: PolygonStyle = PolygonStyle(
stroke_width=0, stroke="#000", fill="#fff"
)
Background of the axes. This will always be plotted at the lowest Z-order.
border
class-attribute
instance-attribute
Border drawn immediately outside the axes clip path (the entire stroke sits
outside the clip path -- none of it overlaps the plot content). If None,
no border is drawn.
If the plot also has gridline labels, then the gridline labels are plotted just outside the axes border, in the axes "frame" region.
starplot.styles.FigureStyle
background
class-attribute
instance-attribute
background: PolygonStyle = PolygonStyle(
stroke_width=0, stroke="#000", fill="#fff"
)
Background of the figure (the area surrounding the axes)
starplot.styles.ObjectStyle
Defines the style for a sky object (e.g. star, DSO)
label
class-attribute
instance-attribute
label: LabelStyle = LabelStyle()
Style for the object's label (see LabelStyle)
marker
class-attribute
instance-attribute
marker: MarkerStyle = MarkerStyle()
Style for the object's marker (see MarkerStyle)
starplot.styles.PathStyle
Defines the style for a path (e.g. constellation lines)
label
class-attribute
instance-attribute
label: LabelStyle = LabelStyle()
Style for the path's label (see LabelStyle)
starplot.styles.LegendStyle
Defines the style for the map legend.
background
class-attribute
instance-attribute
background: PolygonStyle = PolygonStyle(
stroke_width=1.0, stroke="#c5c5c5", fill="#fff"
)
Background of the legend
border_radius
class-attribute
instance-attribute
Border radius of legend background element
label_padding
class-attribute
instance-attribute
Padding between legend labels
labels
class-attribute
instance-attribute
labels: LabelStyle = LabelStyle(font_size=36, font_weight=FontWeight.NORMAL)
Style for the legend's labels (see LabelStyle)
location
class-attribute
instance-attribute
location: Literal[
"inside_top_left",
"inside_top_right",
"inside_bottom_right",
"inside_bottom_left",
"outside_top_left",
"outside_top_right",
"outside_bottom_right",
"outside_bottom_left",
] = "inside_top_right"
Location of the legend, relative to the map area (inside or outside)
margin_x
class-attribute
instance-attribute
Horizontal margin (empty space) between legend and its anchor position.
margin_y
class-attribute
instance-attribute
Vertical margin (empty space) between legend and its anchor position.
padding_x
class-attribute
instance-attribute
Horizontal padding between the legend's border and its content.
padding_y
class-attribute
instance-attribute
Vertical padding between the legend's border and its content.
symbol_padding
class-attribute
instance-attribute
Padding between each symbol and its label
symbol_size
class-attribute
instance-attribute
Size of symbols in the legend, in pixels
title
class-attribute
instance-attribute
title: LabelStyle = LabelStyle(font_size=56, font_weight=FontWeight.BOLD)
Style for the legend's labels (see LabelStyle)
starplot.styles.MarkerStyle
Styling properties for markers.
dash_array
class-attribute
instance-attribute
Dash style of the marker's stroke. Can be a predefined string option (e.g. "dashed") or a tuple stroke dasharray.
dash_capstyle
class-attribute
instance-attribute
Style of dash endpoints
fill
class-attribute
instance-attribute
fill: Color | GradientStyle | None = Color('#000')
Fill color of the marker
This can be a single color (e.g. #7abfff) or a GradientStyle that defines a gradient. For example:
GradientStyle(
stops=(
(0.0, "#7abfff"),
(0.2, "#7abfff"),
(0.9, "#568feb"),
(1.0, "#3f7ee3"), # the last stop should always be at 1.0
),
)
There are a few predefined gradients available as style extensions.
opacity
class-attribute
instance-attribute
Opacity (transparency) of the marker (0 to 1)
stroke
class-attribute
instance-attribute
Stroke color of marker. Can be a hex, rgb, hsl, or word string.
stroke_width
class-attribute
instance-attribute
Stroke width of marker, in pixels.
starplot.styles.PolygonStyle
Styling properties for polygons.
dash_array
class-attribute
instance-attribute
Dash style of the polygon's stroke. Can be a predefined string option (e.g. "dashed") or a tuple stroke dasharray.
dash_capstyle
class-attribute
instance-attribute
Style of dash endpoints. Matters even for a closed ring's dashes: a zero-length dash (as used for a dotted dash_array, e.g. (0, 5)) is only visible with a round cap -- square/butt caps render it as nothing.
fill
class-attribute
instance-attribute
fill: Color | GradientStyle | None = Color('#c2c2c2')
Fill color of the polygon
This can either be a single color (e.g. #7abfff) or a GradientStyle that defines a gradient. For example:
GradientStyle(
stops=(
(0.0, "#7abfff"),
(0.2, "#7abfff"),
(0.9, "#568feb"),
(1.0, "#3f7ee3"), # the last stop should always be at 1.0
),
)
There are a few predefined gradients available as style extensions.
opacity
class-attribute
instance-attribute
Opacity (transparency) of the polygon (0 to 1)
stroke
class-attribute
instance-attribute
Edge color of the polygon
stroke_width
class-attribute
instance-attribute
Width of the polygon's edge in pixels
starplot.styles.LineStyle
Styling properties for lines.
cap_style
class-attribute
instance-attribute
Style of line/dash endpoints
dash_array
class-attribute
instance-attribute
Dash style of the line's stroke. Can be a predefined string option (e.g. "dashed") or a tuple stroke dasharray.
opacity
class-attribute
instance-attribute
Opacity (transparency) of the line (0 to 1)
stroke
class-attribute
instance-attribute
Color of the line. Can be a hex, rgb, hsl, or word string.
starplot.styles.LabelStyle
Styling properties for a label.
anchor_point
class-attribute
instance-attribute
anchor_point: Literal[
"center",
"left_center",
"right_center",
"top_left",
"top_right",
"top_center",
"bottom_left",
"bottom_right",
"bottom_center",
] = "bottom_right"
Anchor point of label
font_family
class-attribute
instance-attribute
Font family (e.g. 'monospace', 'sans-serif', 'serif', etc). If None, then the plot's base.font_family will be used.
font_name
class-attribute
instance-attribute
Name of the font to use. If None, then the plot's base.font_name will be used.
font_size
class-attribute
instance-attribute
Font size of the label, in pixels
font_style
class-attribute
instance-attribute
Style of the label (e.g. normal, italic, etc)
font_weight
class-attribute
instance-attribute
Font weight (e.g. normal, bold, ultra bold, etc)
offset_x
class-attribute
instance-attribute
Horizontal offset of the label, in pixels. Negative values supported.
Auto Mode: If the label is plotted as part of a marker (e.g. stars, via marker(), etc), then you can also
specify the offset as "auto" which will calculate the offset automatically based on the marker's size and place
the label just outside the marker (avoiding overlapping). To enable "auto" mode you have to specify BOTH offsets (x and y) as "auto."
offset_y
class-attribute
instance-attribute
Vertical offset of the label, in pixels. Negative values supported.
Auto Mode: If the label is plotted as part of a marker (e.g. stars, via marker(), etc), then you can also
specify the offset as "auto" which will calculate the offset automatically based on the marker's size and place
the label just outside the marker (avoiding overlapping). To enable "auto" mode you have to specify BOTH offsets (x and y) as "auto."
opacity
class-attribute
instance-attribute
Opacity (transparency) of the label (0 to 1)
stroke
class-attribute
instance-attribute
Color of border (also known as 'halos') around the text. If None, then the plot's base.text_stroke will be used.
stroke_width
class-attribute
instance-attribute
Width of border (also known as 'halos') around the text, in pixels. If None, then the plot's base.text_stroke_width will be used.
resolved_font_family
resolved_font_family(base: PlotBaseStyle | None = None) -> str | None
Returns font_family, falling back to base.font_family if it's None.
resolved_font_name
resolved_font_name(base: PlotBaseStyle | None = None) -> str | None
Returns font_name, falling back to base.font_name if it's None.
resolved_stroke
resolved_stroke(base: PlotBaseStyle | None = None) -> Color | None
Returns stroke, falling back to base.text_stroke if it's None.
resolved_stroke_width
resolved_stroke_width(base: PlotBaseStyle | None = None) -> float | None
Returns stroke_width, falling back to base.text_stroke_width if it's None.
starplot.styles.ArrowStyle
body_width
class-attribute
instance-attribute
Width of the arrow's body, in pixels
cap_style
class-attribute
instance-attribute
Cap style of the arrow
dash_array
class-attribute
instance-attribute
Dash style of the polygon's stroke. Can be a predefined string option (e.g. "dashed") or a tuple stroke dasharray.
dash_capstyle
class-attribute
instance-attribute
Style of dash endpoints. Matters even for a closed ring's dashes: a zero-length dash (as used for a dotted dash_array, e.g. (0, 5)) is only visible with a round cap -- square/butt caps render it as nothing.
fill
class-attribute
instance-attribute
fill: Color | GradientStyle | None = Color('#c2c2c2')
Fill color of the polygon
This can either be a single color (e.g. #7abfff) or a GradientStyle that defines a gradient. For example:
GradientStyle(
stops=(
(0.0, "#7abfff"),
(0.2, "#7abfff"),
(0.9, "#568feb"),
(1.0, "#3f7ee3"), # the last stop should always be at 1.0
),
)
There are a few predefined gradients available as style extensions.
head_height
class-attribute
instance-attribute
Height of the arrow's head, in pixels
head_width
class-attribute
instance-attribute
Width of the arrow's head, in pixels
join_style
class-attribute
instance-attribute
Join style of the arrow
opacity
class-attribute
instance-attribute
Opacity (transparency) of the polygon (0 to 1)
stroke
class-attribute
instance-attribute
Edge color of the polygon
stroke_width
class-attribute
instance-attribute
Width of the polygon's edge in pixels
starplot.styles.TitleStyle
anchor_point
class-attribute
instance-attribute
anchor_point: Literal[
"center",
"left_center",
"right_center",
"top_left",
"top_right",
"top_center",
"bottom_left",
"bottom_right",
"bottom_center",
] = "bottom_right"
Anchor point of label
font_family
class-attribute
instance-attribute
Font family (e.g. 'monospace', 'sans-serif', 'serif', etc). If None, then the plot's base.font_family will be used.
font_name
class-attribute
instance-attribute
Name of the font to use. If None, then the plot's base.font_name will be used.
font_size
class-attribute
instance-attribute
Font size of the label, in pixels
font_style
class-attribute
instance-attribute
Style of the label (e.g. normal, italic, etc)
font_weight
class-attribute
instance-attribute
Font weight (e.g. normal, bold, ultra bold, etc)
offset_x
class-attribute
instance-attribute
Horizontal offset of the label, in pixels. Negative values supported.
Auto Mode: If the label is plotted as part of a marker (e.g. stars, via marker(), etc), then you can also
specify the offset as "auto" which will calculate the offset automatically based on the marker's size and place
the label just outside the marker (avoiding overlapping). To enable "auto" mode you have to specify BOTH offsets (x and y) as "auto."
offset_y
class-attribute
instance-attribute
Vertical offset of the label, in pixels. Negative values supported.
Auto Mode: If the label is plotted as part of a marker (e.g. stars, via marker(), etc), then you can also
specify the offset as "auto" which will calculate the offset automatically based on the marker's size and place
the label just outside the marker (avoiding overlapping). To enable "auto" mode you have to specify BOTH offsets (x and y) as "auto."
opacity
class-attribute
instance-attribute
Opacity (transparency) of the label (0 to 1)
padding_bottom
class-attribute
instance-attribute
Padding between bottom of title and the axes
stroke
class-attribute
instance-attribute
Color of border (also known as 'halos') around the text. If None, then the plot's base.text_stroke will be used.
stroke_width
class-attribute
instance-attribute
Width of border (also known as 'halos') around the text, in pixels. If None, then the plot's base.text_stroke_width will be used.
resolved_font_family
resolved_font_family(base: PlotBaseStyle | None = None) -> str | None
Returns font_family, falling back to base.font_family if it's None.
resolved_font_name
resolved_font_name(base: PlotBaseStyle | None = None) -> str | None
Returns font_name, falling back to base.font_name if it's None.
resolved_stroke
resolved_stroke(base: PlotBaseStyle | None = None) -> Color | None
Returns stroke, falling back to base.text_stroke if it's None.
resolved_stroke_width
resolved_stroke_width(base: PlotBaseStyle | None = None) -> float | None
Returns stroke_width, falling back to base.text_stroke_width if it's None.
starplot.styles.TableStyle
Defines the style for a table of data
alignment
class-attribute
instance-attribute
Horizontal alignment of the table, relative to the axes region
border
class-attribute
instance-attribute
Style for the table's grid lines and outer border
cell
class-attribute
instance-attribute
cell: LabelStyle = LabelStyle()
Style for the table's cell text
header
class-attribute
instance-attribute
header: LabelStyle = LabelStyle(font_weight=FontWeight.BOLD)
Style for the table's header row text
starplot.styles.GradientStyle
Styling properties for a gradient fill.