Draw a series of connected lines on the current rendering target.

        Args:
            *points (Point): The points along the lines.

        Raises:
            SDLError: If an error is encountered.
967813
def draw_lines(self, *points):
        
        point_array = ffi.new('SDL_Point[]', len(points))
        for i, p in enumerate(points):
            point_array[i] = p._ptr[0]
        check_int_err(lib.SDL_RenderDrawLines(self._ptr, point_array, len(points)))
153776
def plot_points(points, show=True):
    
    import matplotlib.pyplot as plt
    from mpl_toolkits.mplot3d import Axes3D  # NOQA

    points = np.asanyarray(points, dtype=np.float64)

    if len(points.shape) != 2:
        raise ValueError('Points must be (n, 2|3)!')

    if points.shape[1] == 3:
        fig = plt.figure()
        ax = fig.add_subplot(111, projection='3d')
        ax.scatter(*points.T)
    elif points.shape[1] == 2:
        plt.scatter(*points.T)
    else:
        raise ValueError('points not 2D/3D: {}'.format(
            points.shape))

    if show:
        plt.show()
1351741
def line(coord, draw)
      line_xy(coord.x1, coord.y1, coord.x2, coord.y2, draw)
    end
943204
def draw_nodes(self):
        
        if self.backend == "matplotlib":
            node_r = 0.005  # temporarily hardcoded.
            for i, node in enumerate(self.nodes):
                x = self.node_coords["x"][i]
                y = self.node_coords["y"][i]
                color = self.node_colors[i]
                node_patch = patches.Ellipse(
                    (x, y), node_r, node_r, lw=0, color=color, zorder=2
                )
                self.ax.add_patch(node_patch)
        elif self.backend == "altair":
            self.node_chart = (
                alt.Chart(self.node_df)
                .mark_point()
                .encode(
                    alt.X(f"{self.node_lon}:Q", scale=alt.Scale(zero=False)),
                    alt.Y(f"{self.node_lat}:Q", scale=alt.Scale(zero=False)),
                )
            )
832860
public static void drawLine(Point p1, Point p2, PlotOperator plot)
    {
        drawLine(p1.x, p1.y, p2.x, p2.y, plot);
    }
1204627
def draw_marked_line(self, data, coordinates, linestyle, markerstyle,
                         label, mplobj=None):
        
        if linestyle is not None:
            self.draw_line(data, coordinates, linestyle, label, mplobj)
        if markerstyle is not None:
            self.draw_markers(data, coordinates, markerstyle, label, mplobj)
1167423
def drawHotspots(self, painter):
        
        # draw hotspots
        for hotspot in (self._hotspots + self._dropzones):
            hstyle = hotspot.style()
            if hstyle == XNode.HotspotStyle.Invisible:
                continue
            
            hotspot.render(painter, self)
672990
def _draw_lines(self, bg, colour, extent, line, xo, yo):
        """"""
        coords = [self._scale_coords(x, y, extent, xo, yo) for x, y in line]
        self._draw_lines_internal(coords, colour, bg)
202320
public void setLine(double... points) {
        path = new GeneralPath();
        path.moveTo((float) points[0], (float) points[1]);
        segments = new Shape[points.length / 2 - 1];

        for (int i = 2; i < points.length;) {
            switch (points.length - i) {
            case 2:
                lastPart = new Line2D.Float((float) path.getCurrentPoint().getX(), (float) path
                        .getCurrentPoint().getY(), (float) points[i], (float) points[i + 1]);
                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                i += 2;
                break;
            case 4:
                lastPart = new QuadCurve2D.Float((float) path.getCurrentPoint().getX(),
                        (float) path.getCurrentPoint().getY(), (float) points[i],
                        (float) points[i + 1], (float) points[i + 2], (float) points[i + 3]);
                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                segments[i / 2] = lastPart;
                i += 4;
                break;
            case 6:
                lastPart = new CubicCurve2D.Double(path.getCurrentPoint().getX(), path
                        .getCurrentPoint().getY(), points[i], points[i + 1], points[i + 2],
                        points[i + 3], points[i + 4], points[i + 5]);
                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                segments[i / 2] = lastPart;
                segments[i / 2 + 1] = lastPart;
                i += 6;
                break;
            default: // use two points and add one extra between 2nd and 3rd
                float x = (float) (points[i + 2] + points[i + 4]) / 2F;
                float y = (float) (points[i + 3] + points[i + 5]) / 2F;

                lastPart = new CubicCurve2D.Double(path.getCurrentPoint().getX(), path
                        .getCurrentPoint().getY(), points[i], points[i + 1], points[i + 2],
                        points[i + 3], x, y);

                path.append(lastPart, true);
                segments[i / 2 - 1] = lastPart;
                segments[i / 2] = lastPart;

                i += 4;
            }
        }
    }
691836
def draw_rect(self, rect):
        
        check_int_err(lib.SDL_RenderDrawRect(self._ptr, rect._ptr))
154241
def drawPoints(points, bg=','):
    """"""

    # Note: I set bg to ',' instead of '.' because using ... in the docstrings
    # confuses doctest and makes it think it's Python's secondary ... prompt,
    # causing doctest errors.
    import sys
    points = list(points)
    try:
        points = [(int(x), int(y)) for x, y in points]
    except:
        raise PyBresenhamException('points must only contains (x, y) numeric tuples')

    # Calculate size of the character grid from the given points.
    minx = min([x for x, y in points])
    maxx = max([x for x, y in points])
    miny = min([y for x, y in points])
    maxy = max([y for x, y in points])

    charGrid = [[' '] * (maxy - miny + 1) for i in range(maxx - minx + 1)]

    # Draw O characters to the grid at the given points.
    for x, y in points:
        charGrid[x - minx][y - miny] = 'O'

    # Print out the character grid.
    for y in range(len(charGrid[0])):
        for x in range(len(charGrid)):
            if charGrid[x][y] in (None, ' '):
                charToDraw = bg
            else:
                charToDraw = charGrid[x][y]
            sys.stdout.write(charToDraw)
        print()
