{"id":2039,"date":"2023-07-23T23:42:59","date_gmt":"2023-07-23T23:42:59","guid":{"rendered":"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/"},"modified":"2023-07-23T23:42:59","modified_gmt":"2023-07-23T23:42:59","slug":"fout-in-plot-nieuwe-figuurmarges-te-groot","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/","title":{"rendered":"Oplossing: fout in plot.new(): figuurmarges te groot"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Een fout die je tegen kunt komen in R is:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>Error in plot.new(): figure margins too large\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Deze fout treedt op wanneer het plotpaneel in RStudio te klein is voor de marges van de plot die u probeert te maken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In deze tutorial wordt precies uitgelegd hoe u deze fout kunt oplossen.<\/span><\/p>\n<h3> <strong>Hoe de fout te reproduceren<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Stel dat we proberen de volgende plot in R te maken:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#attempt to create scatterplot\n<span style=\"color: #000000;\">plot(1:30)<\/span>\n<\/span><\/strong><\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-19075 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/erreur1.png\" alt=\"\" width=\"552\" height=\"391\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">We ontvangen de volgende foutmelding:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\"><span style=\"color: #000000;\">Error in plot.new(): figure margins too large<\/span> \n<\/span><\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">We ontvangen deze foutmelding omdat het plotpaneel extreem klein is (let op de grootte van het paneel in de linkerbenedenhoek) en daarom kunnen de plotmarges in zo&#8217;n klein paneel niet worden weergegeven.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Methode #1: Los de fout op door de grootte van het plotpaneel te vergroten<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De eenvoudigste manier om deze fout op te lossen is door de grootte van het plotpaneel in RStudio te vergroten:<\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong>plot(1:30)\n<\/strong><\/span><\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-19076 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/erreur2.png\" alt=\"\" width=\"563\" height=\"433\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">Houd er rekening mee dat we geen foutmelding ontvangen omdat het plotpaneel groot genoeg was om de plotmarges weer te geven.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Methode #2: Los de fout op met behulp van de functie par().<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Standaard stelt de functie <a href=\"https:\/\/statorials.org\/nl\/op-functie-in-r\/\" target=\"_blank\" rel=\"noopener\">par()<\/a> in R de marges van een plot als volgt in:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\">Ondermarge: <strong>5.1<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\">Linkermarge: <strong>4.1<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\">Bovenmarge: <strong>4.1<\/strong><\/span><\/li>\n<li> <span style=\"color: #000000;\">Rechtermarge: <strong>2.1<\/strong><\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">We kunnen echter de volgende syntaxis gebruiken om de marges te verkleinen:<\/span><\/span> <\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#adjust plot margins<\/span>\nby(mar = c(1, 1, 1, 1))\n\n<span style=\"color: #008080;\">#create scatterplot\n<span style=\"color: #000000;\">plot(1:30)<\/span><\/span><\/strong><\/span> <\/pre>\n<p><img decoding=\"async\" loading=\"lazy\" class=\" wp-image-19077 aligncenter\" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/erreur3.png\" alt=\"\" width=\"386\" height=\"599\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">De plot wordt met succes weergegeven in het plotpaneel van RStudio omdat we de marges aanzienlijk hebben verkleind.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Methode #3: Los de fout op door het huidige traceerapparaat te stoppen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Als geen van de voorgaande methoden de fout verhelpt, moet u mogelijk de volgende code gebruiken om het huidige traceerapparaat te stoppen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong>dev. <span style=\"color: #3366ff;\">off<\/span> ()<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">In sommige gevallen kan dit de fout verhelpen, omdat hierdoor alle plotinstellingen worden verwijderd die voor eerdere plots zijn gebruikt en die mogelijk uw huidige plot verstoren.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">In de volgende zelfstudies wordt uitgelegd hoe u andere algemene traceerfuncties in R kunt uitvoeren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/op-functie-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe de par()-functie in R te gebruiken<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/r-superpositie-van-sporen\/\" target=\"_blank\" rel=\"noopener\">Plotten overlappen in R<\/a><br \/><a href=\"https:\/\/statorials.org\/nl\/r-meerdere-plots-opslaan-in-pdf\/\" target=\"_blank\" rel=\"noopener\">Hoe meerdere plots als PDF op te slaan in R<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Een fout die je tegen kunt komen in R is: Error in plot.new(): figure margins too large Deze fout treedt op wanneer het plotpaneel in RStudio te klein is voor de marges van de plot die u probeert te maken. In deze tutorial wordt precies uitgelegd hoe u deze fout kunt oplossen. Hoe de fout [&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-2039","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>Oplossing: fout in plot.new(): figuurmarges te groot - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: fout in plot.new(): figuurmarges te groot.\" \/>\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\/fout-in-plot-nieuwe-figuurmarges-te-groot\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Oplossing: fout in plot.new(): figuurmarges te groot - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: fout in plot.new(): figuurmarges te groot.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-23T23:42:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/erreur1.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\/fout-in-plot-nieuwe-figuurmarges-te-groot\/\",\"url\":\"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/\",\"name\":\"Oplossing: fout in plot.new(): figuurmarges te groot - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-23T23:42:59+00:00\",\"dateModified\":\"2023-07-23T23:42:59+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: fout in plot.new(): figuurmarges te groot.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Oplossing: fout in plot.new(): figuurmarges te groot\"}]},{\"@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":"Oplossing: fout in plot.new(): figuurmarges te groot - Statorials","description":"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: fout in plot.new(): figuurmarges te groot.","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\/fout-in-plot-nieuwe-figuurmarges-te-groot\/","og_locale":"de_DE","og_type":"article","og_title":"Oplossing: fout in plot.new(): figuurmarges te groot - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: fout in plot.new(): figuurmarges te groot.","og_url":"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/","og_site_name":"Statorials","article_published_time":"2023-07-23T23:42:59+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/erreur1.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\/fout-in-plot-nieuwe-figuurmarges-te-groot\/","url":"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/","name":"Oplossing: fout in plot.new(): figuurmarges te groot - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-23T23:42:59+00:00","dateModified":"2023-07-23T23:42:59+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: fout in plot.new(): figuurmarges te groot.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/fout-in-plot-nieuwe-figuurmarges-te-groot\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Oplossing: fout in plot.new(): figuurmarges te groot"}]},{"@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\/2039","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=2039"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/2039\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=2039"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=2039"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=2039"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}