All Questions
3
questions
33
votes
3
answers
49k
views
Customizing the order of legends in plotly
I am trying to customize the order of legends while plotting stacked bar plots in plotly,python.
data = [
go.Bar(
y=df['sid'], # assign x as the dataframe column 'x'
...
1
vote
2
answers
2k
views
Why do matplotlib legend elements have the same colour?
I am doing a bar plot and adding the legends. The code is the following:
import numpy as np
import matplotlib.pyplot as plt
rectArr = list()
fig, ax_arr = plt.subplots(nrows=2, ncols=1, figsize=(8,8),...
2
votes
1
answer
427
views
How to create two legend objects for a single plot instance?
I use the following example code to generate a bar plot.
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(0, 5, 5)
y = np.exp(x)
w = x[1] - x[0]
colors = ['blue' if idx % 2 == 0 ...