699593
def drawLine(self, p1, p2):
        
        p1 = Point(p1)
        p2 = Point(p2)
        if not (self.lastPoint == p1):
            self.draw_cont += "%g %g m\n" % JM_TUPLE(p1 * self.ipctm)
            self.lastPoint = p1
            self.updateRect(p1)

        self.draw_cont += "%g %g l\n" % JM_TUPLE(p2 * self.ipctm)
        self.updateRect(p2)
        self.lastPoint = p2
        return self.lastPoint
321876
def drawPoint(self, x, y, silent=True):
		
		start = time.time()

		#Downsample the coordinates
		x = int(x/config.DOWNSAMPLING)
		y = int(y/config.DOWNSAMPLING)

		#Apply the dab with or without source caching
		if self.brush.usesSourceCaching:
			applyMirroredDab_jit(self.mirrorMode, self.image.getActiveLayer().data, int(x-self.brush.brushSize*0.5), int(y-self.brush.brushSize*0.5), self.brush.coloredBrushSource.copy(), config.CANVAS_SIZE, self.brush.brushMask)
		else:
			self.brush.makeDab(self.image.getActiveLayer(), int(x), int(y), self.color, self.secondColor, mirror=self.mirrorMode)
		config.AVGTIME.append(time.time()-start)
216605
def drawpoint(self, x, y, colour = None):
        
        self.checkforpilimage()
        colour = self.defaultcolour(colour)
        self.changecolourmode(colour)
        self.makedraw()
        
        (pilx, pily) = self.pilcoords((x,y))
        
        self.draw.point((pilx, pily), fill = colour)
314909
function drawNonMono(
    ctx, points, start, segLen, allLen,
    dir, smoothMin, smoothMax, smooth, smoothMonotone, connectNulls
) {
    var prevIdx = 0;
    var idx = start;
    for (var k = 0; k < segLen; k++) {
        var p = points[idx];
        if (idx >= allLen || idx < 0) {
            break;
        }
        if (isPointNull(p)) {
            if (connectNulls) {
                idx += dir;
                continue;
            }
            break;
        }

        if (idx === start) {
            ctx[dir > 0 ? 'moveTo' : 'lineTo'](p[0], p[1]);
            v2Copy(cp0, p);
        }
        else {
            if (smooth > 0) {
                var nextIdx = idx + dir;
                var nextP = points[nextIdx];
                if (connectNulls) {
                    // Find next point not null
                    while (nextP && isPointNull(points[nextIdx])) {
                        nextIdx += dir;
                        nextP = points[nextIdx];
                    }
                }

                var ratioNextSeg = 0.5;
                var prevP = points[prevIdx];
                var nextP = points[nextIdx];
                // Last point
                if (!nextP || isPointNull(nextP)) {
                    v2Copy(cp1, p);
                }
                else {
                    // If next data is null in not connect case
                    if (isPointNull(nextP) && !connectNulls) {
                        nextP = p;
                    }

                    vec2.sub(v, nextP, prevP);

                    var lenPrevSeg;
                    var lenNextSeg;
                    if (smoothMonotone === 'x' || smoothMonotone === 'y') {
                        var dim = smoothMonotone === 'x' ? 0 : 1;
                        lenPrevSeg = Math.abs(p[dim] - prevP[dim]);
                        lenNextSeg = Math.abs(p[dim] - nextP[dim]);
                    }
                    else {
                        lenPrevSeg = vec2.dist(p, prevP);
                        lenNextSeg = vec2.dist(p, nextP);
                    }

                    // Use ratio of seg length
                    ratioNextSeg = lenNextSeg / (lenNextSeg + lenPrevSeg);

                    scaleAndAdd(cp1, p, v, -smooth * (1 - ratioNextSeg));
                }
                // Smooth constraint
                vec2Min(cp0, cp0, smoothMax);
                vec2Max(cp0, cp0, smoothMin);
                vec2Min(cp1, cp1, smoothMax);
                vec2Max(cp1, cp1, smoothMin);

                ctx.bezierCurveTo(
                    cp0[0], cp0[1],
                    cp1[0], cp1[1],
                    p[0], p[1]
                );
                // cp0 of next segment
                scaleAndAdd(cp0, p, v, smooth * ratioNextSeg);
            }
            else {
                ctx.lineTo(p[0], p[1]);
            }
        }

        prevIdx = idx;
        idx += dir;
    }

    return k;
}
217432
def multipoint(self, points):
        """"""
        shapeType = MULTIPOINT
        points = [points] # nest the points inside a list to be compatible with the generic shapeparts method
        self._shapeparts(parts=points, shapeType=shapeType)
1366520
def _geom_points(geom):
    
    if geom['type'] == 'Point':
        yield tuple(geom['coordinates'])
    elif geom['type'] in ('MultiPoint', 'LineString'):
        for position in geom['coordinates']:
            yield tuple(position)
    else:
        raise InvalidFeatureError(
            "Unsupported geometry type:{0}".format(geom['type']))