public void AutoAxis_EqualAxis_UnitsPerPixelEqual() { var plt = new ScottPlot.Plot(); plt.PlotLine(0, 0, 5, 1); plt.AxisEqualScale(true); plt.AxisAuto(); var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt); Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001); }
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.PlotScatter(xs, ys); plt.AxisEqualScale(true); plt.AxisAuto(); var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt); Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001); }
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.PlotScatter(xs, ys); plt.AxisEqualScale(true); plt.AxisAuto(); var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt); Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001); }
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.PlotScatter(xs, ys); plt.AxisEqualScale(true); plt.AxisAuto(); plt.GetSettings(false).AxesZoomPx(dx, dy); var(xUnitsPerPixel, yUnitsPerPixel) = getUnitsPerPixel(plt); Assert.AreEqual(xUnitsPerPixel, yUnitsPerPixel, xUnitsPerPixel * 0.000001); }