public void DemoLayout() { int CenterSubplotPointsCount = 1000; interactivePlot1.figure.Clear(); plotA = interactivePlot1.figure.Subplot(3, 2, 1); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Sin(20)); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Cos(20)); plotA.Title("plot A: shared X"); plotB = interactivePlot1.figure.Subplot(3, 2, 2); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(50), QuickPlot.Generate.Sin(50)); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(50), QuickPlot.Generate.Cos(50)); plotB.Title("plot B: shared Y"); plotC = interactivePlot1.figure.Subplot(3, 2, 3, colSpan: 2); double[] x = QuickPlot.Generate.Consecutative(CenterSubplotPointsCount); double[] y1 = QuickPlot.Generate.Random(CenterSubplotPointsCount, seed: 0); double[] y2 = QuickPlot.Generate.Random(CenterSubplotPointsCount, seed: 1); interactivePlot1.figure.plot.Scatter(x, y1); interactivePlot1.figure.plot.Scatter(x, y2); plotC.Title("plot C"); plotD = interactivePlot1.figure.Subplot(3, 2, 5); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Sin(20)); plotD.Title("plot D: shared X and Y"); plotE = interactivePlot1.figure.Subplot(3, 2, 6); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Cos(20)); plotE.Title("plot E: source axes"); }
private void UserControl_MouseDown(object sender, MouseButtonEventArgs e) { var position = e.GetPosition(this); System.Drawing.Point location = new System.Drawing.Point((int)(position.X * scaleFactor), (int)(position.Y * scaleFactor)); plotEngagedWithMouse = figure.PlotUnderMouse(scaledSize, location); if (plotEngagedWithMouse != null) { if (e.ChangedButton == MouseButton.Left) { Cursor = Cursors.SizeAll; plotEngagedWithMouse.MouseDown(location, left: true); } else if (e.ChangedButton == MouseButton.Right) { Cursor = Cursors.SizeAll; plotEngagedWithMouse.MouseDown(location, right: true); } else if (e.ChangedButton == MouseButton.Middle) { Cursor = Cursors.Cross; plotEngagedWithMouse.MouseDown(location, middle: true); } } CaptureMouse(); }
public void DemoLayout() { int CenterSubplotPointsCount = 1000; interactivePlot1.figure.Clear(); plotA = interactivePlot1.figure.Subplot(3, 2, 1); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Sin(20)); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Cos(20)); plotA.title.text = "plot A"; plotB = interactivePlot1.figure.Subplot(3, 2, 2); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(50), QuickPlot.Generate.Sin(50)); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(50), QuickPlot.Generate.Cos(50)); plotB.title.text = "plot B"; plotC = interactivePlot1.figure.Subplot(3, 2, 3, colSpan: 2); double[] x = QuickPlot.Generate.Consecutative(CenterSubplotPointsCount); double[] y1 = QuickPlot.Generate.Random(CenterSubplotPointsCount, seed: 0); double[] y2 = QuickPlot.Generate.Random(CenterSubplotPointsCount, seed: 1); interactivePlot1.figure.plot.Scatter(x, y1); interactivePlot1.figure.plot.Scatter(x, y2); plotC.title.text = "plot C"; plotD = interactivePlot1.figure.Subplot(3, 2, 5); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Sin(20)); plotD.title.text = "plot D"; plotE = interactivePlot1.figure.Subplot(3, 2, 6); interactivePlot1.figure.plot.Scatter(QuickPlot.Generate.Consecutative(20), QuickPlot.Generate.Cos(20)); plotE.title.text = "plot E"; }
private void pictureBox1_MouseUp(object sender, MouseEventArgs e) { if (plotEngagedWithMouse != null) { plotEngagedWithMouse.MouseUp(upLocation: e.Location); if (e.Button == MouseButtons.Middle) { plotEngagedWithMouse.AutoAxis(); Render(); } plotEngagedWithMouse = null; } }
private void UserControl_MouseUp(object sender, MouseButtonEventArgs e) { var position = e.GetPosition(this); System.Drawing.Point location = new System.Drawing.Point((int)(position.X * scaleFactor), (int)(position.Y * scaleFactor)); if (plotEngagedWithMouse != null) { plotEngagedWithMouse.MouseUp(upLocation: location); if (e.ChangedButton == MouseButton.Middle) { plotEngagedWithMouse.AutoAxis(); Render(); } plotEngagedWithMouse = null; } ReleaseMouseCapture(); }
private void pictureBox1_MouseDown(object sender, MouseEventArgs e) { plotEngagedWithMouse = figure.PlotUnderMouse(pictureBox1.Size, e.Location); if (plotEngagedWithMouse != null) { if (e.Button == MouseButtons.Left) { pictureBox1.Cursor = Cursors.SizeAll; plotEngagedWithMouse.MouseDown(e.Location, left: true); } else if (e.Button == MouseButtons.Right) { pictureBox1.Cursor = Cursors.NoMove2D; plotEngagedWithMouse.MouseDown(e.Location, right: true); } else if (e.Button == MouseButtons.Middle) { pictureBox1.Cursor = Cursors.Cross; plotEngagedWithMouse.MouseDown(e.Location, middle: true); } } }