【问题标题】:How to show more than one plot per form using OxyPlot (VB.Net)如何使用 OxyPlot (VB.Net) 在每个表单中显示多个图
【发布时间】:2023-03-12 20:15:01
【问题描述】:

我一直在试验 VB.Net 库 OxyPlothttps://oxyplot.codeplex.com ==> 已移至 GitHub = => https://github.com/oxyplot)。

我一直在努力从示例列表中复制几个绘图示例。虽然一切顺利,我的问题是:

1.一个表格怎么可能显示不止一个情节(比如 3 个)?
2.如何在表单上定位每个图?
.


下面是用于在表单中显示等高线图的代码:
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

    InitializeComponent()

    Dim Plot As OxyPlot.WindowsForms.Plot = New OxyPlot.WindowsForms.Plot()
    Plot.Dock = DockStyle.Fill
    Plot.Model = New PlotModel("Peaks")

    Dim cs As ContourSeries = New ContourSeries()
    cs.ColumnCoordinates = ArrayHelper.CreateVector(-3, 3, 0.05)
    cs.RowCoordinates = ArrayHelper.CreateVector(-3.1, 3.1, 0.05)
    cs.ContourColors = {OxyColors.SeaGreen, OxyColors.RoyalBlue, OxyColors.IndianRed}
    cs.Data = peaks(cs.ColumnCoordinates, cs.RowCoordinates)
    Plot.Model.Series.Add(cs)

    Me.Controls.Add(Plot)

End Sub

提前谢谢你!

【问题讨论】:

    标签: vb.net github plot contour oxyplot


    【解决方案1】:

    您需要为每个“绘图”或要显示的数据集设置一个单独的系列。如果需要,您可以将它们全部重叠在一个轴上。否则,您可以为每个系列创建单独的轴,并使用 Axis.StartPosition/EndPosition 属性作为整个绘图区域的百分比来分隔它们。检查示例浏览器,在轴示例下,特别是多个窗格。使用 Ctrl-Alt-C 将代码复制到剪贴板。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-04-06
      • 1970-01-01
      • 2022-06-10
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多