Comments on: Improving graphics interactivity https://undocumentedmatlab.com/blog_old/improving-graphics-interactivity Charting Matlab's unsupported hidden underbelly Mon, 03 May 2021 17:10:12 +0000 hourly 1 https://wordpress.org/?v=4.4.1 By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-510654 Wed, 06 Jan 2021 11:01:17 +0000 https://undocumentedmatlab.com/?p=8723#comment-510654 drawnow is the entry function to Matlab graphics updates, which chains numerous internal drawing/painting calls, as well as associated callbacks (internal and user-defined). Memory leaks are possible, but the effect you see could also be attributed to other causes, such as newly-created/rendered graphics/GUI components that remain visible (i.e., the memory will remain used as long as the objects are displayed/alive). It’s too bad that Matlab gives users no insight into the memory and CPU aspects of drawnow, but that’s the way it is.

Going forward, please use the new variant of this site (https://undocumentedmatlab.com/articles or https://undocumentedmatlab.com) – not https://undocumentedmatlab.com/blog_old which is deprecated and is no longer maintained.

]]>
By: Ondrejhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-510653 Wed, 06 Jan 2021 10:40:20 +0000 https://undocumentedmatlab.com/?p=8723#comment-510653 Hi Yair,
I have a slightly off-topic question. I am using Matlab 2017a and when using drawnow to refresh the graphics I noticed in the profiler (with -memory option on) this:
Code Calls TotalTime AllocatedMemory FreedMemory PeakMemory
drawnow |4| 1.371s | 86955.17 Kb | 80.33 Kb | 79462.42 Kb

Does it mean that drawnow has a memory leak? Or that’s how Matlab preallocates the memory?
Thanks.

]]>
By: Collinhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-500868 Tue, 01 Oct 2019 00:35:09 +0000 https://undocumentedmatlab.com/?p=8723#comment-500868 A potential lightweight alternative to the standard axes toolbar is the FloatingPalette

hFTB = controllib.plot.internal.FloatingPalette(FigureHandle, ButtonList)

It’s not as pretty as the standard axes toolbar and has less button options but does not fade, works best for single axes figures.

You need to set the standard toolbar invisible or set it to empty before creating the floating palette.

hAxes.Toolbar.Visible = 'off';  % or:
hAxes.Toolbar = [];
]]>
By: Komutan Logarhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-500592 Sun, 29 Sep 2019 12:49:49 +0000 https://undocumentedmatlab.com/?p=8723#comment-500592 Thank you very much. I’m using dynamic plotting, moving particles, only one figure created as a digraph. The performance has slightly improved and I also didn’t need the toolbox and interactions(I removed them all) anyway. I would like to ask if it makes any difference if I remove the toolbox and interactions in the AxesCreationFcn or after the figure is created by using ax = gca; ax.Interactions = []; ?

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-485599 Fri, 05 Jul 2019 16:00:32 +0000 https://undocumentedmatlab.com/?p=8723#comment-485599 @Jeremiah – perhaps the default interactions are implemented only as the last step in the axes creation sequence, after the user-specified AxesCreationFcn callback has already executed.

]]>
By: Jeremiahhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-485598 Fri, 05 Jul 2019 15:26:07 +0000 https://undocumentedmatlab.com/?p=8723#comment-485598 I tried to run your function during a figure(…) creation and it removes the axes toolbar but it does not change the interactions. Those only work once the axes is already created and then I change them. But I’d like to have this automated, even in the startup.m script. Can you think of why the toolbar portion works but the interactions don’t while used as a defaultAxesCreationFcn ?

]]>
By: Doughttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-478997 Fri, 24 May 2019 12:26:02 +0000 https://undocumentedmatlab.com/?p=8723#comment-478997 I’d love to be able to customize the appearance of the axes toolbar rather than replacing it. Frustratingly my attempts have led to not very much success, I can move it from it’s current location fairly easily and resize it once it’s visible, but the size is reset every time the menu appears. I wonder if anyone else has had any success?

]]>
By: Yair Altmanhttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-478448 Tue, 21 May 2019 08:07:31 +0000 https://undocumentedmatlab.com/?p=8723#comment-478448 @Andreas – as far as I could see there is no change in R2019a.

]]>
By: Andreashttps://undocumentedmatlab.com/blog_old/improving-graphics-interactivity#comment-478442 Tue, 21 May 2019 07:23:03 +0000 https://undocumentedmatlab.com/?p=8723#comment-478442 Great article.

Do you know if something changed with R2019a? Is MathWorks working on this new “feature” and improving it?

]]>