{"id":991,"date":"2023-07-28T01:56:41","date_gmt":"2023-07-28T01:56:41","guid":{"rendered":"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/"},"modified":"2023-07-28T01:56:41","modified_gmt":"2023-07-28T01:56:41","slug":"wijzig-de-lettergrootte-matplotlib","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/","title":{"rendered":"Hoe de lettergrootte op een matplotlib-plot te wijzigen"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Vaak wilt u misschien de lettergrootte van verschillende elementen op een Matplotlib-plot wijzigen. Gelukkig is dit eenvoudig te doen met behulp van de volgende code:<\/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\nplt. <span style=\"color: #3366ff;\">rc<\/span> ('font', size=10) <span style=\"color: #008080;\">#controls default text size<\/span>\nplt. <span style=\"color: #3366ff;\">rc<\/span> ('axes', titlesize=10) <span style=\"color: #008080;\">#fontsize of the title<\/span>\nplt. <span style=\"color: #3366ff;\">rc<\/span> ('axes', labelsize=10) <span style=\"color: #008080;\">#fontsize of the x and y labels<\/span>\nplt. <span style=\"color: #3366ff;\">rc<\/span> ('xtick', labelsize=10) <span style=\"color: #008080;\">#fontsize of the x tick labels<\/span>\nplt. <span style=\"color: #3366ff;\">rc<\/span> ('ytick', labelsize=10) <span style=\"color: #008080;\">#fontsize of the y tick labels<\/span>\nplt. <span style=\"color: #3366ff;\">rc<\/span> ('legend', fontsize=10) <span style=\"color: #008080;\">#fontsize of the legend\n<\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De volgende voorbeelden laten zien hoe u de lettergrootte van verschillende elementen in de volgende matplotlib-spreidingsdiagram kunt wijzigen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008000;\">import<\/span> matplotlib.pyplot <span style=\"color: #008000;\">as<\/span> plt\n\nx = [3, 4, 6, 7, 8]\ny = [12, 14, 15, 19, 24]\n\nplt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\nplt. <span style=\"color: #3366ff;\">title<\/span> ('title')\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> ('x_label')\nplt. <span style=\"color: #3366ff;\">ylabel<\/span> ('y_label')\nplt. <span style=\"color: #3366ff;\">show<\/span> ()\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-10291 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont1.png\" alt=\"\" width=\"440\" height=\"314\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\"><em><strong>Opmerking:<\/strong> de standaardlettergrootte voor alle elementen is <strong>10<\/strong> .<\/em><\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 1: Wijzig de lettergrootte van alle elementen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de lettergrootte van elk element in de plot kunt wijzigen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#set font of all elements to size 15\n<\/span>plt. <span style=\"color: #3366ff;\">rc<\/span> ('font', size= <span style=\"color: #008000;\">15<\/span> ) \n\n<span style=\"color: #008080;\">#createplot<\/span>\nplt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\nplt. <span style=\"color: #3366ff;\">title<\/span> ('title')\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> ('x_label')\nplt. <span style=\"color: #3366ff;\">ylabel<\/span> ('y_label')\nplt. <span style=\"color: #3366ff;\">show<\/span> ()\n<\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-10292 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont2.png\" alt=\"\" width=\"441\" height=\"357\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 2: Wijzig de lettergrootte van de titel<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de lettergrootte van de plottitel kunt wijzigen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#set title font to size 50\n<\/span>plt. <span style=\"color: #3366ff;\">rc<\/span> ('axes', titlesize= <span style=\"color: #008000;\">50<\/span> ) \n\n<span style=\"color: #008080;\">#createplot<\/span>\nplt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\nplt. <span style=\"color: #3366ff;\">title<\/span> ('title')\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> ('x_label')\nplt. <span style=\"color: #3366ff;\">ylabel<\/span> ('y_label')\nplt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-10293 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont3.png\" alt=\"Wijzig de lettergrootte van de plottitel matplotlib\" width=\"443\" height=\"398\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 3: Wijzig de lettergrootte van aslabels<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de lettergrootte van de plotaslabels kunt wijzigen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#set axes labels font to size 20\n<\/span>plt. <span style=\"color: #3366ff;\">rc<\/span> ('axes', labelsize= <span style=\"color: #008000;\">20<\/span> ) \n\n<span style=\"color: #008080;\">#createplot<\/span>\nplt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\nplt. <span style=\"color: #3366ff;\">title<\/span> ('title')\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> ('x_label')\nplt. <span style=\"color: #3366ff;\">ylabel<\/span> ('y_label')\nplt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-10294 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont4.png\" alt=\"Matplotlib wijzigt de lettergrootte van aslabels\" width=\"442\" height=\"356\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 4: Wijzig de lettergrootte van vinkjeslabels<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de lettergrootte van de plotticklabels kunt wijzigen:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#set tick labels font to size 20\n<\/span>plt. <span style=\"color: #3366ff;\">rc<\/span> ('xtick', labelsize= <span style=\"color: #008000;\">20<\/span> ) \nplt. <span style=\"color: #3366ff;\">rc<\/span> ('ytick', labelsize= <span style=\"color: #008000;\">20<\/span> ) \n\n<span style=\"color: #008080;\">#createplot<\/span>\nplt. <span style=\"color: #3366ff;\">scatter<\/span> (x,y)\nplt. <span style=\"color: #3366ff;\">title<\/span> ('title')\nplt. <span style=\"color: #3366ff;\">xlabel<\/span> ('x_label')\nplt. <span style=\"color: #3366ff;\">ylabel<\/span> ('y_label')\nplt. <span style=\"color: #3366ff;\">show<\/span> ()<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-10295 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont5.png\" alt=\"Matplotlib wijzigt de lettergrootte van asstreeplabels\" width=\"439\" height=\"340\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Bonus: herstel de standaardlettergroottes<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">U kunt op elk gewenst moment de volgende code gebruiken om alle lettertypen naar hun standaardgrootte te herstellen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>plt.rcParams.update(plt.rcParamsDefault)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><em>Je kunt hier meer Matplotlib-tutorials vinden.<\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vaak wilt u misschien de lettergrootte van verschillende elementen op een Matplotlib-plot wijzigen. Gelukkig is dit eenvoudig te doen met behulp van de volgende code: import matplotlib.pyplot as plt plt. rc (&#8218;font&#8216;, size=10) #controls default text size plt. rc (&#8218;axes&#8216;, titlesize=10) #fontsize of the title plt. rc (&#8218;axes&#8216;, labelsize=10) #fontsize of the x and y [&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-991","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 de lettergrootte op een Matplotlib-plot te veranderen \u2013 Statorials<\/title>\n<meta name=\"description\" content=\"Een eenvoudige uitleg over hoe u de lettergrootte van alle elementen in een Matplotlib-plot kunt wijzigen.\" \/>\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\/wijzig-de-lettergrootte-matplotlib\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe de lettergrootte op een Matplotlib-plot te veranderen \u2013 Statorials\" \/>\n<meta property=\"og:description\" content=\"Een eenvoudige uitleg over hoe u de lettergrootte van alle elementen in een Matplotlib-plot kunt wijzigen.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-28T01:56:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont1.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\/wijzig-de-lettergrootte-matplotlib\/\",\"url\":\"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/\",\"name\":\"Hoe de lettergrootte op een Matplotlib-plot te veranderen \u2013 Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-28T01:56:41+00:00\",\"dateModified\":\"2023-07-28T01:56:41+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"Een eenvoudige uitleg over hoe u de lettergrootte van alle elementen in een Matplotlib-plot kunt wijzigen.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe de lettergrootte op een matplotlib-plot te wijzigen\"}]},{\"@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 de lettergrootte op een Matplotlib-plot te veranderen \u2013 Statorials","description":"Een eenvoudige uitleg over hoe u de lettergrootte van alle elementen in een Matplotlib-plot kunt wijzigen.","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\/wijzig-de-lettergrootte-matplotlib\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe de lettergrootte op een Matplotlib-plot te veranderen \u2013 Statorials","og_description":"Een eenvoudige uitleg over hoe u de lettergrootte van alle elementen in een Matplotlib-plot kunt wijzigen.","og_url":"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/","og_site_name":"Statorials","article_published_time":"2023-07-28T01:56:41+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/matplotlibchangefont1.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\/wijzig-de-lettergrootte-matplotlib\/","url":"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/","name":"Hoe de lettergrootte op een Matplotlib-plot te veranderen \u2013 Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-28T01:56:41+00:00","dateModified":"2023-07-28T01:56:41+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"Een eenvoudige uitleg over hoe u de lettergrootte van alle elementen in een Matplotlib-plot kunt wijzigen.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/wijzig-de-lettergrootte-matplotlib\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe de lettergrootte op een matplotlib-plot te wijzigen"}]},{"@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\/991","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=991"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/991\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=991"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=991"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=991"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}