Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f23712 commit 51ec46cCopy full SHA for 51ec46c
1 file changed
examples/ticks_and_spines/tick_labels_from_values.py
@@ -26,10 +26,9 @@
26
27
28
def format_fn(tick_val, tick_pos):
29
- try:
+ if int(tick_val) in xs:
30
return labels[int(tick_val)]
31
- except IndexError:
32
- # no label for this tick
+ else:
33
return ''
34
ax.xaxis.set_major_formatter(FuncFormatter(format_fn))
35
ax.xaxis.set_major_locator(MaxNLocator(integer=True))
0 commit comments