减少 ZedGraph 边距

Reducing ZedGraph margin

谁能告诉我如何减少 graphPane 到边框之间的边距?我想从图表的底部边缘开始,在图表的顶部、左侧和右侧留出一些间隙。我试过了,但它给了我一些奇怪的放大图。

graphPane.YAxis.Scale.Min = lowerPoint;
graphPane.YAxis.Scale.Max = higherPoint+offset;
graphPane.XAxis.Scale.Min = leftPoint + offset;
graphPane.XAxis.Scale.Max = rightPoint + offset;

您可以通过手动设置图表的 Rect 属性 来删除 'margin'

float leftMargin = 10;
float rightMargin = 10;
float topMargin = 10;
float bottomMargin = 5;
float width = 1920;
float height = 1080;
graphPane.Chart.Rect = new RectangleF(leftMargin, topMargin, width - leftMargin - rightMargin, height - topMargin - bottomMargin);