{"id":2413,"date":"2023-07-22T09:32:34","date_gmt":"2023-07-22T09:32:34","guid":{"rendered":"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/"},"modified":"2023-07-22T09:32:34","modified_gmt":"2023-07-22T09:32:34","slug":"matplotlib-subplottitel","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/","title":{"rendered":"Een titel toevoegen aan subplots in matplotlib (met voorbeelden)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt de volgende basissyntaxis gebruiken om een titel aan een subplot in Matplotlib toe te voegen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>ax[0, 1]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Subplot Title'<\/span> )\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De volgende voorbeelden laten zien hoe u deze syntaxis in de praktijk kunt gebruiken.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 1: Titels toevoegen aan subplots in Matplotlib<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u een 2&#215;2-raster met subplots maakt en de titel van elk subplot specificeert:<\/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 subplots\n<\/span>fig, ax = plt. <span style=\"color: #3366ff;\">subplots<\/span> (2, 2)\n\n<span style=\"color: #008080;\">#define subplot titles\n<\/span>ax[0, 0]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">First Subplot'<\/span> )\nax[0, 1]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Second Subplot<\/span> ')\nax[1, 0]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Third Subplot<\/span> ')\nax[1, 1]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Fourth Subplot<\/span> ')<\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-21694 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/sous-intriguetitre1.png\" alt=\"\" width=\"533\" height=\"479\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Merk op dat elk subplot een unieke titel heeft.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 2: aangepaste titels toevoegen aan subplots in Matplotlib<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">We kunnen de volgende argumenten gebruiken om subplottitels aan te passen:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>lettertypegrootte<\/strong> : de lettergrootte van de titel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>loc<\/strong> : De locatie van de titel (\u201clinks\u201d, \u201cmidden\u201d, \u201crechts\u201d)<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>x, y<\/strong> : De co\u00f6rdinaten (x, y) van de titel<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>kleur<\/strong> : de kleur van het titellettertype<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>fontweight<\/strong> : Het gewicht van het titellettertype<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u deze argumenten in de praktijk kunt gebruiken:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><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 subplots\n<\/span>fig, ax = plt. <span style=\"color: #3366ff;\">subplots<\/span> (2, 2)\n\n<span style=\"color: #008080;\">#define subplot titles\n<\/span>ax[0, 0]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">First Subplot<\/span> ', fontsize= <span style=\"color: #008000;\">18<\/span> , loc=' <span style=\"color: #ff0000;\">left<\/span> ')\nax[0, 1]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Second Subplot<\/span> ', x= <span style=\"color: #008000;\">.75<\/span> , y= <span style=\"color: #008000;\">.9<\/span> )\nax[1, 0]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Third Subplot<\/span> ', color=' <span style=\"color: #ff0000;\">red<\/span> ')\nax[1, 1]. <span style=\"color: #3366ff;\">set_title<\/span> (' <span style=\"color: #ff0000;\">Fourth Subplot<\/span> ', fontweight=' <span style=\"color: #ff0000;\">bold<\/span> ')<\/span>\n<\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-21695 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/sous-intriguetitre2.png\" alt=\"\" width=\"529\" height=\"468\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Met behulp van deze verschillende argumenten kunt u de titels van de subplots aanpassen zodat ze er uitzien zoals u dat wilt.<\/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 bewerkingen in Matplotlib kunt uitvoeren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-subplotgrootte\/\" target=\"_blank\" rel=\"noopener\">Hoe de subplotgrootte in Matplotlib aan te passen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/subplot-afstand-matplotlib\/\" target=\"_blank\" rel=\"noopener\">Hoe u de afstand tussen Matplotlib-subplots kunt aanpassen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-titelpositie\/\">Hoe de titelpositie in Matplotlib aan te passen<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt de volgende basissyntaxis gebruiken om een titel aan een subplot in Matplotlib toe te voegen: ax[0, 1]. set_title (&#8218; Subplot Title&#8216; ) De volgende voorbeelden laten zien hoe u deze syntaxis in de praktijk kunt gebruiken. Voorbeeld 1: Titels toevoegen aan subplots in Matplotlib De volgende code laat zien hoe u een 2&#215;2-raster [&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-2413","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>Een titel toevoegen aan subplots in Matplotlib (met voorbeelden) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u titels aan subplots 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-subplottitel\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Een titel toevoegen aan subplots in Matplotlib (met voorbeelden) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u titels aan subplots in Matplotlib kunt toevoegen, met verschillende voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-22T09:32:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/sous-intriguetitre1.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\/matplotlib-subplottitel\/\",\"url\":\"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/\",\"name\":\"Een titel toevoegen aan subplots in Matplotlib (met voorbeelden) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-22T09:32:34+00:00\",\"dateModified\":\"2023-07-22T09:32:34+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u titels aan subplots in Matplotlib kunt toevoegen, met verschillende voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Een titel toevoegen aan subplots 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":"Een titel toevoegen aan subplots in Matplotlib (met voorbeelden) - Statorials","description":"In deze tutorial wordt uitgelegd hoe u titels aan subplots 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-subplottitel\/","og_locale":"de_DE","og_type":"article","og_title":"Een titel toevoegen aan subplots in Matplotlib (met voorbeelden) - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u titels aan subplots in Matplotlib kunt toevoegen, met verschillende voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/","og_site_name":"Statorials","article_published_time":"2023-07-22T09:32:34+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/sous-intriguetitre1.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\/matplotlib-subplottitel\/","url":"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/","name":"Een titel toevoegen aan subplots in Matplotlib (met voorbeelden) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-22T09:32:34+00:00","dateModified":"2023-07-22T09:32:34+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u titels aan subplots in Matplotlib kunt toevoegen, met verschillende voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/matplotlib-subplottitel\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Een titel toevoegen aan subplots 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\/2413","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=2413"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/2413\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=2413"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=2413"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=2413"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}