Пример #1
0
        public void AutoAxis_EqualAxis_UnitsPerPixelEqual()
        {
            var plt = new ScottPlot.Plot();

            plt.AddLine(0, 0, 5, 1);
            plt.AxisScaleLock(true);
            plt.AxisAuto();

            var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt);
            Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001);
        }
Пример #2
0
        public void AutoAxis_EqualAxisOnScatterDifferentResolutions_UnitsPerPixelEqual(int width, int height)
        {
            double[] xs  = new double[] { 1, 5, 7, 19, 42 };
            double[] ys  = new double[] { 51, -5, 6, 12, 3 };
            var      plt = new ScottPlot.Plot(width, height);

            plt.AddScatter(xs, ys);
            plt.AxisScaleLock(true);
            plt.AxisAuto();

            var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt);
            Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001);
        }
Пример #3
0
        public void AutoAxis_EqualAxisOnScatter_UnitsPerPixelEqual()
        {
            double[] xs  = new double[] { 1, 5, 7, 19, 42 };
            double[] ys  = new double[] { 51, -5, 6, 12, 3 };
            var      plt = new ScottPlot.Plot();

            plt.AddScatter(xs, ys);
            plt.AxisScaleLock(true);
            plt.AxisAuto();

            var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt);
            Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001);
        }
Пример #4
0
        public void Zoom_EqualAxisOnScatter_UnitsPerPixelEqual(int dx, int dy)
        {
            double[] xs  = new double[] { 1, 5, 7, 19, 42 };
            double[] ys  = new double[] { 51, -5, 6, 12, 3 };
            var      plt = new ScottPlot.Plot();

            plt.AddScatter(xs, ys);
            plt.AxisScaleLock(true);
            plt.AxisAuto();

            plt.GetSettings(false).AxesZoomPx(dx, dy);

            var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt);
            Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001);
        }
Пример #5
0
        public void Resize_EqualAxisOnScatter_UnitsPerPixelEqual(int width, int height)
        {
            double[] xs  = new double[] { 1, 5, 7, 19, 42 };
            double[] ys  = new double[] { 51, -5, 6, 12, 3 };
            var      plt = new ScottPlot.Plot();

            plt.AddScatter(xs, ys);
            plt.AxisScaleLock(true);
            plt.AxisAuto();

            plt.Resize(width, height);

            var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt);

            Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * ScaleLockPrecision);
        }