{"id":1070,"date":"2017-09-21T14:13:00","date_gmt":"2017-09-21T06:13:00","guid":{"rendered":"http:\/\/people.utm.my\/yap\/?page_id=1070"},"modified":"2020-11-03T12:33:58","modified_gmt":"2020-11-03T04:33:58","slug":"importing-data-into-gnuplot","status":"publish","type":"page","link":"https:\/\/people.utm.my\/yap\/importing-data-into-gnuplot\/","title":{"rendered":"Importing Data into Gnuplot"},"content":{"rendered":"<p style=\"text-align: right\"><span style=\"font-size: 12pt\">(<a href=\"https:\/\/people.utm.my\/yap\/plotting-and-fitting-using-gnuplot\/\">Back to index page<\/a>)<\/span><\/p>\n<p><span style=\"font-size: 12pt\">To import data into Gnuplot, these are several guidelines that might be useful<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 12pt\">Understand your data<\/span><\/li>\n<li><span style=\"font-size: 12pt\">Setting the current active folder location<\/span><\/li>\n<li><span style=\"font-size: 12pt\">If necessary, recheck the current folder<\/span><\/li>\n<li><span style=\"font-size: 12pt\">If necessary, change your datafile separator<\/span><\/li>\n<\/ol>\n<h3>Understanding your data<\/h3>\n<p><span style=\"font-size: 12pt\">It is important that you understand your data. Things that you must be aware:<\/span><\/p>\n<ol>\n<li><span style=\"font-size: 12pt\">File name, type and location of the file<\/span><\/li>\n<li><span style=\"font-size: 12pt\">The contents of the file..<\/span><br \/><span style=\"font-size: 12pt\"> what is used to separate the columns..\u00a0e.g. &#8220;tab&#8221; or &#8220;space&#8221; or &#8220;comma&#8221; or &#8220;semicolon&#8221;<\/span><br \/><span style=\"font-size: 12pt\"> how many columns are there? and which column is important?<\/span><\/li>\n<li><span style=\"font-size: 12pt\">Check the file if there are lines that is not suitable for plotting. e.g. a line of words.<\/span><br \/><span style=\"font-size: 12pt\"> Place &#8220;#&#8221; in front of that line to make it into a comment and gnuplot will ignore that line.<\/span><\/li>\n<\/ol>\n<h3>Change the folder location<\/h3>\n<ol>\n<li><span style=\"font-size: 12pt\">Launch Gnuplot and change the active folder location to where your file is using:<\/span><br \/><span style=\"font-size: 12pt;color: #0000ff\"> gnuplot &gt; cd &#8216;c:\\windows\\user\\desktop&#8217;<\/span><\/li>\n<li><span style=\"font-size: 12pt\">If you wish, you can reconfirm the location using the command:<\/span><br \/><span style=\"font-size: 12pt;color: #0000ff\"> gnuplot &gt; pwd<\/span><\/li>\n<\/ol>\n<h3>Set\/Verify the column separator<\/h3>\n<ol>\n<li><span style=\"font-size: 12pt\">By default, the column separator between data for gnuplot is whitespaces.<\/span><br \/><span style=\"font-size: 12pt\"> &#8220;tab&#8221; and &#8220;spaces&#8221; are considered as whitespaces.<\/span><\/li>\n<li><span style=\"font-size: 12pt\">You can change the data column separator using:<\/span><br \/><span style=\"font-size: 12pt\"><span style=\"color: #0000ff\"> gnuplot &gt; set datafile separator &#8216;,&#8217;<\/span> \u00a0 \u00a0&lt;&lt;&lt; this changes it to comma<\/span><\/li>\n<li><span style=\"font-size: 12pt\">You can check the data column seperator using:<\/span><br \/><span style=\"font-size: 12pt;color: #0000ff\"> gnuplot &gt; show datafile separator<\/span><\/li>\n<\/ol>\n<p>Here is an example of different datafile separators:<\/p>\n<pre style=\"padding-left: 40px\"># Data separated by comma<br \/>123,123<br \/>234,234<br \/>345,345<br \/>456,567<br \/><br \/># Data separated by ;<br \/>123;123<br \/>234;234<br \/>345;345<br \/>456;567<br \/><br \/># Data separated by whitespaces (e.g. spacebar)<br \/>123 123<br \/>234 234<br \/>345 345<br \/>456 567<br \/>456 567<br \/><br \/># Data separated by whitespaces (e.g. tab)<br \/>123   123<br \/>234   234<br \/>345   345<br \/>456   567<br \/>456   567<\/pre>\n<h4><strong>Until here, you have only prepared to read the data file.\u00a0<\/strong><\/h4>\n<p style=\"text-align: right\"><span style=\"font-size: 12pt\">(<a href=\"https:\/\/people.utm.my\/yap\/plotting-and-fitting-using-gnuplot\/\">Back to index page<\/a>)<\/span><\/p>\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Back to index page) To import data into Gnuplot, these are several guidelines that might be useful Understand your data Setting the current active folder location If necessary, recheck the current folder If necessary, change your datafile separator Understanding your data It is important that you understand your data. Things that you must be aware: [&hellip;]<\/p>\n","protected":false},"author":14205,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-1070","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages\/1070","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/users\/14205"}],"replies":[{"embeddable":true,"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/comments?post=1070"}],"version-history":[{"count":4,"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages\/1070\/revisions"}],"predecessor-version":[{"id":1856,"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages\/1070\/revisions\/1856"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/media?parent=1070"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}