Exemplo n.º 1
0
        public PlottableVLine PlotVLine(
            double x,
            Color?color           = null,
            double lineWidth      = 1,
            string label          = null,
            bool draggable        = false,
            double dragLimitLower = double.NegativeInfinity,
            double dragLimitUpper = double.PositiveInfinity,
            LineStyle lineStyle   = LineStyle.Solid
            )
        {
            PlottableVLine axLine = new PlottableVLine()
            {
                position    = x,
                color       = color ?? settings.GetNextColor(),
                lineWidth   = (float)lineWidth,
                label       = label,
                DragEnabled = draggable,
                lineStyle   = lineStyle,
            };

            axLine.SetLimits(dragLimitLower, dragLimitUpper, null, null);

            Add(axLine);
            return(axLine);
        }
Exemplo n.º 2
0
        public PlottableVLine PlotVLine(
            double x,
            Color?color           = null,
            double lineWidth      = 1,
            string label          = null,
            bool draggable        = false,
            double dragLimitLower = double.NegativeInfinity,
            double dragLimitUpper = double.PositiveInfinity,
            LineStyle lineStyle   = LineStyle.Solid
            )
        {
            if (color == null)
            {
                color = settings.GetNextColor();
            }

            PlottableVLine axLine = new PlottableVLine(
                position: x,
                color: (Color)color,
                lineWidth: lineWidth,
                label: label,
                draggable: draggable,
                dragLimitLower: dragLimitLower,
                dragLimitUpper: dragLimitUpper,
                lineStyle: lineStyle
                );

            settings.plottables.Add(axLine);
            return(axLine);
        }
Exemplo n.º 3
0
        private void Form1_Load(object sender, EventArgs e)
        {
            vline = formsPlot1.plt.PlotVLine(1);
            hline = formsPlot1.plt.PlotHLine(1);

            formsPlot1.plt.PlotHSpan(10, 20, draggable: true);
            formsPlot1.plt.PlotVSpan(5, 10, draggable: true);

            Random rand = new Random(0);

            double[] xs = DataGen.Consecutive(100);
            double[] ys = DataGen.RandomWalk(rand, 100);
            sph = formsPlot1.plt.PlotScatterHighlight(xs, ys);

            formsPlot1.Render();
        }