Skip to content

Instantly share code, notes, and snippets.

@moritzkoerber
Created August 22, 2020 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moritzkoerber/3fa4b107070ee28a077a0b44416dbb47 to your computer and use it in GitHub Desktop.
Save moritzkoerber/3fa4b107070ee28a077a0b44416dbb47 to your computer and use it in GitHub Desktop.
def convert_to_sixpack(x):
return x / 6
fig.update_layout(
updatemenus=[
dict(
type="buttons",
direction="right",
x=0.7,
y=1.2,
showactive=True,
buttons=list(
[
dict(
label="Single",
method="update",
args=[{"y": [df["ice_cream_cones"], df["drinks"]]},],
),
dict(
label="Packs",
method="update",
args=[
{"y": [
df["ice_cream_cones"],
convert_to_sixpack(df["drinks"]),
]
},
],
),
]
),
)
]
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment