Skip to content

Commit

Permalink
replacing for loop keeping track of each index with enumerate resolvi…
Browse files Browse the repository at this point in the history
…ng SIM113
  • Loading branch information
hmd101 committed Oct 16, 2024
1 parent 9774f49 commit 0fbbf57
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions docs/scripts/conceptual_intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,14 +410,14 @@ def matched_light():
"linewidth": plt.rcParams["lines.linewidth"],
},
]
for name, wts, sty in zip(
["Random light", "Matched light"],
[random_light_weights, matched_light_weights],
styles,
):
offset = width * multiplier

labels = ["Random light", "Matched light"]
weights = [random_light_weights, matched_light_weights]

for i, (name, wts, sty) in enumerate(zip(labels, weights, styles)):
offset = width * (multiplier + i)
axes[1].bar(x + offset, wts, label=name, width=width, **sty)
multiplier += 1

axes[1].set(
xlabel="Cone class",
ylabel="Cone response (arbitrary units)",
Expand Down

0 comments on commit 0fbbf57

Please sign in to comment.