{"id":3821,"date":"2020-10-15T15:42:54","date_gmt":"2020-10-15T13:42:54","guid":{"rendered":"https:\/\/www.mathweb.fr\/euclide\/?p=3821"},"modified":"2021-10-26T16:20:56","modified_gmt":"2021-10-26T14:20:56","slug":"graphique-python-mathplotlib-vs-latex","status":"publish","type":"post","link":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/","title":{"rendered":"Graphique en Python: matplotlib vs LaTeX"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Graphique en Python: matplotlib vs LaTeX. Je ne sais pas pour vous, mais de mon c\u00f4t\u00e9, j&rsquo;ai de gros probl\u00e8mes avec <em><a href=\"https:\/\/matplotlib.org\/3.3.2\/contents.html\" target=\"_blank\" rel=\"noreferrer noopener\">matplolib<\/a><\/em>, le module de Python. Je trouve que les r\u00e9sultats sont bien d\u00e9gueux&#8230; Heureusement, \\(\\LaTeX\\) est mon ami !<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_85 counter-hierarchy ez-toc-counter ez-toc-white ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Au menu sur cette page...<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#Graphique_en_Python_matplotlib_vs_LaTeX_%E2%80%93_Introduction\" >Graphique en Python: matplotlib vs LaTeX &#8211; Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#Graphique_en_Python_matplotlib_vs_LaTeX_%E2%80%93_Construction_du_graphique_en_LaTeX\" >Graphique en Python: matplotlib vs LaTeX &#8211; Construction du graphique en \\(\\LaTeX\\)<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#Graphique_en_Python_matplotlib_vs_LaTeX_%E2%80%93_Les_dimensions_et_les_echelles\" >Graphique en Python: matplotlib vs LaTeX &#8211; Les dimensions et les \u00e9chelles<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#Le_document_LaTeX\" >Le document \\(\\LaTeX\\)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#Previsions\" >Pr\u00e9visions<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Graphique_en_Python_matplotlib_vs_LaTeX_%E2%80%93_Introduction\"><\/span>Graphique en Python: matplotlib vs LaTeX &#8211; Introduction<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Comme je m&rsquo;ennuie lamentablement aujourd&rsquo;hui, j&rsquo;ai souhait\u00e9 construire un nuage de points repr\u00e9sentatif de l&rsquo;\u00e9volution du nombre de visites uniques sur mon site mathweb.fr.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Je me suis donc aid\u00e9 des statistiques depuis 2 mois et j&rsquo;ai report\u00e9 les nombres de visites dans un tableur que j&rsquo;ai ensuite converti en fichier CSV afin d&rsquo;exploiter les donn\u00e9es.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mais j&rsquo;ai \u00e9t\u00e9 horrifi\u00e9 par le r\u00e9sultat du code suivant:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">from matplotlib.pylab import plot,show\n\nfile = \"C:\\\\Users\\\\Stephane\\\\Mes Documents\\\\MATHWEB\\\\stats.csv\"\n\ndays, dates , visits = [] , [] , []\n\nwith open(file , 'r' , encoding='utf8') as f:\n    lines = f.readlines()\n    n = len( lines )\n    for l in lines:\n        temp = l.split(',')\n        days.append( temp[2].replace('\\n','') )\n        dates.append( temp[0] )\n        visits.append( int(temp[1]) )\n        \nplot(visits)\nshow()\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/matplotlib-1.jpg\" alt=\"graphique python matplotlib\" class=\"wp-image-3823\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/matplotlib-1.jpg 640w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/matplotlib-1-300x225.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/matplotlib-1-600x450.jpg 600w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Comme je trouve \u00e7a assez moche, je me suis dit qu&rsquo;il fallait que je fasse un graphique en \\(\\LaTeX\\). Seul un physicien pourrait se contenter de cette merde&#8230; \ud83d\ude42 Bah ! Je plaisante ! (j&rsquo;aime bien taquiner les physiciens&#8230;)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Graphique_en_Python_matplotlib_vs_LaTeX_%E2%80%93_Construction_du_graphique_en_LaTeX\"><\/span>Graphique en Python: matplotlib vs LaTeX &#8211; Construction du graphique en \\(\\LaTeX\\)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Graphique_en_Python_matplotlib_vs_LaTeX_%E2%80%93_Les_dimensions_et_les_echelles\"><\/span>Graphique en Python: matplotlib vs LaTeX &#8211; Les dimensions et les \u00e9chelles<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">On va commencer par fixer les dimensions et les \u00e9chelles.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\"># valeur maximale en ordonn\u00e9e\nmax_y = ((max(visits)\/\/100)+1)*100\n# \u00e9chelles en abscisse et en ordonn\u00e9e\nscale_x = 1\/3\nscale_y = 1\/50\n# dimension du document PDF\npaperheight = (max_y * scale_y + 1) * 10 # en mm\npaperwidth = (n * scale_x + 1) * 10 # en mm<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Les \u00e9chelles sont arbitraires&#8230; Pour un plus grand nombre de valeurs (je n&rsquo;en ai que 60), je choisirai une \u00e9chelle plus petite que 1\/3 pour les abscisses.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Le_document_LaTeX\"><\/span>Le document \\(\\LaTeX\\)<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Bon, l\u00e0, c&rsquo;est ennuyant donc je ne vais pas d\u00e9tailler le code (le fichier source est de toute mani\u00e8re disponible pour les abonn\u00e9\u00b7e\u00b7s de mathweb.fr).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Mais l&rsquo;id\u00e9e est de construire une variable, que j&rsquo;ai appel\u00e9e \u00ab\u00a0document\u00a0\u00bb qui est une cha\u00eene de caract\u00e8res contenant le code \\(\\LaTeX\\) de mon graphique.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Quand je lance le programme, voici ce qui se passe:<\/p>\n\n\n\n<figure class=\"wp-block-video aligncenter\"><video controls src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/graphique-python-latex-1.mp4\"><\/video><\/figure>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"745\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png\" alt=\"graphique python avec LaTeX\" class=\"wp-image-3825\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png 820w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib-600x545.png 600w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib-300x273.png 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib-768x698.png 768w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Il faut bien admettre que le r\u00e9sultat est bien plus convainquant que celui de <strong>matplotlib<\/strong> non ?<\/p>\n\n\n\n<div class=\"wp-block-file aligncenter um_article\"><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/Graphique-latex-Python.zip\">Graphique-latex-Python<\/a><a href=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/Graphique-latex-Python.zip\" class=\"wp-block-file__button\" download>T\u00e9l\u00e9charger<\/a><\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Previsions\"><\/span>Pr\u00e9visions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ce que j&rsquo;aimerais faire maintenant, c&rsquo;est une pr\u00e9vision du nombre de visites pour l&rsquo;avenir. Constatant que la progression est exponentielle, je vais consid\u00e9rer le logarithme n\u00e9p\u00e9rien des nombres de visites pour faire une r\u00e9gression lin\u00e9aire.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"python\" data-enlighter-theme=\"dracula\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"false\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">xx = range(n)\nyy = [ log(visits[i]) for i in xx ]\na,b = polyfit(xx , yy , 1)\n\nplot(xx , yy , \"o\")\nplot(xx , a*xx+b)\nshow()<\/pre>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/reglin.jpg\" alt=\"r\u00e9gression lin\u00e9aire\" class=\"wp-image-3833\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/reglin.jpg 640w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/reglin-300x225.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/reglin-600x450.jpg 600w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">En affichant les valeurs de <em>a<\/em> et <em>b<\/em>, on a l&rsquo;\u00e9quation de droite suivante:$$y=0.023790612870157827x + 5.293931301639233.$$<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Cela signifie que:$$\\ln(N)=0.023790612870157827x + 5.293931301639233$$et donc:$$N=\\text{e}^{0.023790612870157827x + 5.293931301639233}.$$<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"640\" height=\"480\" src=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/regexp.jpg\" alt=\"r\u00e9gression exponentielle\" class=\"wp-image-3835\" srcset=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/regexp.jpg 640w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/regexp-300x225.jpg 300w, https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/regexp-600x450.jpg 600w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">Cette estimation sera-t-elle correcte ? Nous verrons \u00e0 No\u00ebl&#8230; Car selon ce mod\u00e8le, \u00e0 cette p\u00e9riode, il devrait y avoir 4388 visites ! Je ne sais pas pourquoi, mais je pense que ce mod\u00e8le est erron\u00e9&#8230; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Graphique en Python: matplotlib vs LaTeX. Je ne sais pas pour vous, mais de mon c\u00f4t\u00e9, j&rsquo;ai de gros probl\u00e8mes avec matplolib, le module de Python. Je trouve que les r\u00e9sultats sont bien d\u00e9gueux&#8230; Heureusement, \\(\\LaTeX\\) est mon ami !<\/p>\n","protected":false},"author":1,"featured_media":3825,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,5],"tags":[242,135],"class_list":["post-3821","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-latex","category-python","tag-graphique","tag-matplotlib"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Graphique en Python: matplotlib vs LaTeX - Mathweb.fr<\/title>\n<meta name=\"description\" content=\"Construire un graphique en Python avec matplotlib est quelques fois d\u00e9cevant... Alors pourquoi de pas utiliser LaTeX \u00e0 la place ?\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Graphique en Python: matplotlib vs LaTeX - Mathweb.fr\" \/>\n<meta property=\"og:description\" content=\"Construire un graphique en Python avec matplotlib est quelques fois d\u00e9cevant... Alors pourquoi de pas utiliser LaTeX \u00e0 la place ?\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/\" \/>\n<meta property=\"og:site_name\" content=\"Mathweb.fr\" \/>\n<meta property=\"article:published_time\" content=\"2020-10-15T13:42:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-10-26T14:20:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png\" \/>\n\t<meta property=\"og:image:width\" content=\"820\" \/>\n\t<meta property=\"og:image:height\" content=\"745\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Pasquet\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u00c9crit par\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Pasquet\" \/>\n\t<meta name=\"twitter:label2\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/\"},\"author\":{\"name\":\"St\u00e9phane Pasquet\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"headline\":\"Graphique en Python: matplotlib vs LaTeX\",\"datePublished\":\"2020-10-15T13:42:54+00:00\",\"dateModified\":\"2021-10-26T14:20:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/\"},\"wordCount\":438,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/python-latex-matplotlib.png\",\"keywords\":[\"graphique\",\"matplotlib\"],\"articleSection\":[\"LaTeX\",\"Python\"],\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/\",\"name\":\"Graphique en Python: matplotlib vs LaTeX - Mathweb.fr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/python-latex-matplotlib.png\",\"datePublished\":\"2020-10-15T13:42:54+00:00\",\"dateModified\":\"2021-10-26T14:20:56+00:00\",\"description\":\"Construire un graphique en Python avec matplotlib est quelques fois d\u00e9cevant... Alors pourquoi de pas utiliser LaTeX \u00e0 la place ?\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#breadcrumb\"},\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/python-latex-matplotlib.png\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2020\\\/10\\\/python-latex-matplotlib.png\",\"width\":820,\"height\":745,\"caption\":\"graphique python latex vs matplotlib\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/2020\\\/10\\\/15\\\/graphique-python-mathplotlib-vs-latex\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Graphique en Python: matplotlib vs LaTeX\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#website\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/\",\"name\":\"Mathweb.fr\",\"description\":\"Math\u00e9matiques, LaTeX et Python\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/#\\\/schema\\\/person\\\/e4d3bb07968238378f0d5052a70dcd69\",\"name\":\"St\u00e9phane Pasquet\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"url\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"contentUrl\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\",\"width\":74,\"height\":77,\"caption\":\"St\u00e9phane Pasquet\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.mathweb.fr\\\/euclide\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/cropped-logo-mathweb.webp\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Graphique en Python: matplotlib vs LaTeX - Mathweb.fr","description":"Construire un graphique en Python avec matplotlib est quelques fois d\u00e9cevant... Alors pourquoi de pas utiliser LaTeX \u00e0 la place ?","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:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/","og_locale":"fr_FR","og_type":"article","og_title":"Graphique en Python: matplotlib vs LaTeX - Mathweb.fr","og_description":"Construire un graphique en Python avec matplotlib est quelques fois d\u00e9cevant... Alors pourquoi de pas utiliser LaTeX \u00e0 la place ?","og_url":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/","og_site_name":"Mathweb.fr","article_published_time":"2020-10-15T13:42:54+00:00","article_modified_time":"2021-10-26T14:20:56+00:00","og_image":[{"width":820,"height":745,"url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png","type":"image\/png"}],"author":"St\u00e9phane Pasquet","twitter_card":"summary_large_image","twitter_misc":{"\u00c9crit par":"St\u00e9phane Pasquet","Dur\u00e9e de lecture estim\u00e9e":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#article","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/"},"author":{"name":"St\u00e9phane Pasquet","@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"headline":"Graphique en Python: matplotlib vs LaTeX","datePublished":"2020-10-15T13:42:54+00:00","dateModified":"2021-10-26T14:20:56+00:00","mainEntityOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/"},"wordCount":438,"commentCount":0,"publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png","keywords":["graphique","matplotlib"],"articleSection":["LaTeX","Python"],"inLanguage":"fr-FR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/","url":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/","name":"Graphique en Python: matplotlib vs LaTeX - Mathweb.fr","isPartOf":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#primaryimage"},"image":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#primaryimage"},"thumbnailUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png","datePublished":"2020-10-15T13:42:54+00:00","dateModified":"2021-10-26T14:20:56+00:00","description":"Construire un graphique en Python avec matplotlib est quelques fois d\u00e9cevant... Alors pourquoi de pas utiliser LaTeX \u00e0 la place ?","breadcrumb":{"@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#breadcrumb"},"inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/"]}]},{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#primaryimage","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2020\/10\/python-latex-matplotlib.png","width":820,"height":745,"caption":"graphique python latex vs matplotlib"},{"@type":"BreadcrumbList","@id":"https:\/\/www.mathweb.fr\/euclide\/2020\/10\/15\/graphique-python-mathplotlib-vs-latex\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.mathweb.fr\/euclide\/"},{"@type":"ListItem","position":2,"name":"Graphique en Python: matplotlib vs LaTeX"}]},{"@type":"WebSite","@id":"https:\/\/www.mathweb.fr\/euclide\/#website","url":"https:\/\/www.mathweb.fr\/euclide\/","name":"Mathweb.fr","description":"Math\u00e9matiques, LaTeX et Python","publisher":{"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.mathweb.fr\/euclide\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":["Person","Organization"],"@id":"https:\/\/www.mathweb.fr\/euclide\/#\/schema\/person\/e4d3bb07968238378f0d5052a70dcd69","name":"St\u00e9phane Pasquet","image":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","url":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","contentUrl":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp","width":74,"height":77,"caption":"St\u00e9phane Pasquet"},"logo":{"@id":"https:\/\/www.mathweb.fr\/euclide\/wp-content\/uploads\/2025\/06\/cropped-logo-mathweb.webp"}}]}},"_links":{"self":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/3821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/comments?post=3821"}],"version-history":[{"count":0,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/posts\/3821\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media\/3825"}],"wp:attachment":[{"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/media?parent=3821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/categories?post=3821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mathweb.fr\/euclide\/wp-json\/wp\/v2\/tags?post=3821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}