-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Bug Report
YAxis can refer to YAxis or YAxis2 where relevent...
Issue: Adding a ColorBar to a plot increases the YAxis PixelMinimumSize. Subsequently removing the ColorBar doesn't reduce this value and consequently leaves a large margin between the YAxis and the edge of the bitmap.
The convenience method Plot.AddColorbar() calls YAxis.SetSizeLimit(min: space) but there is no equivalent method of resetting this value. The workaround is to manually call YAxis.SetSizeLimit(min: 5) but this is fragile. A public method to ResetSizeLimit() would be a good start.
Reproducing:
[Test]
public void Test()
{
var plt = new ScottPlot.Plot();
var bmp1 = TestTools.GetLowQualityBitmap(plt);
var cb = plt.AddColorbar();
plt.Remove(cb);
var bmp2 = TestTools.GetLowQualityBitmap(plt);
var before = new MeanPixel(bmp1);
var after = new MeanPixel(bmp2);
Assert.That(after.IsEqualTo(before));
}System Details
- ScottPlot Version: SHA 3581f8c
- Operating System: Windows 10
- Application Type: console, WPF
- .NET Version: .NET 5.0/6.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels