{"id":2109,"date":"2008-01-28T10:10:52","date_gmt":"2008-01-28T15:10:52","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/2008\/01\/28\/practical-example-adding-callbacks-to-a-plot\/"},"modified":"2016-05-18T11:01:43","modified_gmt":"2016-05-18T15:01:43","slug":"practical-example-adding-callbacks-to-a-plot","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2008\/01\/28\/practical-example-adding-callbacks-to-a-plot\/","title":{"rendered":"Practical Example: Adding callbacks to a plot"},"content":{"rendered":"<p>This eleven minute video shows how you can make plots on two axes such that when one point of a pair is clicked, they both are highlighted.<\/p>\n<p>In this video you will see:<\/p>\n<ul>\n<li>LINE used instead of PLOT so that each data point has its own handle<\/li>\n<li>Debugging when a nested function is not closed properly<\/li>\n<li>Debugging when inputs are unspecified to a callback<\/li>\n<li>Handle graphics manipulation of marker size<\/li>\n<li>Lining up code for better readability<\/li>\n<li>Frequent testing of code to minimize errors when they do occur<\/li>\n<\/ul>\n<p><embed src=\"https:\/\/blogs.mathworks.com\/images\/pick\/\/FlashVideos\/FlowPlayer.swf?config=%7Bembedded%3Atrue%2CplayList%3A%5B%7BsuggestedClipsInfoUrl%3A%2772%20see%20also%2Etxt%27%2Curl%3A%2772%20Practical%20callbacks%20on%20plot%2Eflv%27%7D%5D%2CbaseURL%3A%27http%3A%2F%2Fblogs%2Emathworks%2Ecom%2Fimages%2Fpick%2FFlashVideos%2F%27%2CsplashImageFile%3A%2772%20Practical%20callbacks%20on%20plot%2Ejpg%27%2Cloop%3Afalse%2CinitialScale%3A%27fit%27%2CshowFullScreenButton%3Afalse%2CautoBuffering%3Afalse%2CmenuItems%3A%5Bfalse%2Cfalse%2Cfalse%2Cfalse%2Cfalse%2Ctrue%5D%2CautoPlay%3Afalse%7D\" type=\"application\/x-shockwave-flash\" width=\"500\" height=\"400\"><\/embed><\/p>\n<p>Also note, I have made a direct link the the Lazy Web open challenges page. There is a new challenge up. Don&#8217;t forget there are t-shirts for answering the one minute survey below.<\/p>\n<p><a href=\"https:\/\/blogs.mathworks.com\/pick\/lazyweb-open-challenges\/\"><img decoding=\"async\" src=\"https:\/\/blogs.mathworks.com\/pick\/..\/images\/pick\/Lazy.jpg\" alt=\"lazy.jpg\" \/><br \/>\n<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This eleven minute video shows how you can make plots on two axes such that when one point of a pair is clicked, they both are highlighted.<br \/>\nIn this video you will see:<\/p>\n<p>LINE used instead of PLOT so&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2008\/01\/28\/practical-example-adding-callbacks-to-a-plot\/\">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":[8,6,2],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2109"}],"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=2109"}],"version-history":[{"count":1,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2109\/revisions"}],"predecessor-version":[{"id":7299,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/2109\/revisions\/7299"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=2109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=2109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=2109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}