{"id":1921,"date":"2023-07-24T11:04:14","date_gmt":"2023-07-24T11:04:14","guid":{"rendered":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/"},"modified":"2023-07-24T11:04:14","modified_gmt":"2023-07-24T11:04:14","slug":"matplotlib-aantal-ticks","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/","title":{"rendered":"Hoe het aantal ticks in matplotlib te veranderen"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">U kunt de volgende syntaxis gebruiken om het aantal tikken op elke as in Matplotlib te wijzigen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#specify number of ticks on x-axis<\/span>\nplt. <span style=\"color: #3366ff;\">locator_params<\/span> (axis=' <span style=\"color: #ff0000;\">x<\/span> ', nbins= <span style=\"color: #008000;\">4<\/span> )\n\n<span style=\"color: #008080;\">#specify number of ticks on y-axis\n<\/span>plt. <span style=\"color: #3366ff;\">locator_params<\/span> (axis=' <span style=\"color: #ff0000;\">y<\/span> ', nbins= <span style=\"color: #008000;\">2<\/span> ) \n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Het <strong>nbins-<\/strong> argument specificeert het aantal ticks dat op elke as moet worden weergegeven.<\/span><\/p>\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: Specificeer het aantal ticks op beide assen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u zowel het aantal ticks op assen in een plot kunt opgeven:<\/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<\/span>\n#define data\n<span style=\"color: #000000;\">x = [1, 2, 3, 4]\ny = [7, 13, 24, 22]<\/span>\n\n#createplot\n<span style=\"color: #000000;\">plt. <span style=\"color: #3366ff;\">plot<\/span> (x,y,color=' <span style=\"color: #ff0000;\">red<\/span> ')\n\n<span style=\"color: #008080;\">#specify number of ticks on axes\n<\/span>plt. <span style=\"color: #3366ff;\">locator_params<\/span> (axis=' <span style=\"color: #ff0000;\">x<\/span> ', nbins= <span style=\"color: #008000;\">4<\/span> )\nplt. <span style=\"color: #3366ff;\">locator_params<\/span> (axis=' <span style=\"color: #ff0000;\">y<\/span> ', nbins= <span style=\"color: #008000;\">2<\/span> )\n<\/span><\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-18339 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ticks1.png\" alt=\"\" width=\"534\" height=\"363\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 2: Geef alleen het aantal maatstreepjes op de X-as op<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u het aantal ticks alleen op de X-as kunt opgeven:<\/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<\/span>\n#define data\n<span style=\"color: #000000;\">x = [1, 2, 3, 4]\ny = [7, 13, 24, 22]<\/span>\n\n#createplot\n<span style=\"color: #000000;\">plt. <span style=\"color: #3366ff;\">plot<\/span> (x,y,color=' <span style=\"color: #ff0000;\">red<\/span> ')\n\n<span style=\"color: #008080;\">#specify number of ticks on x-axis\n<\/span>plt. <span style=\"color: #3366ff;\">locator_params<\/span> (axis=' <span style=\"color: #ff0000;\">x<\/span> ', nbins= <span style=\"color: #008000;\">2<\/span> )\n<\/span><\/span><\/strong><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-18340 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ticks2.png\" alt=\"\" width=\"536\" height=\"352\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld 3: Geef alleen het aantal maatstreepjes op de Y-as op<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u het aantal ticks alleen op de Y-as kunt opgeven:<\/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<\/span>\n#define data\n<span style=\"color: #000000;\">x = [1, 2, 3, 4]\ny = [7, 13, 24, 22]<\/span>\n\n#createplot\n<span style=\"color: #000000;\">plt. <span style=\"color: #3366ff;\">plot<\/span> (x,y,color=' <span style=\"color: #ff0000;\">red<\/span> ')\n\n<span style=\"color: #008080;\">#specify number of ticks on y-axis\n<\/span>plt. <span style=\"color: #3366ff;\">locator_params<\/span> (axis=' <span style=\"color: #ff0000;\">y<\/span> ', nbins= <span style=\"color: #008000;\">2<\/span> )<\/span><\/span><\/strong> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-18341\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ticks3.png\" alt=\"Wijzig het aantal ticks in Matplotlib\" width=\"536\" height=\"356\" srcset=\"\" sizes=\"auto, \"><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-verwijdert-teken\/\" target=\"_blank\" rel=\"noopener\">Hoe teken uit Matplotlib-plots te verwijderen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-vink-de-lettergrootte-van-het-label-aan\/\" target=\"_blank\" rel=\"noopener\">Hoe u de lettergrootte van vinkjes in Matplotlib instelt<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/stel-x-aswaarden-matplotlib-in\/\" target=\"_blank\" rel=\"noopener\">Hoe X-aswaarden in Matplotlib in te stellen<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/matplotlib-stelt-het-asbereik-in\/\" target=\"_blank\" rel=\"noopener\">Hoe asbereiken in Matplotlib in te stellen<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>U kunt de volgende syntaxis gebruiken om het aantal tikken op elke as in Matplotlib te wijzigen: #specify number of ticks on x-axis plt. locator_params (axis=&#8216; x &#8218;, nbins= 4 ) #specify number of ticks on y-axis plt. locator_params (axis=&#8216; y &#8218;, nbins= 2 ) Het nbins- argument specificeert het aantal ticks dat op elke [&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-1921","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 het aantal ticks in Matplotlib - Statorials te veranderen<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u het aantal ticks op een plot in Matplotlib kunt wijzigen, 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-aantal-ticks\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe het aantal ticks in Matplotlib - Statorials te veranderen\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u het aantal ticks op een plot in Matplotlib kunt wijzigen, met verschillende voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-24T11:04:14+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ticks1.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=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/\",\"url\":\"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/\",\"name\":\"Hoe het aantal ticks in Matplotlib - Statorials te veranderen\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-24T11:04:14+00:00\",\"dateModified\":\"2023-07-24T11:04:14+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u het aantal ticks op een plot in Matplotlib kunt wijzigen, met verschillende voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe het aantal ticks in matplotlib te veranderen\"}]},{\"@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 het aantal ticks in Matplotlib - Statorials te veranderen","description":"In deze tutorial wordt uitgelegd hoe u het aantal ticks op een plot in Matplotlib kunt wijzigen, 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-aantal-ticks\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe het aantal ticks in Matplotlib - Statorials te veranderen","og_description":"In deze tutorial wordt uitgelegd hoe u het aantal ticks op een plot in Matplotlib kunt wijzigen, met verschillende voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/","og_site_name":"Statorials","article_published_time":"2023-07-24T11:04:14+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/ticks1.png"}],"author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/","url":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/","name":"Hoe het aantal ticks in Matplotlib - Statorials te veranderen","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-24T11:04:14+00:00","dateModified":"2023-07-24T11:04:14+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u het aantal ticks op een plot in Matplotlib kunt wijzigen, met verschillende voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/matplotlib-aantal-ticks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe het aantal ticks in matplotlib te veranderen"}]},{"@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\/1921","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=1921"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1921\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}