You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifically for density plots on ternary axes, because of the introspection used by pyrolite together with how indirection/handler functions are structured within mpltern, and the fact that pyrolite uses the e.g. tripcolor variants, extra keyword arguments including vmax are not passed through to the relevant pcolor/pcolormesh functions in matplotilib
To Reproduce
importmatplotlib.pyplotaspltimportnumpyasnpimportpyrolite.plotfrompyrolite.util.syntheticimportnormal_frame# ternary random data, with a specific composition# broad enough distribution to visualize colormapped valuesdf=normal_frame(
size=1000,
seed=11,
columns=["SiO2", "CaO", "MgO"],
mean=np.array([0.1, 0.4, 0.3]),
cov=0.1*np.array([[1.2, -0.15], [-0.15, 1.2]]),
)
ax=df.pyroplot.density(vmax=0)
Expected behavior
Keyword arguments are passed through to the relevant pcolor/pcolormesh functions in matplotilib.
Temporary Workaround:
For at least some parameters, some attributes of e.g. the colormap and norm are able to be modified after the collection has been added to an axis; this requires a bit of reading through the properties of the collection, but makes styling changes possible, e.g.:
# set the `vmax` property of the norm from the last collection added to the axesax.collections[-1]._norm.vmax=0
The text was updated successfully, but these errors were encountered:
One way to patch this (in lieu of a likely future PR to mpltern adding this to the assorted axes plotting methods), is as follows, adding relevant keyword arguments to mpltern._axes.TernaryAxes.tripcolor:
Describe the bug
Specifically for density plots on ternary axes, because of the introspection used by
pyrolite
together with how indirection/handler functions are structured withinmpltern
, and the fact thatpyrolite
uses the e.g.tripcolor
variants, extra keyword arguments includingvmax
are not passed through to the relevantpcolor
/pcolormesh
functions inmatplotilib
To Reproduce
Expected behavior
Keyword arguments are passed through to the relevant
pcolor
/pcolormesh
functions inmatplotilib
.Temporary Workaround:
For at least some parameters, some attributes of e.g. the colormap and norm are able to be modified after the collection has been added to an axis; this requires a bit of reading through the properties of the collection, but makes styling changes possible, e.g.:
The text was updated successfully, but these errors were encountered: