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