Пример #1
0
        public PlottableFunction PlotFunction(
            Func <double, double?> function,
            Color?color             = null,
            double lineWidth        = 1,
            double markerSize       = 0,
            string label            = "f(x)",
            MarkerShape markerShape = MarkerShape.none,
            LineStyle lineStyle     = LineStyle.Solid
            )
        {
            if (markerShape != MarkerShape.none || markerSize != 0)
            {
                throw new ArgumentException("function plots do not use markers");
            }

            PlottableFunction functionPlot = new PlottableFunction(function)
            {
                color     = color ?? settings.GetNextColor(),
                lineWidth = lineWidth,
                lineStyle = lineStyle,
                label     = label
            };

            Add(functionPlot);
            return(functionPlot);
        }
Пример #2
0
        public PlottableFunction PlotFunction(
            Func <double, double?> function,
            Color?color             = null,
            double lineWidth        = 1,
            double markerSize       = 0,
            string label            = "f(x)",
            MarkerShape markerShape = MarkerShape.filledCircle,
            LineStyle lineStyle     = LineStyle.Solid
            )
        {
            if (color == null)
            {
                color = settings.GetNextColor();
            }

            PlottableFunction functionPlot = new PlottableFunction(function, color.Value, lineWidth, markerSize, label, markerShape, lineStyle);

            Add(functionPlot);
            return(functionPlot);
        }