1. Axes#
gsplot.axes provide a list of matplotlib.axes.Axes. They are the most important part of a figure and are axes where the data are plotted. You can have multiple axes in a single figure by
mosaic
, each axis is compatible to matplotlib.
Example#
Main Functions#
Function |
A Brief Overview |
---|---|
Add axes to a figure |
|
Show a figure and save it if store in gsplot.axes is True |
Code#
Tip
unit
provides a way to set gsplot.label of 10 px
(default) to all axes of the figure. This ensures consistency when creating presentations with a unified style.
his ensures consistency when creating presentations with a unified style.
PowerPoint: Set the unit
to cm
and insert the figure with the same size in PowerPoint. The font size will default to 10 pt
on the PowerPoint slide
Keynote: Set the unit
to pt
and insert the figure with the same size in Keynote. The font size will default to 10 pt
on the Keynote slide
import gsplot as gs
# Create figure size (10 x 5) inches with two axes defined by the mosaic
# Unit can be "in", "cm", "mm", and "pt". Default is "in".
axs = gs.axes(
store=True,
size=[10, 5],
unit="in",
mosaic="""
ABBB
ACCD
""",
)
# You can also use the following syntax
# axs = gs.axes(store=True, size=[10, 5], unit="in", mosaic="ABBB;ACCD")
# Show figure and store figure with the name "axes"
gs.show("axes")