{"id":1599,"date":"2023-07-25T17:15:30","date_gmt":"2023-07-25T17:15:30","guid":{"rendered":"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/"},"modified":"2023-07-25T17:15:30","modified_gmt":"2023-07-25T17:15:30","slug":"plot-normale-distributiepython","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/","title":{"rendered":"Hoe een normale verdeling in python te plotten: met voorbeelden"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Om een <a href=\"https:\/\/statorials.org\/nl\/de-normale-verdeling\/\" target=\"_blank\" rel=\"noopener\">normale verdeling<\/a> in Python te plotten, kun je de volgende syntaxis gebruiken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#x-axis ranges from -3 and 3 with .001 steps\n<\/span>x = np. <span style=\"color: #3366ff;\">arange<\/span> (-3, 3, 0.001)\n\n<span style=\"color: #008080;\">#plot normal distribution with mean 0 and standard deviation 1\n<\/span>plt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1))\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De <strong>x-<\/strong> array definieert het bereik van de x-as en <strong>plt.plot()<\/strong> produceert de curve van de normale verdeling met het opgegeven gemiddelde en de standaarddeviatie.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende voorbeelden laten zien hoe u deze functies in de praktijk kunt gebruiken.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 1: Een enkele normale verdeling uitzetten<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe je een enkele normale verdelingscurve tekent met een gemiddelde van 0 en een standaarddeviatie van 1:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n<span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n<span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> norm\n\n<span style=\"color: #008080;\">#x-axis ranges from -3 and 3 with .001 steps\n<\/span>x = np. <span style=\"color: #3366ff;\">arange<\/span> (-3, 3, 0.001)\n\n<span style=\"color: #008080;\">#plot normal distribution with mean 0 and standard deviation 1\n<\/span>plt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1))<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-15893\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistpython1.png\" alt=\"Normale verdeling in Python\" width=\"388\" height=\"259\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">U kunt ook de kleur en breedte van de lijn in het diagram wijzigen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>plt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1), color=' <span style=\"color: #ff0000;\">red<\/span> ', linewidth= <span style=\"color: #008000;\">3<\/span> )<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-15894 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistpython2.png\" alt=\"\" width=\"403\" height=\"264\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 2: Meerdere normale verdelingen plotten<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u meerdere normale verdelingscurven kunt plotten met verschillende gemiddelden en standaarddeviaties:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n<span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n<span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> norm\n\n<span style=\"color: #008080;\">#x-axis ranges from -5 and 5 with .001 steps\n<\/span>x = np. <span style=\"color: #3366ff;\">arange<\/span> (-5, 5, 0.001)\n\n<span style=\"color: #008080;\">#define multiple normal distributions\n<\/span>plt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1), label=' <span style=\"color: #ff0000;\">\u03bc: 0, \u03c3: 1<\/span> ')\nplt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1.5), label=' <span style=\"color: #ff0000;\">\u03bc:0, \u03c3: 1.5<\/span> ')\nplt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 2), label=' <span style=\"color: #ff0000;\">\u03bc:0, \u03c3: 2<\/span> ')\n\n<span style=\"color: #008080;\">#add legend to plot\n<\/span>plt. <span style=\"color: #3366ff;\">legend<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-15895 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistpython3.png\" alt=\"\" width=\"388\" height=\"259\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Voel je vrij om de lijnkleuren te wijzigen en een titel en aslabels toe te voegen om het diagram te voltooien:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> numpy <span style=\"color: #008000;\">as<\/span> np\n<span style=\"color: #008000;\">import<\/span> matplotlib. <span style=\"color: #3366ff;\">pyplot<\/span> <span style=\"color: #008000;\">as<\/span> plt\n<span style=\"color: #008000;\">from<\/span> scipy. <span style=\"color: #3366ff;\">stats<\/span> <span style=\"color: #008000;\">import<\/span> norm\n\n<span style=\"color: #008080;\">#x-axis ranges from -5 and 5 with .001 steps\n<\/span>x = np. <span style=\"color: #3366ff;\">arange<\/span> (-5, 5, 0.001)\n\n<span style=\"color: #008080;\">#define multiple normal distributions\n<\/span>plt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1), label=' <span style=\"color: #ff0000;\">\u03bc: 0, \u03c3: 1<\/span> ', color=' <span style=\"color: #ff0000;\">gold<\/span> ')\nplt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 1.5), label=' <span style=\"color: #ff0000;\">\u03bc:0, \u03c3: 1.5<\/span> ', color=' <span style=\"color: #ff0000;\">red<\/span> ')\nplt. <span style=\"color: #3366ff;\">plot<\/span> (x, norm. <span style=\"color: #3366ff;\">pdf<\/span> (x, 0, 2), label=' <span style=\"color: #ff0000;\">\u03bc:0, \u03c3: 2<\/span> ', color=' <span style=\"color: #ff0000;\">pink<\/span> ')\n\n<span style=\"color: #008080;\">#add legend to plot\n<\/span>plt. <span style=\"color: #3366ff;\">legend<\/span> (title=' <span style=\"color: #ff0000;\">Parameters<\/span> ')\n\n<span style=\"color: #008080;\">#add axes labels and a title\n<\/span>plt. <span style=\"color: #3366ff;\">ylabel<\/span> (' <span style=\"color: #ff0000;\">Density<\/span> ')\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> (' <span style=\"color: #ff0000;\">x<\/span> ')\nplt. <span style=\"color: #3366ff;\">title<\/span> (' <span style=\"color: #ff0000;\">Normal Distributions<\/span> ', fontsize= <span style=\"color: #008000;\">14<\/span> )<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-15896 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistpython4.png\" alt=\"\" width=\"416\" height=\"291\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Raadpleeg de <a href=\"https:\/\/matplotlib.org\/stable\/api\/_as_gen\/matplotlib.pyplot.plot.html\" target=\"_blank\" rel=\"noopener\">matplotlib-documentatie<\/a> voor een gedetailleerde uitleg van de functie <strong>plt.plot()<\/strong> .<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Om een normale verdeling in Python te plotten, kun je de volgende syntaxis gebruiken: #x-axis ranges from -3 and 3 with .001 steps x = np. arange (-3, 3, 0.001) #plot normal distribution with mean 0 and standard deviation 1 plt. plot (x, norm. pdf (x, 0, 1)) De x- array definieert het bereik van [&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-1599","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>Hoe een normale verdeling in Python te plotten: met voorbeelden<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe je een normale verdeling in Python kunt plotten, 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\/plot-normale-distributiepython\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe een normale verdeling in Python te plotten: met voorbeelden\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe je een normale verdeling in Python kunt plotten, met verschillende voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-25T17:15:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistpython1.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\/plot-normale-distributiepython\/\",\"url\":\"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/\",\"name\":\"Hoe een normale verdeling in Python te plotten: met voorbeelden\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-25T17:15:30+00:00\",\"dateModified\":\"2023-07-25T17:15:30+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe je een normale verdeling in Python kunt plotten, met verschillende voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe een normale verdeling in python te plotten: 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":"Hoe een normale verdeling in Python te plotten: met voorbeelden","description":"In deze tutorial wordt uitgelegd hoe je een normale verdeling in Python kunt plotten, 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\/plot-normale-distributiepython\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe een normale verdeling in Python te plotten: met voorbeelden","og_description":"In deze tutorial wordt uitgelegd hoe je een normale verdeling in Python kunt plotten, met verschillende voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/","og_site_name":"Statorials","article_published_time":"2023-07-25T17:15:30+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/normaldistpython1.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\/plot-normale-distributiepython\/","url":"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/","name":"Hoe een normale verdeling in Python te plotten: met voorbeelden","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-25T17:15:30+00:00","dateModified":"2023-07-25T17:15:30+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe je een normale verdeling in Python kunt plotten, met verschillende voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/plot-normale-distributiepython\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe een normale verdeling in python te plotten: 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\/1599","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=1599"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1599\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1599"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1599"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1599"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}