graphinglib.SmartFigureWCS.set_grid#
- SmartFigureWCS.set_grid(visible_x: bool = True, visible_y: bool = True, color: str | Inherit = Inherit, alpha: float | Inherit = Inherit, line_style: str | Inherit = Inherit, line_width: float | Inherit = Inherit) Self[source]#
Sets the grid parameters for the figure.
Note
Contrary to the
SmartFigureclass, this method does not support plotting grid lines for minor ticks. This is because theastropy.visualization.wcsaxes.WCSAxesdo not support minor ticks for the grid lines.- Parameters:
- visible_x, visible_ybool, optional
If
True, sets the x-axis or y-axis grid visible. IfFalse, the grid is not shown for the respective axis. Defaults toTruefor both axes.- colorstr, optional
Sets the color of the grid lines. Default depends on the
figure_styleconfiguration.- alphafloat, optional
Sets the alpha value for the grid lines. Range is
0(transparent) to1(opaque). Default depends on thefigure_styleconfiguration.- line_stylestr, optional
Sets the line style of the grid lines. Values include
"-","--","-.",":","solid","dashed","dashdot", and"dotted". Default depends on thefigure_styleconfiguration.- line_widthfloat, optional
Sets the line width of the grid lines. Typical range is
0.5to3. Default depends on thefigure_styleconfiguration.
- Returns:
- Self
For convenience, the same SmartFigure with the updated grid parameters.
Notes
Color parameters accept Matplotlib color formats: named colors (
"blue"), short color strings ("b"), hex strings ("#0000ff"), grayscale strings ("0.5"), and RGB/RGBA tuples with values between0and1((0, 0, 1)or(0, 0, 1, 0.5)).