Warnings when Drawing Figures in App Designer
23 views (last 30 days)
Show older comments
Hello,
I'm building an audio analysis app in Matlab App Designer. I'm seeing a warning in the command window when a particular figure is generated.
Warning: An error occurred while drawing the scene: Error in web pick traversal: RangeError: Array buffer allocation failed
This warning repeats, filling the command window completely, and the figure never plots.
The warning is triggered by a button down event, which calls a function that plots a heatmap to app.UIAxes using surf(x, y, C). It seems to be an intermittent issue though. It happens most reliably when the size of C is large [2400 x 50000]. When C is [2400 x 10000], and all other variables are held constant, the figure is rendered with no error.
I have had similar issues rendering plots from large variables before on this computer (Windows 10), and have resolved these by forcing MATLAB to use Painter rather than OpenGL. From what I understand though, App Designer uses WebGL to render figures, and I haven't found a way to override this.
It has occurred to me that this warning may only be happening because my machine does not have a dedicated graphics card (It has an Intel Iris). Once deployed, this app needs to run reliably on a wide range of machines, so it does need to work on machines with Iris and similar graphics cards.
I do not need the 3D capabilities of surf(), and so I simply set 'View' to [90 90]. I thought that perhaps using some other (2D only) figure function might work better than surf(). So far none have been appropriate for my application. My preference is to use imagesc(), but I need to be able to scale the Y-axis coordinates of the image logarithmically, and imagesc does not support this. I tried pcolor() but it resulted in even more rendering issues, even with data "C" that is smaller than [2400 x 10000].
Thanks in advance for your help!
1 Comment
Adam Danz
on 19 Jan 2023
This will be difficult to troubleshoot here in the forum.
Please contact tech support and include your app, information about your machine, and instructions how to reproduce the problem.
Answers (1)
Amal Raj
on 13 Mar 2023
This should override the renderer to painter:
app.UIAxes.Renderer = 'painters';
See Also
Categories
Find more on Graphics Performance in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!