Skip to content

Commit bf1862e

Browse files
authored
Merge pull request #128 from TsKyrk/patch-1 — Convert RadioButtons labels to list
Fix RadioButtons labels: convert dict_keys to list to avoid TypeError on Python 3.11+ (Matplotlib expects an indexable sequence). Verified in sandbox that `dict_keys` raises and `list(...)` works. Safe, minimal change.
2 parents 2e77319 + 4767cfd commit bf1862e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

general/interactive-weather-plot/interactive_weather_plot.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def changeLocation(newLocation):
6868
# Making the Radio Buttons
6969
buttons = RadioButtons(
7070
ax=plt.axes([0.1, 0.1, 0.2, 0.2]),
71-
labels=locations.keys()
71+
labels=list(locations.keys())
7272
)
7373

7474
# Connect click event on the buttons to the function that changes location.
@@ -86,4 +86,4 @@ def changeLocation(newLocation):
8686

8787
plt.savefig('file.svg', format='svg')
8888

89-
plt.show()
89+
plt.show()

0 commit comments

Comments
 (0)