Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f09a1b4

Browse filesBrowse files
committed
Update the example
1 parent c82dcff commit f09a1b4
Copy full SHA for f09a1b4

File tree

Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-4
lines changed

‎examples/api/engineering_formatter.py

Copy file name to clipboardExpand all lines: examples/api/engineering_formatter.py
+5-4Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.