8000 Update the example · matplotlib/matplotlib@f09a1b4 · GitHub
[go: up one dir, main page]

Skip to content

Commit f09a1b4

Browse files
committed
Update the example
1 parent c82dcff commit f09a1b4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/api/engineering_formatter.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,17 @@
2525
ax.set_xscale('log')
2626

2727
# Demo of the default settings, with a user-defined unit label.
28-
ax0.set_title('Full unit ticklabels, w/ default precision & space sep.')
28+
ax0.set_title('Full unit ticklabels, w/ default precision & space separator')
2929
formatter0 = EngFormatter(unit='Hz')
3030
ax0.xaxis.set_major_formatter(formatter0)
3131
ax0.plot(xs, ys)
3232
ax0.set_xlabel('Frequency')
3333

3434
# Demo of the options `places` (number of digit after decimal point) and
35-
# `space_sep` (presence of a space between the number and the prefix/unit).
36-
ax1.set_title('SI-prefix only ticklabels, 1-digit precision & w/o space sep.')
37-
formatter1 = EngFormatter(places=1, space_sep=False)
35+
# `sep` (separator between the number and the prefix/unit).
36+
ax1.set_title('SI-prefix only ticklabels, 1-digit precision & ' +
37+
'hair space separator')
38+
formatter1 = EngFormatter(places=1, sep=u"\u200a") # U+200A is hair space
3839
ax1.xaxis.set_major_formatter(formatter1)
3940
ax1.plot(xs, ys)
4041
ax1.set_xlabel('Frequency [Hz]')

0 commit comments

Comments
 (0)
0