Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e1bdb3b

Browse files
authored
Merge pull request #23063 from megies/doc_mathtext_example_axhspan
doc: mathtext example: use axhspan() instead of fill_between() for backdrop rectangle shading
2 parents fa24348 + 213d37f commit e1bdb3b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

examples/text_labels_and_annotations/mathtext_examples.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ def doall():
8989
baseline = 1 - i_line * line_axesfrac
9090
baseline_next = baseline - line_axesfrac
9191
fill_color = ['white', 'tab:blue'][i_line % 2]
92-
ax.fill_between([0, 1], [baseline, baseline],
93-
[baseline_next, baseline_next],
94-
color=fill_color, alpha=0.2)
92+
ax.axhspan(baseline, baseline_next, color=fill_color, alpha=0.2)
9593
ax.annotate(f'{title}:',
9694
xy=(0.06, baseline - 0.3 * line_axesfrac),
9795
color=mpl_grey_rgb, weight='bold')

0 commit comments

Comments
 (0)