{"id":6224,"date":"2015-10-16T09:00:49","date_gmt":"2015-10-16T13:00:49","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=6224"},"modified":"2015-10-15T02:55:54","modified_gmt":"2015-10-15T06:55:54","slug":"floating-bubbles","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2015\/10\/16\/floating-bubbles\/","title":{"rendered":"Floating Bubbles"},"content":{"rendered":"\r\n\r\n<div class=\"content\"><p><a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\">Jiro<\/a>'s pick this week is <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/53-shift\">Bubblegum Plot<\/a> by <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1618794\">Job<\/a>.<\/p><p>A fun post for you guys this week.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_bubblegumplot\/bubble.gif\" alt=\"\"> <\/p><p>As soon as I saw this entry, which creates bubblegum-looking scatter plots, I wanted to make this floating bubbles animation. I modified Job's entry a little bit to return a handle of <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/patch.html\"><tt>patch<\/tt><\/a> objects, so that I could continuously change the locations of the bubbles in a <a href=\"https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/for.html\"><tt>for<\/tt> loop<\/a>.<\/p><p><b>Comments<\/b><\/p><p>Let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=6224#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/53-shift#comments\">comment<\/a> for Job.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_a19f2bcd1450413db320e76904d7bf10() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='a19f2bcd1450413db320e76904d7bf10 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' a19f2bcd1450413db320e76904d7bf10';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2015 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_a19f2bcd1450413db320e76904d7bf10()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2015b<br><\/p><\/div><!--\r\na19f2bcd1450413db320e76904d7bf10 ##### SOURCE BEGIN #####\r\n%%\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/15007\r\n% Jiro>'s pick this week is\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/53-shift Bubblegum\r\n% Plot> by <https:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/1618794\r\n% Job>.\r\n%\r\n% A fun post for you guys this week.\r\n%\r\n% <<bubble.gif>>\r\n%\r\n% As soon as I saw this entry, which creates bubblegum-looking scatter\r\n% plots, I wanted to make this floating bubbles animation. I modified Job's\r\n% entry a little bit to return a handle of\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/patch.html\r\n% |patch|> objects, so that I could continuously change the locations of\r\n% the bubbles in a\r\n% <https:\/\/www.mathworks.com\/help\/releases\/R2015b\/matlab\/ref\/for.html |for|\r\n% loop>.\r\n%\r\n% *Comments*\r\n%\r\n% Let us know what you think\r\n% <https:\/\/blogs.mathworks.com\/pick\/?p=6224#respond here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/53-shift#comments\r\n% comment> for Job.\r\n\r\n##### SOURCE END ##### a19f2bcd1450413db320e76904d7bf10\r\n-->","protected":false},"excerpt":{"rendered":"<div class=\"overview-image\"><img decoding=\"async\"  class=\"img-responsive\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_bubblegumplot\/bubble.gif\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n\r\nJiro's pick this week is Bubblegum Plot by Job.A fun post for you guys this week. As soon as I saw this entry, which creates bubblegum-looking scatter plots, I wanted to make this floating... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2015\/10\/16\/floating-bubbles\/\">read more >><\/a><\/p>","protected":false},"author":35,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6224"}],"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\/35"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=6224"}],"version-history":[{"count":4,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6224\/revisions"}],"predecessor-version":[{"id":6228,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/6224\/revisions\/6228"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=6224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=6224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=6224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}