{"id":1188,"date":"2023-07-27T08:38:01","date_gmt":"2023-07-27T08:38:01","guid":{"rendered":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/"},"modified":"2023-07-27T08:38:01","modified_gmt":"2023-07-27T08:38:01","slug":"matplotlib-pfeil","status":"publish","type":"post","link":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/","title":{"rendered":"So zeichnen sie pfeile in matplotlib"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Um Pfeile in Matplotlib zu zeichnen, k\u00f6nnen Sie die<\/span> Funktion <a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.arrow.html\" target=\"_blank\" rel=\"noopener noreferrer\">matplotlib.pyplot.arrow<\/a> verwenden <span style=\"color: #000000;\">, die die folgende Syntax verwendet:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>matplotlib.pyplot.arrow(x, y, dx, dy)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Gold:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>x, y:<\/strong> die x- und y-Koordinaten der Pfeilbasis<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>dx, dy:<\/strong> die L\u00e4nge des Pfeils in x- und y-Richtung<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Dieses Tutorial bietet mehrere Beispiele f\u00fcr die praktische Verwendung dieser Funktion.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel 1: Zeichnen Sie einen einzelnen Pfeil<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie man einen einzelnen Pfeil in einem Matplotlib-Plot zeichnet:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#define two arrays for plotting\n<\/span>A = [3, 5, 5, 6, 7, 8]\nB = [12, 14, 17, 20, 22, 27]\n\n<span style=\"color: #008080;\">#create scatterplot, specifying marker size to be 40\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (A, B, s= <span style=\"color: #008000;\">40<\/span> )\n\n<span style=\"color: #008080;\">#add arrow to plot\n<\/span>plt. <span style=\"color: #3366ff;\">arrow<\/span> (x= <span style=\"color: #008000;\">4<\/span> , y= <span style=\"color: #008000;\">18<\/span> , dx= <span style=\"color: #008000;\">2<\/span> , dy= <span style=\"color: #008000;\">5<\/span> , width= <span style=\"color: #008000;\">.08<\/span> ) \n  \n<span style=\"color: #008080;\">#displayplot \n<\/span>plt. <span style=\"color: #3366ff;\">show<\/span> ()\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11827 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/fleche1.png\" alt=\"Pfeil im Matplotlib-Plot\" width=\"409\" height=\"274\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Beachten Sie, dass wir <strong>dx=0<\/strong> festlegen k\u00f6nnen, um einen vertikalen Pfeil zu erstellen, und <strong>dy=0,<\/strong> um einen horizontalen Pfeil zu erstellen.<\/span><\/p>\n<p> <span style=\"color: #000000;\">So erstellen Sie beispielsweise einen vertikalen Pfeil:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#define two arrays for plotting\n<\/span>A = [3, 5, 5, 6, 7, 8]\nB = [12, 14, 17, 20, 22, 27]\n\n<span style=\"color: #008080;\">#create scatterplot, specifying marker size to be 40\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (A, B, s= <span style=\"color: #008000;\">40<\/span> )\n\n<span style=\"color: #008080;\">#add arrow to plot\n<\/span>plt. <span style=\"color: #3366ff;\">arrow<\/span> (x= <span style=\"color: #008000;\">4<\/span> , y= <span style=\"color: #008000;\">18<\/span> , dx= <span style=\"color: #008000;\">0<\/span> , dy= <span style=\"color: #008000;\">5<\/span> , width= <span style=\"color: #008000;\">.08<\/span> ) \n  \n<span style=\"color: #008080;\">#displayplot \n<\/span>plt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11828 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/fleche2.png\" alt=\"Vertikaler Pfeil in Matplotlib\" width=\"407\" height=\"263\" srcset=\"\" sizes=\"\"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel 2: Einen Pfeil gestalten<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Standardm\u00e4\u00dfig ist ein Pfeil in Matplotlib blau mit schwarzen Kanten, aber wir k\u00f6nnen dies leicht mit den Argumenten <strong>facecolor<\/strong> und <strong>edgecolor<\/strong> \u00e4ndern:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#define two arrays for plotting\n<\/span>A = [3, 5, 5, 6, 7, 8]\nB = [12, 14, 17, 20, 22, 27]\n\n<span style=\"color: #008080;\">#create scatterplot, specifying marker size to be 40\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (A, B, s= <span style=\"color: #008000;\">40<\/span> )\n\n<span style=\"color: #008080;\">#add arrow to plot\n<\/span>plt. <span style=\"color: #3366ff;\">arrow<\/span> (x= <span style=\"color: #008000;\">4<\/span> , y= <span style=\"color: #008000;\">18<\/span> , dx= <span style=\"color: #008000;\">0<\/span> , dy= <span style=\"color: #008000;\">5<\/span> , width= <span style=\"color: #008000;\">.08 <span style=\"color: #000000;\">, facecolor=<\/span> 'red' <span style=\"color: #000000;\">, edgecolor=<\/span> 'none'<\/span> ) \n  \n<span style=\"color: #008080;\">#displayplot \n<\/span>plt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11829 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/fleche3.png\" alt=\"Pfeil mit benutzerdefinierter Farbe in Matplotlib\" width=\"409\" height=\"276\" srcset=\"\" sizes=\"\"><\/p>\n<p> <span style=\"color: #000000;\">Eine vollst\u00e4ndige Liste der Stileigenschaften, die auf Pfeile angewendet werden k\u00f6nnen, finden Sie <a href=\"https:\/\/matplotlib.org\/api\/_as_gen\/matplotlib.pyplot.arrow.html\" target=\"_blank\" rel=\"noopener noreferrer\">hier<\/a> .<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Beispiel 3: Anmerkungen zu Pfeilen hinzuf\u00fcgen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Der folgende Code zeigt, wie man eine Anmerkung unter einem Pfeil in einem Matplotlib-Diagramm hinzuf\u00fcgt:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#define two arrays for plotting\n<\/span>A = [3, 5, 5, 6, 7, 8]\nB = [12, 14, 17, 20, 22, 27]\n\n<span style=\"color: #008080;\">#create scatterplot, specifying marker size to be 40\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (A, B, s= <span style=\"color: #008000;\">40<\/span> )\n\n<span style=\"color: #008080;\">#add arrow to plot\n<\/span>plt. <span style=\"color: #3366ff;\">arrow<\/span> (x= <span style=\"color: #008000;\">4<\/span> , y= <span style=\"color: #008000;\">18<\/span> , dx= <span style=\"color: #008000;\">0<\/span> , dy= <span style=\"color: #008000;\">5<\/span> , width= <span style=\"color: #008000;\">.08<\/span> ) \n\n<span style=\"color: #008080;\">#add annotation\n<\/span>plt. <span style=\"color: #3366ff;\">annotate<\/span> (' <span style=\"color: #008000;\">General direction<\/span> ', xy = (3.4, 17))\n  \n<span style=\"color: #008080;\">#displayplot \n<\/span>plt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11830 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/fleche4.png\" alt=\"Pfeil mit Anmerkung in Matplotlib\" width=\"395\" height=\"263\" srcset=\"\" sizes=\"\"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Zus\u00e4tzliche Ressourcen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/de\/kreis-matplotlib\/\" target=\"_blank\" rel=\"noopener noreferrer\">So zeichnen Sie Kreise in Matplotlib (mit Beispielen)<\/a><br \/> <a href=\"https:\/\/statorials.org\/de\/rechteck-matplotlib\/\" target=\"_blank\" rel=\"noopener noreferrer\">So zeichnen Sie Rechtecke in Matplotlib (mit Beispielen)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Um Pfeile in Matplotlib zu zeichnen, k\u00f6nnen Sie die Funktion matplotlib.pyplot.arrow verwenden , die die folgende Syntax verwendet: matplotlib.pyplot.arrow(x, y, dx, dy) Gold: x, y: die x- und y-Koordinaten der Pfeilbasis dx, dy: die L\u00e4nge des Pfeils in x- und y-Richtung Dieses Tutorial bietet mehrere Beispiele f\u00fcr die praktische Verwendung dieser Funktion. Beispiel 1: Zeichnen [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>So zeichnen Sie Pfeile in Matplotlib \u2013 Statorials<\/title>\n<meta name=\"description\" content=\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie Pfeile in Matplotlib-Plots gezeichnet werden.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"So zeichnen Sie Pfeile in Matplotlib \u2013 Statorials\" \/>\n<meta property=\"og:description\" content=\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie Pfeile in Matplotlib-Plots gezeichnet werden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T08:38:01+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/fleche1.png\" \/>\n<meta name=\"author\" content=\"Dr. Benjamin Anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr. Benjamin Anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/\",\"url\":\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/\",\"name\":\"So zeichnen Sie Pfeile in Matplotlib \u2013 Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/de\/#website\"},\"datePublished\":\"2023-07-27T08:38:01+00:00\",\"dateModified\":\"2023-07-27T08:38:01+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\"},\"description\":\"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie Pfeile in Matplotlib-Plots gezeichnet werden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/#breadcrumb\"},\"inLanguage\":\"de-DE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/de\/matplotlib-pfeil\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Heim\",\"item\":\"https:\/\/statorials.org\/de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"So zeichnen sie pfeile in matplotlib\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/de\/#website\",\"url\":\"https:\/\/statorials.org\/de\/\",\"name\":\"Statorials\",\"description\":\"Ihr Leitfaden f\u00fcr statistische Kompetenz !\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/de\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de-DE\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0\",\"name\":\"Dr. Benjamin Anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de-DE\",\"@id\":\"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr. Benjamin Anderson\"},\"description\":\"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen\",\"sameAs\":[\"https:\/\/statorials.org\/de\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"So zeichnen Sie Pfeile in Matplotlib \u2013 Statorials","description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie Pfeile in Matplotlib-Plots gezeichnet werden.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/","og_locale":"de_DE","og_type":"article","og_title":"So zeichnen Sie Pfeile in Matplotlib \u2013 Statorials","og_description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie Pfeile in Matplotlib-Plots gezeichnet werden.","og_url":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/","og_site_name":"Statorials","article_published_time":"2023-07-27T08:38:01+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/fleche1.png"}],"author":"Dr. Benjamin Anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr. Benjamin Anderson","Gesch\u00e4tzte Lesezeit":"2 Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/","url":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/","name":"So zeichnen Sie Pfeile in Matplotlib \u2013 Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/de\/#website"},"datePublished":"2023-07-27T08:38:01+00:00","dateModified":"2023-07-27T08:38:01+00:00","author":{"@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0"},"description":"In diesem Tutorial wird anhand mehrerer Beispiele erl\u00e4utert, wie Pfeile in Matplotlib-Plots gezeichnet werden.","breadcrumb":{"@id":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/#breadcrumb"},"inLanguage":"de-DE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/de\/matplotlib-pfeil\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/de\/matplotlib-pfeil\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Heim","item":"https:\/\/statorials.org\/de\/"},{"@type":"ListItem","position":2,"name":"So zeichnen sie pfeile in matplotlib"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/de\/#website","url":"https:\/\/statorials.org\/de\/","name":"Statorials","description":"Ihr Leitfaden f\u00fcr statistische Kompetenz !","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/de\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de-DE"},{"@type":"Person","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/ec75c4d6365f2708f8a0ad3a42121aa0","name":"Dr. Benjamin Anderson","image":{"@type":"ImageObject","inLanguage":"de-DE","@id":"https:\/\/statorials.org\/de\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/de\/wp-content\/uploads\/2023\/11\/Benjamin-Anderson-96x96.jpg","caption":"Dr. Benjamin Anderson"},"description":"Hallo, ich bin Benjamin, ein pensionierter Statistikprofessor, der sich zum engagierten Statorials-Lehrer entwickelt hat. Mit umfassender Erfahrung und Fachwissen auf dem Gebiet der Statistik bin ich bestrebt, mein Wissen zu teilen, um Studenten durch Statorials zu bef\u00e4higen. Mehr wissen","sameAs":["https:\/\/statorials.org\/de"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1188"}],"collection":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/comments?post=1188"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/posts\/1188\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/media?parent=1188"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/categories?post=1188"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/de\/wp-json\/wp\/v2\/tags?post=1188"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}