Skip to content

Commit 23d5e56

Browse files
committed
Fixed triplot to deal with linestyle or marker being None
1 parent bea2634 commit 23d5e56

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/matplotlib/tests/test_triangulation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ def z(x, y):
765765
refiner = mtri.UniformTriRefiner(triang0)
766766
tri_refi, z_test_refi = refiner.refine_field(z0, subdiv=4)
767767
levels = np.arange(0., 1., 0.025)
768-
plt.triplot(triang0, lw=0.5, color='0.5')
768+
plt.triplot(triang0, '0.5', lw=0.5)
769769
plt.tricontour(tri_refi, z_test_refi, levels=levels, colors="black")
770770

771771

lib/matplotlib/tri/triplot.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import numpy as np
77
from matplotlib.tri.triangulation import Triangulation
8-
8+
import matplotlib
99

1010
def triplot(ax, *args, **kwargs):
1111
"""
@@ -54,6 +54,10 @@ def triplot(ax, *args, **kwargs):
5454
if len(args) > 0:
5555
fmt = args[0]
5656
linestyle, marker, color = matplotlib.axes._base._process_plot_format(fmt)
57+
if linestyle is None:
58+
linestyle = matplotlib.rcParams['lines.linestyle']
59+
if marker is None:
60+
marker = matplotlib.rcParams['lines.marker']
5761

5862
# Insert plot format string into a copy of kwargs (kwargs values prevail).
5963
kw = kwargs.copy()

0 commit comments

Comments
 (0)