2-D plots don't render correctly in Figures window

All of my plots have had these strange rendering issues for a few days, but appears fine when I download the plot as an image. I'm worried it has something to do with my OS and nothing with Matlab. I am running Ubuntu 22.04.5 LTS and MATLAB R2025a
Here is a screenshot of my workstation. Notice that the 2D plot of the sine wave does not generate correctly
Here is the figure saved as a .png; same issue:
And here is a screenshot of the figure exported as a PDF, which renders the graph correctly:

 Accepted Answer

The work-around is to use a LineWidth small enough that the line comes out one pixel thick

3 Comments

That's too bad. Just reported the bug. My work around has been to immediately export my plots as PDFs to my working directory
Edit: an even simpler work around is just hitting the 'Print' button whenever I want to view a graph
Edit to my edit: This only seems to work if the plot is relatively 'simple', but I'm strill trying to qualify what that means. For example, if you plot a sine wave with 10,000 points and hit print, it will render fine. But if you overlay 10 such sine waves, the render will break after adding 9 of them.
However this is an incomplete thought because if you increase the number of points to 1,000,000, all 10 sine waves will render just fine. I'm probably failing to control my variables, but you should have some success with the print trick if your graphs are simple.
Matt J
Matt J on 23 Jul 2025
Edited: Matt J on 23 Jul 2025
But why is Ubuntu more prone to this bug? There is a distinct pattern of Ubuntu users encountering the problem. Has it been reported by any Windows users at all?
Datapoint: this problem does not happen on my low resolution (1920 x 1280) Windows 11 machine.
Datapoint: this problem does occur in my Windows 10 virtual machine hosted on MacOS 15.3, with about 2800 x 1800 resolution. Which is enough resolution for the High Resolution processing to kick in.

Sign in to comment.

More Answers (0)

Categories

Find more on Specifying Target for Graphics Output in Help Center and File Exchange

Products

Release

R2025a

Community Treasure Hunt

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

Start Hunting!