legend-properties
Is it possible to add a string as a legend item
Alternative solution, kind of dirty but pretty quick. import pylab as plt X = range(50) Y = range(50) plt.plot(X, Y, label=”Very straight line”) # Create empty plot with blank marker containing the extra label plt.plot([], [], ‘ ‘, label=”Extra label on the legend”) plt.legend() plt.show()
How to add data table with legend keys to a MS Chart in C#?
Yes you can do that: Here are the steps I took: First we disable the original Legend as it can’t be manipulated the way we need to..: chart1.Legends[0].Enabled = false; Now we create a new one and a shortcut reference to it: chart1.Legends.Add(new Legend(“customLegend”)); Legend L = chart1.Legends[1]; Next we do some positioning: L.DockedToChartArea = … Read more
How to add a string as the artist in matplotlib legend?
I don’t think there’s a legend handler for text (see the list of available ones here). But you can implement your own custom legend handler. Here I’ll just modify the example at the above link: import matplotlib.pyplot as plt import matplotlib.text as mpl_text class AnyObject(object): def __init__(self, text, color): self.my_text = text self.my_color = color … Read more