Example #1
0
        public void Test_AxisLine_LineWidth()
        {
            var plt = new ScottPlot.Plot();

            plt.AntiAlias(false, false, false);

            // start with default settings
            var axLine = new PlottableHLine()
            {
                position = 1.23
            };

            plt.Add(axLine);
            var bmp1 = new System.Drawing.Bitmap(plt.GetBitmap(renderFirst: true));

            // change the plottable
            axLine.lineWidth += 1;
            var bmp2 = new System.Drawing.Bitmap(plt.GetBitmap(renderFirst: true));

            // measure what changed
            //TestTools.SaveFig(bmp1, "1");
            //TestTools.SaveFig(bmp2, "2");
            var before = new MeanPixel(bmp1);
            var after  = new MeanPixel(bmp2);

            Console.WriteLine($"Before: {before}");
            Console.WriteLine($"After: {after}");

            Assert.That(after.IsDarkerThan(before));
        }
Example #2
0
        public MouseTracker()
        {
            InitializeComponent();
            formsPlot1.plt.PlotSignal(DataGen.RandomWalk(null, 100));

            vLine = formsPlot1.plt.PlotVLine(0, color: Color.Red, lineStyle: LineStyle.Dash);
            hLine = formsPlot1.plt.PlotHLine(0, color: Color.Red, lineStyle: LineStyle.Dash);

            formsPlot1.Render();
        }
 private void enableOnce_SetCMark()
 {
     if (isOnceC == false)
     {
         set_CLine          = C_Graph.plt.PlotHLine(setCurrent, System.Drawing.Color.LightBlue, lineStyle: LineStyle.Dash);
         set_CLine.position = setCurrent;
         set_CLine.visible  = false;
         isOnceC            = true;
     }
 }
Example #4
0
 private void enableOnce_SetVMark()
 {
     if (isOnceV == false)
     {
         set_VLine          = V_Graph.plt.PlotHLine(setVoltage, System.Drawing.Color.LightBlue, lineStyle: LineStyle.Dash);
         set_VLine.position = setVoltage;
         set_VLine.visible  = false;
         isOnceV            = true;
     }
 }
Example #5
0
        public MouseTracker()
        {
            this.InitializeComponent();
#if DEBUG
            this.AttachDevTools();
#endif

            avaPlot1 = this.Find <AvaPlot>("avaPlot1");

            avaPlot1.plt.PlotSignal(DataGen.RandomWalk(null, 100));
            vLine = avaPlot1.plt.PlotVLine(0, color: System.Drawing.Color.Red, lineStyle: LineStyle.Dash);
            hLine = avaPlot1.plt.PlotHLine(0, color: System.Drawing.Color.Red, lineStyle: LineStyle.Dash);
            avaPlot1.Render();

            avaPlot1.PointerMoved += OnMouseMove;
        }
Example #6
0
 private void Mouse_Tracker_Click(object sender, RoutedEventArgs e)
 {
     MouseTrack = !MouseTrack;
     if (MouseTrack == true)
     {
         Mouse_VLine = Graph.plt.PlotVLine(0, color: System.Drawing.Color.Red, lineStyle: LineStyle.DashDot);
         Mouse_HLine = Graph.plt.PlotHLine(0, color: System.Drawing.Color.Red, lineStyle: LineStyle.DashDot);
         Coord_text  = Graph.plt.PlotText("", 0, 0, color: System.Drawing.Color.Red, fontSize: 18, alignment: ScottPlot.TextAlignment.lowerLeft);
     }
     else
     {
         Graph.plt.Clear(Mouse_VLine);
         Graph.plt.Clear(Mouse_HLine);
         Graph.plt.Clear(Coord_text);
         if (AutoAxis == true)
         {
             Graph.plt.AxisAuto();
         }
         Graph.Render(skipIfCurrentlyRendering: true);
     }
 }
Example #7
0
        public void Test_AxisLine_ChangesPosition()
        {
            var plt = new ScottPlot.Plot();

            plt.AntiAlias(false, false, false);

            // start with default settings
            var axLine = new PlottableHLine()
            {
                position = 1.23
            };

            plt.Add(axLine);
            var bmp1 = new System.Drawing.Bitmap(plt.GetBitmap(renderFirst: true));

            // change the plottable
            axLine.position += 1;
            var bmp2 = new System.Drawing.Bitmap(plt.GetBitmap(renderFirst: true));

            // measure what changed
            //TestTools.SaveFig(bmp1, "1");
            //TestTools.SaveFig(bmp2, "2");
            Assert.AreNotEqual(ScottPlot.Tools.BitmapHash(bmp1), ScottPlot.Tools.BitmapHash(bmp2));
        }