plot icon indicating copy to clipboard operation
plot copied to clipboard

Make it easier to create a Heat Map with a Legend

Open btracey opened this issue 6 years ago • 5 comments

Is it possible to make a utility function (maybe in plotutil?) for making a simple heat map with a legend? Seems like the easiest way at the moment is to copy and paste the current code in heat_test.go, but even that seems to be difficult to get to work right.

btracey avatar Mar 14 '18 23:03 btracey

Do you want to suggest API for this?

kortschak avatar Mar 14 '18 23:03 kortschak

I think a more general-purpose solution (or perhaps a prerequisite to the proposal above) might be to add (or export) the capability to draw a Legend on an arbitrary canvas. Right now it's only allowed to draw it on the same canvas as the plot

ctessum avatar Mar 15 '18 02:03 ctessum

It looks like it might be as simple as exporting Legend.draw and maybe makeLegend

ctessum avatar Mar 15 '18 02:03 ctessum

My thought was maybe something with plotutil that returns the heat map and the legend, but it sounds like @ctessum has a much clearer idea.

btracey avatar Mar 23 '18 20:03 btracey

So with #436, it is now possible to create a utility function because we now know how tall and wide a legend is and therefore know how much room to leave for it. I don't have a strong idea of what such a function should look like, though, so I will leave that to someone else.

ctessum avatar Apr 10 '18 20:04 ctessum