plot
plot copied to clipboard
Make it easier to create a Heat Map with a Legend
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.
Do you want to suggest API for this?
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
It looks like it might be as simple as exporting Legend.draw and maybe makeLegend
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.
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.