ScottPlot/ScottPlot

Heatmap how to remove legend before re plotting

mus3na opened this issue ยท 2 comments

I need a way to remove legend from HeatMap plot under ScottPlot Version 5. Plot.clear() onle remove chart but legend remaind in existing plot. therefore when i replot new data, number of lagend will increase (each time i refresh, it will add new legend).

' Clear plot before reuse
FormsPlot1.Plot.Clear()

' Plot the transposed data as a heatmap
Dim Color_Map = FormsPlot1.Plot.Add.Heatmap(transposedHeatLoad)
Color_Map.Colormap = New ScottPlot.Colormaps.Turbo

' Add a color bar with representing intensity values
FormsPlot1.Plot.Add.ColorBar(Color_Map)

The code is in VB.NET for winform
image

Hi @mus3na, I think you can remove all those right axis panels by calling:

FormsPlot1.Plot.Axes.Remove(Edge.Right);

Let me know if it doesn't work as expected and we can open this issue back up and take a closer look! ๐Ÿ‘