why is there a random line extending outside plot boundaries?

When I plot the required data, there is a vertical line, which doesn't correspond to any values from input data and extends outside the plot boundaries (which I guess suggests it isn't an issue with the data itself). This did not happen in past versions of MATLAB but has persisted since updating to R2026a.
The code used is:
figure;
plot(TzedakisEtAl2018_FinalD18O_d13CStack.StackAge,TzedakisEtAl2018_FinalD18O_d13CStack.StackD18O___);
The x and y input data are from Columns 2 and 4 of Sheet 7 of the attached file, respectively.

3 个评论

Is this repeatable if you restart MATLAB or just a one-time aberration? If it is repeatable, post a minimal working example that reproduces the symptoms on your system so it can be seen if that can be reproduced since your supposition that it isn't actually coming from the data itself seems to be confirmed by @Star Strider here.
You could see if findall can uncover a spurious graphics object in the figure. If all else fails, this is then probably a candidate for a support ticket to see if MathWorks can reproduce the issue; if not it is likely a graphics driver issue of some sort.
About 2½ years ago, a user experienced a similar issue, and @Adam Danz diagnosed it as possibly being related to a bug in the OpenGL renderer. For details, please refer to this thread:
You may also want to check the output returned by rendererinfo() for troubleshooting purposes.
ax = gca();
r = rendererinfo(ax)
r.Details
If I remember correctly, MATLAB now uses the WebGL renderer, and has at least since R2025a.
rendererinfo
ans = struct with fields:
GraphicsRenderer: 'WebGL' Vendor: 'Google Inc. (Google)' Version: 'WebGL 2.0 (OpenGL ES 3.0 Chromium)' RendererDevice: 'ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver)' Details: [1×1 struct]
.

请先登录,再进行评论。

回答(1 个)

figure
imshow(imread('Screenshot 202... 19.22.50.png'))
T1 = readtable('Tzedakis et al 2018.xlsx', Sheet=7, VariableNamingRule='preserve')
T1 = 1582×4 table
Stack depth Stack age Stack d13C (‰) Stack d18O (‰) ___________ _________ ______________ ______________ 48.22 108 -1.62 -4.67 48.25 108.02 -1.4 -4.8 48.3 108.04 -1.53 -4.83 48.34 108.05 -1.5 -4.82 48.37 108.07 -1.52 -4.72 48.41 108.09 -1.62 -4.58 48.46 108.11 -1.62 -4.6 48.55 108.16 -1.63 -4.55 48.61 108.18 -1.61 -4.82 48.7 108.21 -1.64 -4.53 48.85 108.32 -1.64 -4.63 48.96 108.44 -1.58 -4.52 49.02 108.54 -1.49 -4.4 49.06 108.62 -1.53 -4.48 49.09 108.7 -1.45 -4.58 49.11 108.73 -1.36 -4.31
VN = T1.Properties.VariableNames
VN = 1×4 cell array
{'Stack depth'} {'Stack age'} {'Stack d13C (‰)'} {'Stack d18O (‰)'}
x = T1.(2);
y = T1.(4);
figure
plot(x, y)
% grid
xlabel(VN{2})
ylabel(VN{4})
It's not clear to me how you read the file, since only the plot call is presented. I'm not certain what could have caused the vertical line.
I cannot reproduce that error in R2026a using the provided data.
.

类别

帮助中心File Exchange 中查找有关 Graphics Performance 的更多信息

产品

提问:

2026-9-18,18:22

评论:

2026-9-19,17:27

Community Treasure Hunt

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

Start Hunting!

Translated by