{"id":12,"date":"2007-09-12T14:51:48","date_gmt":"2007-09-12T13:51:48","guid":{"rendered":"http:\/\/www.walkingrandomly.com\/?p=12"},"modified":"2007-09-19T11:06:39","modified_gmt":"2007-09-19T10:06:39","slug":"plotting-graphs-using-perl","status":"publish","type":"post","link":"https:\/\/walkingrandomly.com\/?p=12","title":{"rendered":"Plotting graphs using Perl"},"content":{"rendered":"<p>I am in the middle of a small project written using the Perl scripting language and I found myself wanting to be able to plot a graph.  Now I have faced this problem before and last time I cheated and got my Perl script to talk to the superb open source plotting program, <a href=\"http:\/\/www.gnuplot.info\/\">gnuplot.<\/a> This worked just fine but for various reason I wanted to code the whole thing in Perl itself this time &#8211; no talking to external programs.<\/p>\n<p>A bit of googling around and I hit upon the <a href=\"http:\/\/\" title=\"http:\/\/search.cpan.org\/~bwarfield\/GDGraph-1.44\/\">GD::Graph<\/a> Perl module.  Once I had this installed I was producing graphs in .png format in no time.  Now the resulting plots are not the prettiest I have ever seen but they do the job and maybe with a bit of tweaking they can be made to look a bit nicer.  An example Bar chart is shown below (the text is distorted due to resizing the image &#8211; not because that&#8217;s how it actually looks)<\/p>\n<p style=\"text-align: center\"><img decoding=\"async\" src=\"\/images\/random\/gd_bar.png\" \/><\/p>\n<p>A lot of sample scripts are included with the package and over at <a href=\"http:\/\/www.gdgraph.com\">gdgraph.com<\/a> you can see what all of the resulting plots look like. All in all it&#8217;s a nice little package and is still under active development.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I am in the middle of a small project written using the Perl scripting language and I found myself wanting to be able to plot a graph. Now I have faced this problem before and last time I cheated and got my Perl script to talk to the superb open source plotting program, gnuplot. This [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[],"class_list":["post-12","post","type-post","status-publish","format-standard","hentry","category-programming"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p3swhs-c","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/12","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=12"}],"version-history":[{"count":0,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=\/wp\/v2\/posts\/12\/revisions"}],"wp:attachment":[{"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=12"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=12"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/walkingrandomly.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=12"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}