NPlot.Grid.Draw C# (CSharp) Method

Draw() public method

Draws the grid
public Draw ( Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis ) : void
g Graphics The graphics surface on which to draw
xAxis PhysicalAxis The physical x axis to draw horizontal lines parallel to.
yAxis PhysicalAxis The physical y axis to draw vertical lines parallel to.
return void
        public void Draw(Graphics g, PhysicalAxis xAxis, PhysicalAxis yAxis)
        {
            List<double> xLargePositions = null;
            List<double> yLargePositions = null;
            List<double> xSmallPositions = null;
            List<double> ySmallPositions = null;

            if (this.horizontalGridType_ != GridType.None)
            {
                xAxis.Axis.WorldTickPositions_FirstPass(xAxis.PhysicalMin, xAxis.PhysicalMax, out xLargePositions, out xSmallPositions);
                DrawGridLines(g, xAxis, yAxis, xLargePositions, true, this.MajorGridPen);
            }

            if (this.verticalGridType_ != GridType.None)
            {
                yAxis.Axis.WorldTickPositions_FirstPass(yAxis.PhysicalMin, yAxis.PhysicalMax, out yLargePositions, out ySmallPositions);
                DrawGridLines(g, yAxis, xAxis, yLargePositions, false, this.MajorGridPen);
            }


            if (this.horizontalGridType_ == GridType.Fine)
            {
                xAxis.Axis.WorldTickPositions_SecondPass(xAxis.PhysicalMin, xAxis.PhysicalMax, xLargePositions, ref xSmallPositions);
                DrawGridLines(g, xAxis, yAxis, xSmallPositions, true, this.MinorGridPen);
            }

            if (this.verticalGridType_ == GridType.Fine)
            {
                yAxis.Axis.WorldTickPositions_SecondPass(yAxis.PhysicalMin, yAxis.PhysicalMax, yLargePositions, ref ySmallPositions);
                DrawGridLines(g, yAxis, xAxis, ySmallPositions, false, this.MinorGridPen);
            }
        }
    }