Exemple #1
0
        public PlottableHLine PlotHLine(
            double y,
            Color?color           = null,
            double lineWidth      = 1,
            string label          = null,
            bool draggable        = false,
            double dragLimitLower = double.NegativeInfinity,
            double dragLimitUpper = double.PositiveInfinity,
            LineStyle lineStyle   = LineStyle.Solid
            )
        {
            var hline = new PlottableHLine()
            {
                position    = y,
                color       = color ?? settings.GetNextColor(),
                lineWidth   = (float)lineWidth,
                label       = label,
                DragEnabled = draggable,
                lineStyle   = lineStyle,
            };

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

            Add(hline);
            return(hline);
        }
Exemple #2
0
        public PlottableHLine PlotHLine(
            double y,
            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();
            }

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

            settings.plottables.Add(axLine);
            return(axLine);
        }
Exemple #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();
        }