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

Function create_figure

lib/matplotlib/tests/test_backend_pgf.py:73–98  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72
73def create_figure():
74 plt.figure()
75 x = np.linspace(0, 1, 15)
76
77 # line plot
78 plt.plot(x, x ** 2, "b-")
79
80 # marker
81 plt.plot(x, 1 - x**2, "g>")
82
83 # filled paths and patterns
84 plt.fill_between([0., .4], [.4, 0.], hatch='//', facecolor="lightgray",
85 edgecolor="red")
86 plt.fill([3, 3, .8, .8, 3], [2, -2, -2, 0, 2], "b")
87
88 # text and typesetting
89 plt.plot([0.9], [0.5], "ro", markersize=3)
90 plt.text(0.9, 0.5, 'unicode (ü, °, \N{Section Sign}) and math ($\\mu_i = x_i^2$)',
91 ha='right', fontsize=20)
92 plt.ylabel('sans-serif, blue, $\\frac{\\sqrt{x}}{y^2}$..',
93 family='sans-serif', color='blue')
94 plt.text(1, 1, 'should be clipped as default clip_box is Axes bbox',
95 fontsize=20, clip_on=True)
96
97 plt.xlim(0, 1)
98 plt.ylim(0, 1)
99
100
101# test compiling a figure to pdf with xelatex

Callers 3

test_xelatexFunction · 0.70
test_pdflatexFunction · 0.70
test_rcupdateFunction · 0.70

Calls 5

figureMethod · 0.80
plotMethod · 0.45
fill_betweenMethod · 0.45
fillMethod · 0.45
textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…