{"id":89,"date":"2026-02-28T17:00:13","date_gmt":"2026-02-28T09:00:13","guid":{"rendered":"https:\/\/xlwings.net\/blog\/?p=89"},"modified":"2026-01-17T10:45:02","modified_gmt":"2026-01-17T10:45:02","slug":"how-to-implement-graphic-rotation-using-xlwings","status":"publish","type":"post","link":"https:\/\/xlwings.net\/blog\/how-to-implement-graphic-rotation-using-xlwings\/","title":{"rendered":"How To Implement Graphic Rotation Using xlwings?"},"content":{"rendered":"<h2>Method<\/h2>\n<p>Use the `IncrementRotation` method of the `Shape` object to rotate the graphic. This method rotates the graphic around the Z-axis by a specified angle. It has one parameter, representing the angle of rotation in degrees. A positive value rotates the graphic clockwise, while a negative value rotates the graphic counterclockwise.<\/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.IncrementRotation(30)\u00a0\u00a0\u00a0 #Rotate clockwise by 30\u00b0\u00b0<\/p>\n<h2>Sample Code<\/h2>\n\n\n<pre class=\"wp-block-code\"><code>#Scaling 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(9, 100, 50, 200, 100)    #Elliptical area\nff=shp.Fill\nff.PresetTextured(12)    #Preset texture: Granite\nshp.ScaleWidth(0.75,False)    #Width \u00d7 0.75\nshp.ScaleHeight(1.75,False)    #Height \u00d7 1.75\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=\"766\" height=\"482\" src=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-17.png\" alt=\"Implement Graphic Rotation Using xlwings\" class=\"wp-image-455\" srcset=\"https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-17.png 766w, https:\/\/xlwings.net\/blog\/wp-content\/uploads\/2026\/02\/image-17-300x189.png 300w\" sizes=\"auto, (max-width: 766px) 100vw, 766px\" \/><\/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-89","post","type-post","status-publish","format-standard","hentry","category-xlwings-shape"],"_links":{"self":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/89","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=89"}],"version-history":[{"count":2,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions"}],"predecessor-version":[{"id":456,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/posts\/89\/revisions\/456"}],"wp:attachment":[{"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/categories?post=89"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xlwings.net\/blog\/wp-json\/wp\/v2\/tags?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}