MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / demo

Method demo

lib/matplotlib/_enums.py:149–167  ·  view source on GitHub ↗

Demonstrate how each CapStyle looks for a thick line segment.

()

Source from the content-addressed store, hash-verified

147
148 @staticmethod
149 def demo():
150 """Demonstrate how each CapStyle looks for a thick line segment."""
151 import matplotlib.pyplot as plt
152
153 fig = plt.figure(figsize=(4, 1.2))
154 ax = fig.add_axes((0, 0, 1, 0.8))
155 ax.set_title('Cap style')
156
157 for x, style in enumerate(['butt', 'round', 'projecting']):
158 ax.text(x+0.25, 0.85, style, ha='center')
159 xx = [x, x+0.5]
160 yy = [0, 0]
161 ax.plot(xx, yy, lw=12, color='tab:blue', solid_capstyle=style)
162 ax.plot(xx, yy, lw=1, color='black')
163 ax.plot(xx, yy, 'o', color='tab:red', markersize=3)
164
165 ax.set_ylim(-.5, 1.5)
166 ax.set_axis_off()
167 fig.show()
168
169
170CapStyle.input_description = "{" \

Callers 2

joinstyle.pyFile · 0.45
capstyle.pyFile · 0.45

Calls 8

figureMethod · 0.80
add_axesMethod · 0.80
set_titleMethod · 0.45
textMethod · 0.45
plotMethod · 0.45
set_ylimMethod · 0.45
set_axis_offMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected