{"id":88,"date":"2026-02-28T11:45:14","date_gmt":"2026-02-28T03:45:14","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=88"},"modified":"2026-01-17T10:43:59","modified_gmt":"2026-01-17T10:43:59","slug":"how-to-implement-graphic-translation-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-implement-graphic-translation-using-xlwings\/","title":{"rendered":"How To Implement Graphic Translation Using xlwings?"},"content":{"rendered":"<h2>Method<\/h2>\n<p>Use the `IncrementLeft` method of the `Shape` object to translate the graphic horizontally. This method has one parameter: when the value is greater than 0, the graphic moves to the right; when the value is less than 0, the graphic moves to the left.<\/p>\n<p>\u00a0<\/p>\n<p>Use the `IncrementTop` method of the `Shape` object to translate the graphic vertically. This method has one parameter: when the value is greater than 0, the graphic moves down; when the value is less than 0, the graphic moves up.<\/p>\n<p>\u00a0<\/p>\n<p>shp=sht.api.Shapes.AddShape(1, 100, 50, 200, 100)\u00a0\u00a0\u00a0 #Rectangular area<\/p>\n<p>shp.Fill.PresetTextured(5)\u00a0\u00a0\u00a0 #Preset texture: Water drop<\/p>\n<p>shp.IncrementLeft(70)\u00a0\u00a0\u00a0 #Move right by 70 units<\/p>\n<p>shp.IncrementTop(50)\u00a0\u00a0\u00a0 #Move down by 50 units<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Rotation transformation\n\nimport xlwings as xw    #Import xlwings package\n\napp=xw.App()\nbk=app.books.active   #Get the active workbook\nsht=bk.sheets.active    #Get the active worksheet\n\nshp=sht.api.Shapes.AddShape(1, 100, 50, 200, 100)    #Rectangular area\nshp.Fill.PresetTextured(5)    #Preset texture: Water drop\nshp.IncrementRotation(30)    #Rotate clockwise by 30\u00b0\uf0b0\n\n#bk.save()\n#bk.close()\n#app.kill()<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"821\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-16.png\" alt=\"Implement Graphic Translation Using xlwings\" class=\"wp-image-453\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-16.png 821w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-16-300x176.png 300w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-16-768x451.png 768w\" sizes=\"auto, (max-width: 821px) 100vw, 821px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Method<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-88","post","type-post","status-publish","format-standard","hentry","category-xlwings-shape"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/88\/revisions"}],"predecessor-version":[{"id":454,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/88\/revisions\/454"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=88"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=88"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}