{"id":1658,"date":"2020-03-01T23:04:20","date_gmt":"2020-03-01T15:04:20","guid":{"rendered":"https:\/\/people.utm.my\/yap\/?page_id=1658"},"modified":"2020-03-01T23:49:55","modified_gmt":"2020-03-01T15:49:55","slug":"adding-labels","status":"publish","type":"page","link":"https:\/\/people.utm.my\/yap\/adding-labels\/","title":{"rendered":"Adding labels"},"content":{"rendered":"<p style=\"text-align: right\">(<a href=\"https:\/\/people.utm.my\/yap\/plotting-and-fitting-using-gnuplot\/\">Back to index page<\/a>)<\/p>\n<p>You can add labels at various parts of the graph.<\/p>\n<h4>A general label for the graph<\/h4>\n<p style=\"padding-left: 40px\">Set label &#8220;Frequency (MHz)&#8221;<\/p>\n<h4>Label for x or y axis<\/h4>\n<p style=\"text-align: left;padding-left: 40px\">Set xlabel &#8220;Frequency (MHz)&#8221;<br \/>\nSet ylabel &#8220;Amplitude (Volts)&#8221;<\/p>\n<h4>A random text\/ in the graph area<\/h4>\n<p style=\"padding-left: 40px\">set label 1 &#8220;DPPH Absorption spectrum&#8221; at 540,8000<\/p>\n<h4>Adding a label with values from a parameter<\/h4>\n<p style=\"padding-left: 40px\">set label 1 sprintf(&#8220;m = %3.4f&#8221;,m) at 510,75 font &#8220;arialbd,18&#8221;<\/p>\n<h4>Adding a label with values from data fitting<\/h4>\n<p style=\"padding-left: 40px\">set fit errorvariables<br \/>\nset label 1 sprintf(&#8220;m = %3.4f +\/- %3.4f&#8221;, m, m_err) at 2,5 font &#8220;arialbd,18&#8221;<\/p>\n<h3><strong>Adding symbols to the graph<\/strong><\/h3>\n<p>To do this, you need to set the terminal to &#8220;enhanced&#8221;. Depending on whichever terminal that you used, you may be able to set it to enhanced.<\/p>\n<p>Example:<\/p>\n<ul>\n<li>set terminal windows enhanced<\/li>\n<li>set terminal jpeg enhanced<\/li>\n<li>set terminal postscript enhanced<\/li>\n<li>set term wxt enhanced<\/li>\n<\/ul>\n<p>By setting enhanced, you can add this code to add greek symbols:<\/p>\n<p style=\"padding-left: 40px\">set xlabel &#8221; {\/Symbol s}&#8221;\u00a0 # this will add a sigma symbol<\/p>\n<p>Here is the <a href=\"http:\/\/folk.uio.no\/inf3330\/scripting\/doc\/gnuplot\/Kawano\/label-e.html\" target=\"_blank\" rel=\"noopener noreferrer\">full list of symbols<\/a>.<\/p>\n<p>If your symbols are not appearing and this error appears instead:<\/p>\n<p style=\"padding-left: 40px\">gdImageStringFT: No character set found while printing string s with font Symbol<br \/>\ngdImageStringFT: No character set found while printing string s with font Symbol<\/p>\n<p>Add this line of code, somewhere before your plot:<\/p>\n<p style=\"padding-left: 40px\">set encoding utf8<\/p>\n<p style=\"text-align: right\">(<a href=\"https:\/\/people.utm.my\/yap\/plotting-and-fitting-using-gnuplot\/\">Back to index page<\/a>)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>(Back to index page) You can add labels at various parts of the graph. A general label for the graph Set label &#8220;Frequency (MHz)&#8221; Label for x or y axis Set xlabel &#8220;Frequency (MHz)&#8221; Set ylabel &#8220;Amplitude (Volts)&#8221; A random text\/ in the graph area set label 1 &#8220;DPPH Absorption spectrum&#8221; at 540,8000 Adding a [&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-1658","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages\/1658","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=1658"}],"version-history":[{"count":9,"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages\/1658\/revisions"}],"predecessor-version":[{"id":1668,"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/pages\/1658\/revisions\/1668"}],"wp:attachment":[{"href":"https:\/\/people.utm.my\/yap\/wp-json\/wp\/v2\/media?parent=1658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}