{"id":4613,"date":"2013-06-07T09:00:31","date_gmt":"2013-06-07T13:00:31","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=4613"},"modified":"2013-06-07T09:17:21","modified_gmt":"2013-06-07T13:17:21","slug":"plot-real-big","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2013\/06\/07\/plot-real-big\/","title":{"rendered":"Plot (real) Big"},"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\/40790-plot--big-\">Plot (Big)<\/a> by my co-worker <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/225094\">Tucker McClure<\/a>.<\/p><p>\"Big data\"<\/p><p>That seems to be the buzz lately. But when people say \"big data\", it could mean a lot of things.<\/p><div><ul><li>Storing big data<\/li><li>Loading big data<\/li><li>Saving big data<\/li><li>Visualizing big data<\/li><li>Analyzing big data<\/li><li>Manipulating big data<\/li><li>etc.<\/li><\/ul><\/div><p>This entry by Tucker is all about \"visualizing\" big data. This was a <a href=\"https:\/\/blogs.mathworks.com\/pick\/2013\/05\/31\/nominate-your-favorite-new-file-exchange-submission\/#comment-22726\">recommendation<\/a> from another one of my co-workers, Adam.<\/p><p><b>Visualizing Big Datasets<\/b><\/p><p>One of the issues with visualizing big datasets is that you have so many points displayed on the screen, and exploring (zooming and panning) may become sluggish. It's nice that you have all of those points available, but your screen has only so many pixels, and you don't get additional information by putting more points than what the screen is able to display.<\/p><p>So what can you do? Well, you can choose to display fewer points, just enough to give you a sense of what the dataset looks like. But then, you'd like to be able to see the details if you zoom in. It's sort of like Google Maps, for instance; when you're zoomed out, you see a rough outline of the city and some major highways. When you zoom in, you start to see some of the local roads.<\/p><p>Can we do something like this with MATLAB plots? I created something like that for <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/15850-dsplot-downsampled-plot\">line plots<\/a>. <a href=\"https:\/\/blogs.mathworks.com\/videos\/\">Doug<\/a> even wrote a <a href=\"https:\/\/blogs.mathworks.com\/pick\/2007\/08\/06\/downsampling-data-for-faster-plotting\/\">Pick<\/a> on it. However, that was more of a proof-of-concept that worked for only 2D line plots. Tucker went all the way. He implemented this using <a href=\"https:\/\/www.mathworks.com\/help\/matlab\/object-oriented-programming.html\">MATLAB Classes<\/a>, and it could be applied to other plot types. You could also call it with additional arguments that you might pass into these plotting commands. Here are some additional things I like about Tucker's entry:<\/p><div><ul><li>Nice documentation for the class<\/li><li>An extensive set of examples<\/li><li>A convenience function <tt>reduce_plot<\/tt> which allows you to use this class like a function, returning handles to the plot<\/li><li>A companion class for converting your figure to an interactive explorer, which allows you to zoom and pan by using your scroll wheel and left-click dragging, respectively<\/li><\/ul><\/div><p>Here's a quick animation of <tt>reduce_plot<\/tt> in action, compared to a regular plot. You can see the difference in responsiveness of the plot when I am trying to pan the plot.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/pick\/jiro\/potw_plotbig\/potw_plotbig_animation.gif\" alt=\"\"> <\/p><p>Thanks for an awesome entry, Tucker. And thanks for the recommendation, Adam. Some swag going to both of you!<\/p><p><b>Comments<\/b><\/p><p>We'd like to hear from you if you do, or are interested in, big data visualization. What kind of visualization do you use? Do you use any special techniques to deal with your big data? Give this a try and let us know what you think <a href=\"https:\/\/blogs.mathworks.com\/pick\/?p=4613#respond\">here<\/a> or leave a <a href=\"https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40790-plot--big-#comments\">comment<\/a> for Tucker.<\/p><script language=\"JavaScript\"> <!-- \r\n    function grabCode_5d53a36b3d29484e81c06d2b4dfb1f0b() {\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='5d53a36b3d29484e81c06d2b4dfb1f0b ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 5d53a36b3d29484e81c06d2b4dfb1f0b';\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 2013 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_5d53a36b3d29484e81c06d2b4dfb1f0b()\"><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; R2013a<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; R2013a<br><\/p><\/div><!--\r\n5d53a36b3d29484e81c06d2b4dfb1f0b ##### 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\/40790-plot--big- Plot (Big)>\r\n% by my co-worker\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/authors\/225094\r\n% Tucker McClure>.\r\n%\r\n% \"Big data\"\r\n%\r\n% That seems to be the buzz lately. But when people say \"big data\",\r\n% it could mean a lot of things.\r\n%\r\n% * Storing big data\r\n% * Loading big data\r\n% * Saving big data\r\n% * Visualizing big data\r\n% * Analyzing big data\r\n% * Manipulating big data\r\n% * etc.\r\n%\r\n% This entry by Tucker is all about \"visualizing\" big data. This was a\r\n% <https:\/\/blogs.mathworks.com\/pick\/2013\/05\/31\/nominate-your-favorite-new-file-exchange-submission\/#comment-22726\r\n% recommendation> from another one of my co-workers, Adam.\r\n%\r\n% *Visualizing Big Datasets*\r\n%\r\n% One of the issues with visualizing big datasets is that you have so\r\n% many points displayed on the screen, and exploring (zooming and panning)\r\n% may become sluggish. It's nice that you have all of those points\r\n% available, but your screen has only so many pixels, and you don't get\r\n% additional information by putting more points than what the screen is\r\n% able to display.\r\n%\r\n% So what can you do? Well, you can choose to display fewer points, just\r\n% enough to give you a sense of what the dataset looks like. But then,\r\n% you'd like to be able to see the details if you zoom in. It's sort of\r\n% like Google Maps, for instance; when you're zoomed out, you see a rough\r\n% outline of the city and some major highways. When you zoom in, you start\r\n% to see some of the local roads.\r\n%\r\n% Can we do something like this with MATLAB plots? I created something like\r\n% that for <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/15850-dsplot-downsampled-plot line\r\n% plots>. <https:\/\/blogs.mathworks.com\/videos\/ Doug> even wrote a\r\n% <https:\/\/blogs.mathworks.com\/pick\/2007\/08\/06\/downsampling-data-for-faster-plotting\/\r\n% Pick> on it. However, that was more of a proof-of-concept that worked for\r\n% only 2D line plots. Tucker went all the way. He implemented this using\r\n% <https:\/\/www.mathworks.com\/help\/matlab\/object-oriented-programming.html\r\n% MATLAB Classes>, and it could be applied to other plot types. You could\r\n% also call it with additional arguments that you might pass into these\r\n% plotting commands. Here are some additional things I like about Tucker's\r\n% entry:\r\n%\r\n% * Nice documentation for the class\r\n% * An extensive set of examples\r\n% * A convenience function |reduce_plot| which allows you to use this class\r\n% like a function, returning handles to the plot\r\n% * A companion class for converting your figure to an interactive\r\n% explorer, which allows you to zoom and pan by using your scroll wheel and\r\n% left-click dragging, respectively\r\n%\r\n% Here's a quick animation of |reduce_plot| in action, compared to a\r\n% regular plot. You can see the difference in responsiveness of the plot\r\n% when I am trying to pan the plot.\r\n%\r\n% <<potw_plotbig_animation.gif>>\r\n%\r\n% Thanks for an awesome entry, Tucker. And thanks for the recommendation,\r\n% Adam. Some swag going to both of you!\r\n%\r\n% *Comments*\r\n%\r\n% We'd like to hear from you if you do, or are interested in, big data\r\n% visualization. What kind of visualization do you use? Do you use any\r\n% special techniques to deal with your big data? Give this a try and let\r\n% us know what you think <https:\/\/blogs.mathworks.com\/pick\/?p=4613#respond\r\n% here> or leave a\r\n% <https:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/40790-plot--big-#comments\r\n% comment> for Tucker.\r\n\r\n##### SOURCE END ##### 5d53a36b3d29484e81c06d2b4dfb1f0b\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_plotbig\/potw_plotbig_animation.gif\" onError=\"this.style.display ='none';\" \/><\/div><p>\r\n\r\nJiro's pick this week is Plot (Big) by my co-worker Tucker McClure.\"Big data\"That seems to be the buzz lately. But when people say \"big data\", it could mean a lot of things.Storing big... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2013\/06\/07\/plot-real-big\/\">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\/4613"}],"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=4613"}],"version-history":[{"count":12,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4613\/revisions"}],"predecessor-version":[{"id":4618,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/4613\/revisions\/4618"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=4613"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=4613"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=4613"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}