How can I speed up image manipulation of a .fig?

3 views (last 30 days)
A collaborator sent me a .fig file depicting about 5000 points connected to their nearest neighbors by short line segments. It is meant to be representative of several units cells' worth of a crystal lattice. I do not have the details on how the figure was generated, but I can open it in Matlab.
When I open it on my laptop, it is painfully slow to rotate, zoom in, or pan the figure. This is to be expected because it is running an 8 year old i5 processor with integrated graphics. However, when I use my personal desktop with an excellent graphics card and 8-core i9, the speed of manipulating the figure is exactly the same.
I would like to know if there is a way to speed up manipulation of this .fig on either computer, or to somehow give Matlab access to my desktop's better processing power.
  2 Comments
Walter Roberson
Walter Roberson on 4 Apr 2022
Are all of the line segments the same color and same marker (if markers are used)?

Sign in to comment.

Answers (2)

Jan
Jan on 4 Apr 2022
Maybe. How is your OpenGL driver set up?
opengl info
Which Shading and Renderer in used in the figure?
Can you provide the figure?
  1 Comment
Shannon Bernier
Shannon Bernier on 4 Apr 2022
I don't think I can provide the figure as I'm not sure if my collaborator wants it distributed online yet. Will check.
opengl info
Version: '4.5.14800 Compatibility Profile Context 22.3.1 30.0.15002.1004'
Vendor: 'ATI Technologies Inc.'
Renderer: 'AMD Radeon RX 5700 XT'
RendererDriverVersion: '30.0.15002.1004'
RendererDriverReleaseDate: '09-Mar-2022'
MaxTextureSize: 16384
Visual: 'Visual 0x08, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 8 samples)'
Software: 'false'
HardwareSupportLevel: 'full'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {306×1 cell}
MaxFrameBufferSize: 16384
opengl is the renderer. Not sure how to check the Shading.

Sign in to comment.


Walter Roberson
Walter Roberson on 5 Apr 2022
The following code replaces the lines for each axes with a single continuous line object that uses NaN to break up the pieces. It assumes that all the lines of an axes are the same size and color. It does not assume that there is only one axes. The idea is that the problem might be that there are too many plot objects to draw effectively.
This code makes no attempt to be "smart" about joining the lines.
fig = openfig('NameOfFigureFile.fig');
all_ax = findobj(fig, 'type', 'axes');
for ax = all_ax(:).'
these_lines = findobj(ax, 'type', 'line');
if isempty(these_lines); continue; end
xdc = get(these_lines, 'XData').';
xdc(2,:) = {nan};
xd = [xdc{:}];
ydc = get(these_lines, 'YData').';
ydc(2,:) = {nan};
yd = [ydc{:}];
lw = these_lines(1).LineWidth
st = hold(ax, 'on');
plot(ax, xd, yd, 'k-', 'LineWidth', lw);
hold(ax, st)
delete(these_lines);
end
  1 Comment
Shannon Bernier
Shannon Bernier on 8 Apr 2022
Thanks for the suggestion, however this did not speed up the figure manipulation noticeably. The quality of the figure was the same, though.

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!