{"id":1275,"date":"2014-08-22T07:52:56","date_gmt":"2014-08-22T07:52:56","guid":{"rendered":"http:\/\/41j.com\/blog\/?p=1275"},"modified":"2014-08-22T07:53:20","modified_gmt":"2014-08-22T07:53:20","slug":"simple-gnuplot-histogram-example","status":"publish","type":"post","link":"https:\/\/41j.com\/blog\/2014\/08\/simple-gnuplot-histogram-example\/","title":{"rendered":"Simple gnuplot histogram example"},"content":{"rendered":"<p>The gnuplot histogram style wont automagically bin your data. To do this you need to either use an external program, or add some additional code, here a simple example:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\nset terminal png\r\nset output &quot;hist.png&quot;\r\nset boxwidth 1\r\nset style fill solid\r\nset style histogram \r\nset style data histogram\r\nbw=1\r\nbin(x,width)=width*floor(x\/width) + bw\/2.0\r\nplot &quot;test.dat&quot; using (bin($1,bw)):(1.0) smooth freq with boxes\r\n<\/pre>\n<p>Using this data file:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\r\n1\r\n2\r\n3\r\n4\r\n5\r\n5\r\n5\r\n5\r\n5\r\n5\r\n5\r\n5\r\n5\r\n5\r\n5\r\n7\r\n8\r\n9\r\n10\r\n<\/pre>\n<p>You should see this output:<\/p>\n<p><a href=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/08\/hist.png\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/08\/hist.png\" alt=\"hist\" width=\"640\" height=\"480\" class=\"aligncenter size-full wp-image-1276\" srcset=\"https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/08\/hist.png 640w, https:\/\/41j.com\/blog\/wp-content\/uploads\/2014\/08\/hist-300x225.png 300w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The gnuplot histogram style wont automagically bin your data. To do this you need to either use an external program, or add some additional code, here a simple example: set terminal png set output &quot;hist.png&quot; set boxwidth 1 set style fill solid set style histogram set style data histogram bw=1 bin(x,width)=width*floor(x\/width) + bw\/2.0 plot &quot;test.dat&quot; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1275","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1RRoU-kz","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/comments?post=1275"}],"version-history":[{"count":2,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1275\/revisions"}],"predecessor-version":[{"id":1278,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/posts\/1275\/revisions\/1278"}],"wp:attachment":[{"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/media?parent=1275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/categories?post=1275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/41j.com\/blog\/wp-json\/wp\/v2\/tags?post=1275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}