Closed s2t2 closed 4 years ago
Hi @s2t2,
You can simply "unpack" your keyword arguments using **kwargs
.
plot_opts = {"x": "my_col", "y": "other_col", "title": "My Title", "orientation": "v", "box": True, "points": None}
fig = px.violin(df, **plot_opts)
@DrGFreeman it works! Thanks for teaching me something new.
Hi, I'm making charts like a violin plot, and I have need to conditionally assemble its options. I was hoping to be able to pass a dictionary to represent the optional parameters during chart construction.
Example invocation that works:
Example of desired invocation (currently throws error "Value of 'x' is not the name of a column in 'data_frame'..."):
Is there a way to pass the options as a dictionary? Thanks!