Heatmap how to remove legend before re plotting
mus3na opened this issue ยท 2 comments
mus3na commented
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)
swharden commented
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! ๐
mus3na commented
Hi, thanks for the reply.
The code you give below didn't produce result as what i need but it give a better presentation by removig the white space between the intensity image and its scale ruler.
i somehow found a way to completely remove this intensity image and ruler (legend) by resetting the plot before re plotting new data. so its ok to close the issue. my work arround code are as below;
i call this code;
โโโ FormsPlot1.Plot.Clear()
FormsPlot1.Reset()
FormsPlot1.Plot.Axes.Remove(Edge.Right)
before re create the plot
Dim Color_Map = FormsPlot1.Plot.Add.Heatmap(transposedHeatLoad)
Color_Map.Colormap = New ScottPlot.Colormaps.Turbo
FormsPlot1.Plot.Add.ColorBar(Color_Map)
Thank you
Hi, thanks
โฆ________________________________
From: Scott W Harden ***@***.***>
Sent: Tuesday, 7 May, 2024 6:45 AM
To: ScottPlot/ScottPlot ***@***.***>
Cc: Ir.Ts. Musnazril ***@***.***>; Mention ***@***.***>
Subject: Re: [ScottPlot/ScottPlot] Heatmap how to remove legend before re plotting (Issue #3788)
Hi @mus3na<https://github.com/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! ๐
โ
Reply to this email directly, view it on GitHub<#3788 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ANFQEZVDWQVFKOBZ4NSRY3TZBABZJAVCNFSM6AAAAABHJLU7G2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOJXGA2TCOJWGE>.
You are receiving this because you were mentioned.Message ID: ***@***.***>