On Oct 9, 2018, at 07:25, Timothy Snyder <tcs49@zips.uakron.edu> wrote:
Ignore the percentages in the two legend samples. Concerned about the color and width of lines.
On Tue, Oct 9, 2018 at 10:24 AM Timothy Snyder <tcs49@zips.uakron.edu> wrote:
Thanks for the response Bryan. I've since implemented this but I've run into another problem. I'm using a MultiLine to represent 5 lines on the plot. However, when I add the glyph to the plot, I'm returned one GlyphRenderer. As such, this renderer is all I have to supply to my LegendItems. Now, the appearance of each entry in the legend is based on the first line in my MultiLine
def build_legend_clean(renderer, pass_data):
legend = Legend(location="top_left")
num_clusters = pass_data.num_clusters
num_passes_by_cluster = pass_data.num_passes_by_cluster
total_passes = pass_data.total_passes
for i, (num_passes) in enumerate(num_passes_by_cluster):
lbl = "{:.0%}".format(num_passes / total_passes)
legend.items.append(LegendItem(label=lbl, renderers=[renderer]))
return legend
I've attached an image so you can better see what I'm stuck on. The legend highlighted in red is the problem one. The other legend is the desired result (achieved in a hacky way where I plotted the 5 lines individually and then made them invisible). Any insight would be helpful.
Thanks for the help Bryan.
--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bokeh+unsubscribe@continuum.io.
To post to this group, send email to bokeh@continuum.io.
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/CABtjQ9%2B-yYGzT6H4C4uFLfk6yp1ht1KWh%3DNYX9StjC%2BV-biBCg%40mail.gmail.com\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.