{"id":2001,"date":"2007-07-20T11:16:41","date_gmt":"2007-07-20T16:16:41","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2007\/07\/25\/colored-3-d-bar-plots\/"},"modified":"2007-08-28T12:10:37","modified_gmt":"2007-08-28T17:10:37","slug":"colored-3-d-bar-plots","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2007\/07\/20\/colored-3-d-bar-plots\/","title":{"rendered":"Colored 3-d bar plots"},"content":{"rendered":"<p><a class=\"imagelink\" title=bar4y.jpg href=\"https:\/\/blogs.mathworks.com\/images\/pick\/bar4y.jpg\"><img decoding=\"async\" id=\"image2008\" alt=bar4y.jpg width=500 src=\"https:\/\/blogs.mathworks.com\/images\/pick\/bar4y.jpg\" \/><\/a><\/p>\n<p>As I mention quite frequently, the best way to become Pick of the Week is to write code that solves a problem that I am having or a problem I think many other people are having.  That is how I found <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=11233 (link no longer works)\">bar4viaColor<\/a>.  The customer I was working with wanted to show some Z data that varied as a function of X and Y.  <\/p>\n<p>Normally, this would be a <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/mesh.html\">MESH<\/a> or <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/surf.html\">SURF<\/a> plot.  <\/p>\n<p><a class=\"imagelink\" title=mesh.jpg href=\"https:\/\/blogs.mathworks.com\/images\/pick\/mesh.jpg\"><img decoding=\"async\" id=\"image2000\"  width=500 alt=mesh.jpg src=\"https:\/\/blogs.mathworks.com\/images\/pick\/mesh.jpg\" \/> <\/a><br \/>\n<a class=\"imagelink\" title=surf.jpg href=\"https:\/\/blogs.mathworks.com\/images\/pick\/surf.jpg\"><img decoding=\"async\" id=\"image1999\"  width=500 alt=surf.jpg src=\"https:\/\/blogs.mathworks.com\/images\/pick\/surf.jpg\" \/> <\/a><\/p>\n<p>However, the twist was they did not want to interpolate between the known data points.  This would point to <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/ref\/bar3.html\">BAR3<\/a>.  <\/p>\n<p><a class=\"imagelink\" title=bar3y.jpg href=\"https:\/\/blogs.mathworks.com\/images\/pick\/bar3y.jpg\"><img decoding=\"async\" id=\"image2007\"  width=500 alt=bar3y.jpg src=\"https:\/\/blogs.mathworks.com\/images\/pick\/bar3y.jpg\" \/><\/a> <\/p>\n<p>The final complication was that the height of the bar should dictate the color of the bar.  This is possible, but not easy with BAR3.  I just knew someone would have written the code to do this and posted it to MATLAB Central.  I was right: <a title=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/loadFile.do?objectId=11233 (link no longer works)\">bar4viaColor<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\nAs I mention quite frequently, the best way to become Pick of the Week is to write code that solves a problem that I am having or a problem I think many other people are having.  That is how I found&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2007\/07\/20\/colored-3-d-bar-plots\/\">read more >><\/a><\/p>\n","protected":false},"author":68,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2001"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=2001"}],"version-history":[{"count":0,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2001\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}