Skip to content

Commit

Permalink
Merge pull request #157 from ianhi/off-by-one
Browse files Browse the repository at this point in the history
Fix Off by one error
  • Loading branch information
ianhi authored Jan 1, 2021
2 parents e63e838 + d759cc1 commit c8ab748
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"python.pythonPath": "/home/ian/anaconda3/envs/ipympl/bin/python",
"python.pythonPath": "/home/ian/anaconda3/envs/mpl-inter/bin/python",
"python.formatting.provider": "black"
}
2 changes: 1 addition & 1 deletion mpl_interactions/_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 16, 1)
version_info = (0, 16, 2)
__version__ = ".".join(map(str, version_info))
2 changes: 1 addition & 1 deletion mpl_interactions/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ def create_mpl_selection_slider(ax, label, values, slider_format_string):
"""
creates a slider that behaves similarly to the ipywidgets selection slider
"""
slider = mwidgets.Slider(ax, label, 0, len(values), valinit=0, valstep=1)
slider = mwidgets.Slider(ax, label, 0, len(values) - 1, valinit=0, valstep=1)

def update_text(val):
slider.valtext.set_text(slider_format_string.format(values[int(val)]))
Expand Down

0 comments on commit c8ab748

Please sign in to comment.