Skip to content

Plotting

petropandas.pandas_accessors.PetroPlotsAccessor

Use .petroplots pandas dataframe accessor.

profile(*args, **kwargs)

Create line plots from columns, e.g. garnet profiles

Other Parameters:

Name Type Description
use_index bool

When True, xticks are derived from DataFrame index, otherwise ticks are sequential. Default False

extra list

list of columns on secondary axis. Default []

lim tuple

y-axis limits for principal axes or auto when None. Default None

lim_extra tuple

y-axis limits for secondary axes or auto when None. Default None

percents bool

When True y-axes scale is percents, otherwise fraction

xlabel str

label of the x-axis. Default auto.

high list

Add rectangle span(s) from (xmin, xmax). Default None

high_kws dict

Rectangle span(s) properties. Default None

filename str

When not None, the plot is saved to file, otherwise the plot is shown.

maxticks int

Maximum number of ticks on x-axis. Default 20

xticks_rotation int

rotation of xticks labels. Default 0

markers list

Markers used. Default None

grid bool

Show grid. Default False

grid_kws dict

kwargs passed to matplotlib grid. Default dict(visible=True)

grid_ticks int

number of ticks on twin axes, when grid is True. Default 10

figsize tuple

width, height in inches. If not provided, defaults to rcParams["figure.figsize"]

subplot_kws dict

kwargs passed to matplotlib subplots. Default {}

ax Axes

matplotlib axes to be used.

return_ax bool

Whether to return matplotlib axes. Default False

show bool

Whether to show plot. Default True

ternary(*args, **kwargs)

Ternary scatter plot

Parameters:

Name Type Description Default
top str

name of column or expression for top variable. Default column 0

required
left str

name of column or expression for left variable. Default column 1

required
right str

name of column or expression for right variable. Default column 2

required

Other Parameters:

Name Type Description
kind str

kind of plot, scatter, plot or contour. Other values returns empty plot. Deafult scatter.

c str | array like

values used for coloring as expression (str) or array of values.

s str | array like

values used for sizing as expression (str) or array of values.

v str | array like

values used for contouring as expression (str) or array of values.

ternary_sum float

Total sum. Default 1.0

tlim tuple

top limits. Default(0, 1)

llim tuple

top limits. Default(0, 1)

rlim tuple

top limits. Default(0, 1)

grid bool

Show grid. Default False

grid_kws dict

kwargs passed to matplotlib grid. Default dict(visible=True)

figsize tuple

width, height in inches. If not provided, defaults to rcParams["figure.figsize"]

ax Axes

matplotlib axes to be used.

return_ax bool

Whether to return matplotlib axes. Default False

show bool

Whether to show plot. Default True

Additional keyword arguments are passed to underlying matplotlib function, e.g. s or c to scatter or label