{"id":1692,"date":"2014-10-31T22:13:17","date_gmt":"2014-10-31T21:13:17","guid":{"rendered":"http:\/\/denbeke.be\/blog\/?p=1692"},"modified":"2014-10-31T22:17:56","modified_gmt":"2014-10-31T21:17:56","slug":"latex-graphs-with-coordinates-input","status":"publish","type":"post","link":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/","title":{"rendered":"LaTeX: graphs with coordinates input"},"content":{"rendered":"<p>In one of my\u00a0previous posts I wrote about plotting LaTeX function graphs using <code>pgfplots<\/code>. But sometimes you don&#8217;t have a function rule, but just a set of data points.<\/p>\n<p>Using pgfplots you can easily plot a function using those\u00a0coordinates. The following Tex code will draw a line through each of the data points.<\/p>\n<pre><code class=\"tex\">\\begin{tikzpicture}[&gt;=stealth]\r\n    \r\n    \\begin{axis}[\r\n        height=\\textwidth\/1.5,\r\n        width=\\textwidth\/1.5,\r\n        xmin=0,xmax=4,\r\n        ymin=0,ymax=9,\r\n        axis x line=middle,\r\n        axis y line=middle,\r\n        axis line style=-&gt;,\r\n        xlabel={$x$},\r\n        ylabel={$y$},\r\n    ]\r\n        \r\n  \r\n    % plot some coordinates    \r\n    \\addplot[mark=*, blue, line width=1pt] coordinates {\r\n        (0,   4)\r\n        (0.5, 6)\r\n        (1,   2)\r\n        (1.5, 3.5)\r\n        (2,   4)\r\n        (2.5, 6)\r\n        (3,   5)\r\n        (3.5, 3)\r\n        (4,   5.5)\r\n       };\r\n       \r\n   \\end{axis}\r\n        \r\n\\end{tikzpicture}<\/code><\/pre>\n<p>Which will yield the following result:<\/p>\n<figure id=\"attachment_1693\" aria-describedby=\"caption-attachment-1693\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/attachment\/latex-pgfplots-coordinates-with-marker\/\" rel=\"attachment wp-att-1693\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1693 size-medium\" src=\"http:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker-300x291.png\" alt=\"Coordinates plotted using LaTeX pgfplots (with marker)\" width=\"300\" height=\"291\" srcset=\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker-300x291.png 300w, https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker.png 408w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1693\" class=\"wp-caption-text\">Coordinates plotted using LaTeX pgfplots (with marker)<\/figcaption><\/figure>\n<p>&nbsp;<\/p>\n<p>Naturally you can draw a line without printing dots in the points, you just set <code>mark=none<\/code>.<\/p>\n<figure id=\"attachment_1694\" aria-describedby=\"caption-attachment-1694\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/attachment\/latex-pgfplots-coordinates-without-marker\/\" rel=\"attachment wp-att-1694\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1694 size-medium\" src=\"http:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-without-marker-300x293.png\" alt=\"Coordinates plotted using LaTeX pgfplots (without marker)\" width=\"300\" height=\"293\" srcset=\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-without-marker-300x293.png 300w, https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-without-marker.png 400w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-1694\" class=\"wp-caption-text\">Coordinates plotted using LaTeX pgfplots (without marker)<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>In one of my\u00a0previous posts I wrote about plotting LaTeX function graphs using pgfplots. But sometimes you don&#8217;t have a function rule, but just a set of data points. Using pgfplots you can easily plot a function using those\u00a0coordinates. The following Tex code will draw a line through each of the data points. \\begin{tikzpicture}[&gt;=stealth] \\begin{axis}[ [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[161],"tags":[233,229,234,230],"class_list":["post-1692","post","type-post","status-publish","format-standard","hentry","category-software","tag-graphs","tag-latex","tag-pgfplots","tag-tex","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>LaTeX: graphs with coordinates input &#8211; DenBeke<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"LaTeX: graphs with coordinates input &#8211; DenBeke\" \/>\n<meta property=\"og:description\" content=\"In one of my\u00a0previous posts I wrote about plotting LaTeX function graphs using pgfplots. But sometimes you don&#8217;t have a function rule, but just a set of data points. Using pgfplots you can easily plot a function using those\u00a0coordinates. The following Tex code will draw a line through each of the data points. begin{tikzpicture}[&gt;=stealth] begin{axis}[ [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/\" \/>\n<meta property=\"og:site_name\" content=\"DenBeke\" \/>\n<meta property=\"article:published_time\" content=\"2014-10-31T21:13:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2014-10-31T21:17:56+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker.png\" \/>\n\t<meta property=\"og:image:width\" content=\"408\" \/>\n\t<meta property=\"og:image:height\" content=\"397\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mathias Beke\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:site\" content=\"@MthsBk\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mathias Beke\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/\"},\"author\":{\"name\":\"Mathias Beke\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"headline\":\"LaTeX: graphs with coordinates input\",\"datePublished\":\"2014-10-31T21:13:17+00:00\",\"dateModified\":\"2014-10-31T21:17:56+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/\"},\"wordCount\":112,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/10\\\/LaTeX-pgfplots-coordinates-with-marker-300x291.png\",\"keywords\":[\"graphs\",\"latex\",\"pgfplots\",\"tex\"],\"articleSection\":[\"Software\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/\",\"name\":\"LaTeX: graphs with coordinates input &#8211; DenBeke\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#primaryimage\"},\"thumbnailUrl\":\"http:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/10\\\/LaTeX-pgfplots-coordinates-with-marker-300x291.png\",\"datePublished\":\"2014-10-31T21:13:17+00:00\",\"dateModified\":\"2014-10-31T21:17:56+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#primaryimage\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/10\\\/LaTeX-pgfplots-coordinates-with-marker.png\",\"contentUrl\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/wp-content\\\/uploads\\\/2014\\\/10\\\/LaTeX-pgfplots-coordinates-with-marker.png\",\"width\":408,\"height\":397,\"caption\":\"Coordinates plotted using LaTeX pgfplots (with marker)\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/software\\\/latex-graphs-with-coordinates-input\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"LaTeX: graphs with coordinates input\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/\",\"name\":\"DenBeke\",\"description\":\"Mathias Beke\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/denbeke.be\\\/blog\\\/#\\\/schema\\\/person\\\/386878f712fe3fe22227216f087772dc\",\"name\":\"Mathias Beke\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g\",\"caption\":\"Mathias Beke\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"LaTeX: graphs with coordinates input &#8211; DenBeke","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:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/","og_locale":"en_US","og_type":"article","og_title":"LaTeX: graphs with coordinates input &#8211; DenBeke","og_description":"In one of my\u00a0previous posts I wrote about plotting LaTeX function graphs using pgfplots. But sometimes you don&#8217;t have a function rule, but just a set of data points. Using pgfplots you can easily plot a function using those\u00a0coordinates. The following Tex code will draw a line through each of the data points. begin{tikzpicture}[&gt;=stealth] begin{axis}[ [&hellip;]","og_url":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/","og_site_name":"DenBeke","article_published_time":"2014-10-31T21:13:17+00:00","article_modified_time":"2014-10-31T21:17:56+00:00","og_image":[{"width":408,"height":397,"url":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker.png","type":"image\/png"}],"author":"Mathias Beke","twitter_card":"summary_large_image","twitter_creator":"@MthsBk","twitter_site":"@MthsBk","twitter_misc":{"Written by":"Mathias Beke","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#article","isPartOf":{"@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/"},"author":{"name":"Mathias Beke","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"headline":"LaTeX: graphs with coordinates input","datePublished":"2014-10-31T21:13:17+00:00","dateModified":"2014-10-31T21:17:56+00:00","mainEntityOfPage":{"@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/"},"wordCount":112,"commentCount":0,"image":{"@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#primaryimage"},"thumbnailUrl":"http:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker-300x291.png","keywords":["graphs","latex","pgfplots","tex"],"articleSection":["Software"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/","url":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/","name":"LaTeX: graphs with coordinates input &#8211; DenBeke","isPartOf":{"@id":"https:\/\/denbeke.be\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#primaryimage"},"image":{"@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#primaryimage"},"thumbnailUrl":"http:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker-300x291.png","datePublished":"2014-10-31T21:13:17+00:00","dateModified":"2014-10-31T21:17:56+00:00","author":{"@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc"},"breadcrumb":{"@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#primaryimage","url":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker.png","contentUrl":"https:\/\/denbeke.be\/blog\/wp-content\/uploads\/2014\/10\/LaTeX-pgfplots-coordinates-with-marker.png","width":408,"height":397,"caption":"Coordinates plotted using LaTeX pgfplots (with marker)"},{"@type":"BreadcrumbList","@id":"https:\/\/denbeke.be\/blog\/software\/latex-graphs-with-coordinates-input\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/denbeke.be\/blog\/"},{"@type":"ListItem","position":2,"name":"LaTeX: graphs with coordinates input"}]},{"@type":"WebSite","@id":"https:\/\/denbeke.be\/blog\/#website","url":"https:\/\/denbeke.be\/blog\/","name":"DenBeke","description":"Mathias Beke","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/denbeke.be\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/denbeke.be\/blog\/#\/schema\/person\/386878f712fe3fe22227216f087772dc","name":"Mathias Beke","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8889cf00cef9570a8f82e7510ed97205ccb7a1a0d2c7e0968a07e1885386f198?s=96&d=mm&r=g","caption":"Mathias Beke"}}]}},"_links":{"self":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/comments?post=1692"}],"version-history":[{"count":3,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1692\/revisions"}],"predecessor-version":[{"id":1697,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/posts\/1692\/revisions\/1697"}],"wp:attachment":[{"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/media?parent=1692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/categories?post=1692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/denbeke.be\/blog\/wp-json\/wp\/v2\/tags?post=1692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}