Skip to content
Related Articles

Related Articles

Improve Article
Wand path_move() function in Python
  • Last Updated : 10 May, 2020

path_move() is another function introduced in wand for paths. The main aim of path_move() function is to set new starting point for a new sub_path. Given to parameter can be relative, or absolute, by setting the relative flag.

Syntax :

wand.drawing.path_move(to, relative)

Parameters:

ParameterInput TypeDescription
tosequence or (numbers.Real, numbers.Real)pair which represents coordinates to drawn to.
relativebooltreat given coordinates as relative to current point.

Example #1:




from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
  
with Drawing() as draw:
    draw.stroke_width = 2
    draw.stroke_color = Color('black')
    draw.fill_color = Color('white')
    draw.path_start()
    # set starting point for first sub-path
    draw.path_move(to =(10, 10))
    # Drawing vertical line from start
    draw.path_vertical_line(100,
                            relative = True)
    # set starting point for second sub-path
    draw.path_move(to =(190, 10))
    # Drawing vertical line from start
    draw.path_vertical_line(100,
                            relative = True)
    draw.path_finish()
    with Image(width = 200, height = 200, background = Color('lightgreen')) as image:
        draw(image)
        image.save(filename ="pathmove.png")

Output :

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning – Basic Level Course

My Personal Notes arrow_drop_up
Recommended Articles
Page :