commaticks#
- commaticks(ax=None, axis='y', precision=2, cursor_precision=0)[source]#
Use commas in formatting the y axis of a figure (e.g., 34,000 instead of 34000).
To use something other than a comma, set the default separator via e.g.
sc.options(sep='.')
.- Parameters:
ax (any) – axes to modify; if None, use current; else can be a single axes object, a figure, or a list of axes
axis (str/list) – which axis to change (default ‘y’; can accept a list)
precision (int) – shift how many decimal places to show for small numbers (+ve = more, -ve = fewer)
cursor_precision (int) – ditto, for cursor
Example:
data = np.random.rand(10)*1e4 plt.plot(data) sc.commaticks()
New in version 1.3.0: ability to use non-comma thousands separatorNew in version 1.3.1: added “precision” argumentNew in version 2.0.0: ability to set x and y axes simultaneously