{"id":1186,"date":"2023-07-27T08:57:53","date_gmt":"2023-07-27T08:57:53","guid":{"rendered":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/"},"modified":"2023-07-27T08:57:53","modified_gmt":"2023-07-27T08:57:53","slug":"cirkel-matplotlib","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/","title":{"rendered":"Cirkels plotten in matplotlib (met voorbeelden)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt snel cirkels toevoegen aan een plot in Matplotlib met behulp van de functie <a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.patches.Circle.html\" target=\"_blank\" rel=\"noopener\">Circle()<\/a> , die de volgende syntaxis gebruikt:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>matplotlib.patches.Circle(xy, straal=5)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>xy:<\/strong> de co\u00f6rdinaten (x, y) van de cirkel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>straal:<\/strong> De straal van de cirkel. De standaardwaarde is 5.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Deze tutorial toont verschillende voorbeelden van praktisch gebruik van deze functie:<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 1: Maak \u00e9\u00e9n cirkel<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u een enkele cirkel maakt op een Matplotlib-plot op de co\u00f6rdinaten (x,y)(10,10):<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #107d3f;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#set axis limits of plot (x=0 to 20, y=0 to 20)\n<\/span>plt. <span style=\"color: #3366ff;\">axis<\/span> ([0, 20, 0, 20])\n\n<span style=\"color: #008080;\">#create circle with (x, y) coordinates at (10, 10)\n<\/span>c=plt. <span style=\"color: #3366ff;\">Circle<\/span> ((10, 10))\n\n<span style=\"color: #008080;\">#add circle to plot (gca means \"get current axis\")\n<\/span>plt. <span style=\"color: #3366ff;\">gca<\/span> (). <span style=\"color: #3366ff;\">add_artist<\/span> (c)\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11794 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cercle1.png\" alt=\"Cirkel in matplotlib\" width=\"412\" height=\"268\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Standaard geeft een as van een Matplotlib-plot doorgaans meer pixels per gegevenseenheid weer. Om een cirkel als een cirkel te laten verschijnen in plaats van als een ellips, moet je het argument <strong>plt.axis(\u201cequal\u201d)<\/strong> als volgt gebruiken:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #107d3f;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#set axis limits of plot (x=0 to 20, y=0 to 20)\n<\/span>plt. <span style=\"color: #3366ff;\">axis<\/span> ([0, 20, 0, 20])\nplt. <span style=\"color: #3366ff;\">axis<\/span> (\" <span style=\"color: #008000;\">equal<\/span> \")\n\n<span style=\"color: #008080;\">#create circle with (x, y) coordinates at (10, 10)\n<\/span>c=plt. <span style=\"color: #3366ff;\">Circle<\/span> ((10, 10))\n\n<span style=\"color: #008080;\">#add circle to plot (gca means \"get current axis\")\n<\/span>plt. <span style=\"color: #3366ff;\">gca<\/span> (). <span style=\"color: #3366ff;\">add_artist<\/span> (c)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11795 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cercle2.png\" alt=\"matplotlib-cirkel\" width=\"387\" height=\"266\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 2: Maak<\/strong><\/span> <span style=\"color: #000000;\"><strong>meerdere kringen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u meerdere cirkels kunt maken op een Matplotlib-plot:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #107d3f;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#set axis limits of plot (x=0 to 20, y=0 to 20)\n<\/span>plt. <span style=\"color: #3366ff;\">axis<\/span> ([0, 20, 0, 20])\nplt. <span style=\"color: #3366ff;\">axis<\/span> (\" <span style=\"color: #008000;\">equal<\/span> \")\n\n<span style=\"color: #008080;\">#define circles\n<\/span>c1=plt. <span style=\"color: #3366ff;\">Circle<\/span> ((5, 5), radius= <span style=\"color: #008000;\">1<\/span> )\nc2=plt. <span style=\"color: #3366ff;\">Circle<\/span> ((10, 10), radius= <span style=\"color: #008000;\">2<\/span> )\nc3=plt. <span style=\"color: #3366ff;\">Circle<\/span> ((15, 13), radius= <span style=\"color: #008000;\">3<\/span> )\n\n<span style=\"color: #008080;\">#add circles to plot\n<\/span>plt. <span style=\"color: #3366ff;\">gca<\/span> (). <span style=\"color: #3366ff;\">add_artist<\/span> (c1)\nplt. <span style=\"color: #3366ff;\">gca<\/span> (). <span style=\"color: #3366ff;\">add_artist<\/span> (c2)\nplt. <span style=\"color: #3366ff;\">gca<\/span> (). <span style=\"color: #3366ff;\">add_artist<\/span> (c3)\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11796 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cercle3.png\" alt=\"Meerdere cirkels in Matplotlib\" width=\"392\" height=\"263\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 3: Verander het uiterlijk van de cirkel<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">U kunt de volgende argumenten gebruiken om het uiterlijk van een cirkel in Matplotlib te wijzigen:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>straal:<\/strong> specificeer de straal van de cirkel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>kleur:<\/strong> specificeer de kleur van de cirkel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>alpha:<\/strong> specificeer de transparantie van de cirkel<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">De volgende code toont een voorbeeld van hoe u meerdere van deze argumenten tegelijk kunt gebruiken:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #107d3f;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#set axis limits of plot (x=0 to 20, y=0 to 20)\n<\/span>plt. <span style=\"color: #3366ff;\">axis<\/span> ([0, 20, 0, 20])\nplt. <span style=\"color: #3366ff;\">axis<\/span> (\" <span style=\"color: #008000;\">equal<\/span> \")\n\n<span style=\"color: #008080;\">#create circle with (x, y) coordinates at (10, 10)\n<\/span>c=plt. <span style=\"color: #3366ff;\">Circle<\/span> ((10, 10), radius= <span style=\"color: #008000;\">2<\/span> , color=' <span style=\"color: #008000;\">red<\/span> ', alpha= <span style=\"color: #008000;\">.3<\/span> )\n\n<span style=\"color: #008080;\">#add circle to plot (gca means \"get current axis\")\n<\/span>plt. <span style=\"color: #3366ff;\">gca<\/span> (). <span style=\"color: #3366ff;\">add_artist<\/span> (c)<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11798 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cercle4.png\" alt=\"Cirkel met alpha in Matplotlib\" width=\"403\" height=\"269\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Houd er rekening mee dat u ook aangepaste hexadecimale kleurcodes kunt gebruiken om de kleur van de cirkels op te geven.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt snel cirkels toevoegen aan een plot in Matplotlib met behulp van de functie Circle() , die de volgende syntaxis gebruikt: matplotlib.patches.Circle(xy, straal=5) Goud: xy: de co\u00f6rdinaten (x, y) van de cirkel straal: De straal van de cirkel. De standaardwaarde is 5. Deze tutorial toont verschillende voorbeelden van praktisch gebruik van deze functie: Voorbeeld [&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":[],"class_list":["post-1186","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Cirkels plotten in Matplotlib (met voorbeelden) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u cirkels kunt plotten in Matplotlib, met verschillende voorbeelden.\" \/>\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\/nl\/cirkel-matplotlib\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Cirkels plotten in Matplotlib (met voorbeelden) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u cirkels kunt plotten in Matplotlib, met verschillende voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T08:57:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cercle1.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\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/\",\"url\":\"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/\",\"name\":\"Cirkels plotten in Matplotlib (met voorbeelden) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-27T08:57:53+00:00\",\"dateModified\":\"2023-07-27T08:57:53+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u cirkels kunt plotten in Matplotlib, met verschillende voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Cirkels plotten in matplotlib (met voorbeelden)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Cirkels plotten in Matplotlib (met voorbeelden) - Statorials","description":"In deze tutorial wordt uitgelegd hoe u cirkels kunt plotten in Matplotlib, met verschillende voorbeelden.","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\/nl\/cirkel-matplotlib\/","og_locale":"de_DE","og_type":"article","og_title":"Cirkels plotten in Matplotlib (met voorbeelden) - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u cirkels kunt plotten in Matplotlib, met verschillende voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/","og_site_name":"Statorials","article_published_time":"2023-07-27T08:57:53+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/cercle1.png"}],"author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"2\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/","url":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/","name":"Cirkels plotten in Matplotlib (met voorbeelden) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-27T08:57:53+00:00","dateModified":"2023-07-27T08:57:53+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u cirkels kunt plotten in Matplotlib, met verschillende voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/cirkel-matplotlib\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/cirkel-matplotlib\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Cirkels plotten in matplotlib (met voorbeelden)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1186","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=1186"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1186\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1186"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1186"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1186"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}