From af8e14b1d511089609b0276071bb70c020cf77ed Mon Sep 17 00:00:00 2001 From: Tim Hoffmann <2836374+timhoffm@users.noreply.github.com> Date: Sun, 17 May 2026 10:35:25 +0200 Subject: [PATCH] Don't use matplotlib internal API _major_tick_kw The public API is available since matplotlib 3.7 https://github.com/matplotlib/matplotlib/pull/23692 --- plotly/matplotlylib/mplexporter/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plotly/matplotlylib/mplexporter/utils.py b/plotly/matplotlylib/mplexporter/utils.py index 646e11e2f86..23bfd414f74 100644 --- a/plotly/matplotlylib/mplexporter/utils.py +++ b/plotly/matplotlylib/mplexporter/utils.py @@ -200,7 +200,7 @@ def get_text_style(text): def get_axis_properties(axis): """Return the property dictionary for a matplotlib.Axis instance""" props = {} - label1On = axis._major_tick_kw.get("label1On", True) + label1On = axis.get_tick_params().get("label1On", True) if isinstance(axis, matplotlib.axis.XAxis): if label1On: @@ -257,7 +257,7 @@ def get_axis_properties(axis): def get_grid_style(axis): gridlines = axis.get_gridlines() - if axis._major_tick_kw["gridOn"] and len(gridlines) > 0: + if axis.get_tick_params()["gridOn"] and len(gridlines) > 0: color = export_color(gridlines[0].get_color()) alpha = gridlines[0].get_alpha() dasharray = get_dasharray(gridlines[0])