Is the type for errorbar plots.
Inheritance: XYPlotValue
Beispiel #1
0
        public ErrorPlotValue Function(MatrixValue X, MatrixValue Y, MatrixValue E)
        {
            var plot = new ErrorPlotValue();

            plot.AddPoints(X, Y, E);
            return(plot);
        }
Beispiel #2
0
        /// <summary>
        /// Converts a set of bytes to a new instance.
        /// </summary>
        /// <param name="content">The binary representation.</param>
        /// <returns>The new instance.</returns>
        public override Value Deserialize(byte[] content)
        {
            var ep = new ErrorPlotValue();

            using (var ds = Deserializer.Create(content))
            {
                ep.Deserialize(ds);
                ep.IsLogX = ds.GetBoolean();
                ep.IsLogY = ds.GetBoolean();
                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points <ErrorPointPair>();
                    points.Deserialize(ds);
                    var count = ds.GetInt();

                    for (int j = 0; j < count; j++)
                    {
                        var x    = ds.GetDouble();
                        var y    = ds.GetDouble();
                        var xerr = ds.GetDouble();
                        var yerr = ds.GetDouble();

                        points.Add(new ErrorPointPair
                        {
                            X    = x,
                            Y    = y,
                            Xerr = xerr,
                            Yerr = yerr
                        });
                    }

                    ep.AddSeries(points);
                }
            }

            return(ep);
        }
Beispiel #3
0
        /// <summary>
        /// Converts a set of bytes to a new instance.
        /// </summary>
        /// <param name="content">The binary representation.</param>
        /// <returns>The new instance.</returns>
        public override Value Deserialize(byte[] content)
        {
            var ep = new ErrorPlotValue();

            using (var ds = Deserializer.Create(content))
            {
                ep.Deserialize(ds);
                ep.IsLogX = ds.GetBoolean();
                ep.IsLogY = ds.GetBoolean();
                var length = ds.GetInt();

                for (var i = 0; i < length; i++)
                {
                    var points = new Points<ErrorPointPair>();
                    points.Deserialize(ds);
                    var count = ds.GetInt();

                    for (int j = 0; j < count; j++)
                    {
                        var x = ds.GetDouble();
                        var y = ds.GetDouble();
                        var xerr = ds.GetDouble();
                        var yerr = ds.GetDouble();

                        points.Add(new ErrorPointPair
                        {
                            X = x,
                            Y = y,
                            Xerr = xerr,
                            Yerr = yerr
                        });
                    }

                    ep.AddSeries(points);
                }
            }

            return ep;
        }