无框图
如何创建仅包含数据区而不包含坐标区的绘图。
WpfPlot1.Plot.Add.Signal(Generate.Sin(51));
WpfPlot1.Plot.Add.Signal(Generate.Cos(51));
// make the data area cover the full figure
WpfPlot1.Plot.Layout.Frameless();
// set the data area background so we can observe its size
WpfPlot1.Plot.DataBackground.Color = Colors.WhiteSmoke;
WpfPlot1.Refresh();
固定填充
可以安排绘图,以便在数据区域的每一侧实现固定数量的填充
// add sample data to the plot
WpfPlot1.Plot.Add.Signal(Generate.Sin(51));
WpfPlot1.Plot.Add.Signal(Generate.Cos(51));
// use a fixed amount of of pixel padding on each side
PixelPadding padding = new(100, 50, 100, 50);
WpfPlot1.Plot.Layout.Fixed(padding);
// darken the figure background so we can observe its dimensions
WpfPlot1.Plot.FigureBackground.Color = Colors.LightBlue;
WpfPlot1.Plot.DataBackground.Color = Colors.White;
WpfPlot1.Refresh();
固定矩形
可以安排绘图,以便将数据绘制在以像素单位定义的固定矩形内
// add sample data to the plot
WpfPlot1.Plot.Add.Signal(Generate.Sin(51));
WpfPlot1.Plot.Add.Signal(Generate.Cos(51));
// set the data area to render inside a fixed rectangle
PixelSize size = new(300, 200);
Pixel offset = new(50, 50);
PixelRect rect = new(size, offset);
WpfPlot1.Plot.Layout.Fixed(rect);
// darken the figure background so we can observe its dimensions
WpfPlot1.Plot.FigureBackground.Color = Colors.LightBlue;
WpfPlot1.Plot.DataBackground.Color = Colors.White;
WpfPlot1.Refresh();