Exemplo n.º 1
0
        public BarPlot(double[] xs, double[] ys, double[] yErr, double[] yOffsets)
        {
            if (ys is null || ys.Length == 0)
            {
                throw new ArgumentException("ys must be an array that contains elements");
            }

            this.ys       = ys;
            this.xs       = xs ?? DataGen.Consecutive(ys.Length);
            this.yErr     = yErr ?? DataGen.Zeros(ys.Length);
            this.yOffsets = yOffsets ?? DataGen.Zeros(ys.Length);
        }
Exemplo n.º 2
0
        public BarPlot(double[] xs, double[] ys, double[] yErr, double[] yOffsets) : base()
        {
            if (ys is null || ys.Length == 0)
            {
                throw new InvalidOperationException("ys must be an array that contains elements");
            }

            Values       = ys;
            Positions    = xs ?? DataGen.Consecutive(ys.Length);
            ValueErrors  = yErr ?? DataGen.Zeros(ys.Length);
            ValueOffsets = yOffsets ?? DataGen.Zeros(ys.Length);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Create a lollipop plot from arrays of positions and sizes
        /// </summary>
        /// <param name="positions">position of each lollipop</param>
        /// <param name="values">height of each lollipop</param>
        public LollipopPlot(double[] positions, double[] values) : base()
        {
            if (positions is null || positions.Length == 0 || values is null || values.Length == 0)
            {
                throw new InvalidOperationException("xs and ys must be arrays that contains elements");
            }

            if (values.Length != positions.Length)
            {
                throw new InvalidOperationException("xs and ys must have the same number of elements");
            }

            ValueErrors  = DataGen.Zeros(values.Length);
            ValueOffsets = DataGen.Zeros(values.Length);
            Values       = values;
            Positions    = positions ?? DataGen.Consecutive(values.Length);
        }