{"id":3363,"date":"2023-07-17T21:43:15","date_gmt":"2023-07-17T21:43:15","guid":{"rendered":"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/"},"modified":"2023-07-17T21:43:15","modified_gmt":"2023-07-17T21:43:15","slug":"matplotlib-vet-lettertype","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/","title":{"rendered":"Vetgedrukt lettertype gebruiken in matplotlib (met voorbeelden)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt het <strong>gewichtsargument<\/strong> gebruiken om een vetgedrukt lettertype in Matplotlib te maken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Dit argument wordt vaak gebruikt bij titels en geannoteerde tekst in Matplotlib:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>Methode 1: Gebruik een vetgedrukt lettertype in de titel<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>plt. <span style=\"color: #3366ff;\">title<\/span> (' <span style=\"color: #ff0000;\">My Title<\/span> ', weight=' <span style=\"color: #ff0000;\">bold<\/span> ')<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><strong>Methode 2: Gebruik een vetgedrukt lettertype in geannoteerde tekst<\/strong><\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>plt. <span style=\"color: #3366ff;\">text<\/span> (6, 10, ' <span style=\"color: #ff0000;\">some text<\/span> ', weight=' <span style=\"color: #ff0000;\">bold<\/span> ')\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De volgende voorbeelden laten zien hoe u elke methode in de praktijk kunt gebruiken.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld 1: Gebruik een vetgedrukt lettertype in de titel<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u een spreidingsdiagram maakt met een titel in Matplotlib die een normaal lettertype gebruikt:<\/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;\">#create data<\/span>\nx = [3, 6, 8, 12, 14]\ny = [4, 9, 14, 12, 9]\n\n<span style=\"color: #008080;\">#create scatterplot\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\n\n<span style=\"color: #008080;\">#add title<\/span>\nplt. <span style=\"color: #3366ff;\">title<\/span> (' <span style=\"color: #ff0000;\">My Title<\/span> ', fontsize= <span style=\"color: #008000;\">22<\/span> )\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-28246 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/gras1.jpg\" alt=\"\" width=\"503\" height=\"353\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">En de volgende code laat zien hoe je een spreidingsdiagram met een titel in Matplotlib maakt en het argument <strong>gewicht<\/strong> gebruikt om vetgedrukte lettertypen in te schakelen:<\/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;\">#create data<\/span>\nx = [3, 6, 8, 12, 14]\ny = [4, 9, 14, 12, 9]\n\n<span style=\"color: #008080;\">#create scatterplot\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\n\n<span style=\"color: #008080;\">#add title<\/span>\nplt. <span style=\"color: #3366ff;\">title<\/span> (' <span style=\"color: #ff0000;\">My Title<\/span> ', fontsize= <span style=\"color: #008000;\">22<\/span> , weight=' <span style=\"color: #ff0000;\">bold<\/span> ')<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-28247\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/gras2.jpg\" alt=\"Matplotlib vetgedrukt lettertype in titel\" width=\"513\" height=\"355\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld 2: Gebruik een vetgedrukt lettertype in geannoteerde tekst<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u het argument <strong>gewicht<\/strong> kunt gebruiken om vet lettertype in geannoteerde tekst in een Matplotlib-spreidingsdiagram in te schakelen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #107d3f;\">import<\/span> matplotlib.pyplot <span style=\"color: #107d3f;\">as<\/span> plt\n\n<span style=\"color: #008080;\">#create data<\/span>\nx = [3, 6, 8, 12, 14]\ny = [4, 9, 14, 12, 9]\n\n<span style=\"color: #008080;\">#create scatterplot\n<\/span>plt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\n\n<span style=\"color: #008080;\">#add regular text<\/span>\nplt. <span style=\"color: #3366ff;\">text<\/span> (6, 10, ' <span style=\"color: #ff0000;\">Normal Font<\/span> ', fontsize= <span style=\"color: #008000;\">16<\/span> )\n\n<span style=\"color: #008080;\">#add bold text\n<\/span>plt. <span style=\"color: #3366ff;\">text<\/span> (10, 10, ' <span style=\"color: #ff0000;\">Bold Font<\/span> ', fontsize= <span style=\"color: #008000;\">16<\/span> , weight=' <span style=\"color: #ff0000;\">bold<\/span> ')<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-28248 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/gras3.jpg\" alt=\"Matplotlib vetgedrukt lettertype in geannoteerde tekst\" width=\"510\" height=\"346\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Let op het verschil tussen normaal lettertype en vetgedrukt lettertype.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere veelvoorkomende taken in Matplotlib kunt uitvoeren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-puntenwolklegenda\/\" target=\"_blank\" rel=\"noopener\">Hoe een legenda aan een spreidingsdiagram in Matplotlib toe te voegen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-kleur-op-waarde-spreidingsdiagram\/\" target=\"_blank\" rel=\"noopener\">Hoe u een spreidingsdiagram op waarde kunt kleuren in Matplotlib<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-gemiddelde-lijn\/\" target=\"_blank\" rel=\"noopener\">Hoe u een gemiddelde lijn toevoegt aan plots in Matplotlib<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt het gewichtsargument gebruiken om een vetgedrukt lettertype in Matplotlib te maken. Dit argument wordt vaak gebruikt bij titels en geannoteerde tekst in Matplotlib: Methode 1: Gebruik een vetgedrukt lettertype in de titel plt. title (&#8218; My Title &#8218;, weight=&#8216; bold &#8218;) Methode 2: Gebruik een vetgedrukt lettertype in geannoteerde tekst plt. text (6, [&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-3363","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>Vetgedrukt lettertype gebruiken in Matplotlib (met voorbeelden) \u2013 Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u een vetgedrukt lettertype aan plots in Matplotlib kunt toevoegen, 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\/matplotlib-vet-lettertype\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Vetgedrukt lettertype gebruiken in Matplotlib (met voorbeelden) \u2013 Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u een vetgedrukt lettertype aan plots in Matplotlib kunt toevoegen, met verschillende voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-17T21:43:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/gras1.jpg\" \/>\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\/matplotlib-vet-lettertype\/\",\"url\":\"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/\",\"name\":\"Vetgedrukt lettertype gebruiken in Matplotlib (met voorbeelden) \u2013 Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-17T21:43:15+00:00\",\"dateModified\":\"2023-07-17T21:43:15+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u een vetgedrukt lettertype aan plots in Matplotlib kunt toevoegen, met verschillende voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Vetgedrukt lettertype gebruiken 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":"Vetgedrukt lettertype gebruiken in Matplotlib (met voorbeelden) \u2013 Statorials","description":"In deze tutorial wordt uitgelegd hoe u een vetgedrukt lettertype aan plots in Matplotlib kunt toevoegen, 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\/matplotlib-vet-lettertype\/","og_locale":"de_DE","og_type":"article","og_title":"Vetgedrukt lettertype gebruiken in Matplotlib (met voorbeelden) \u2013 Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u een vetgedrukt lettertype aan plots in Matplotlib kunt toevoegen, met verschillende voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/","og_site_name":"Statorials","article_published_time":"2023-07-17T21:43:15+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/gras1.jpg"}],"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\/matplotlib-vet-lettertype\/","url":"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/","name":"Vetgedrukt lettertype gebruiken in Matplotlib (met voorbeelden) \u2013 Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-17T21:43:15+00:00","dateModified":"2023-07-17T21:43:15+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u een vetgedrukt lettertype aan plots in Matplotlib kunt toevoegen, met verschillende voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/matplotlib-vet-lettertype\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Vetgedrukt lettertype gebruiken 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\/3363","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=3363"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3363\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=3363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=3363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=3363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}