Plot Lines Displaying As Black (Plus Gradient?)
3 次查看(过去 30 天)
显示 更早的评论
I recently installed R2016a after having to replace my hard drive. Since then, every plot I draw comes out with what at first glance appear to be black lines, but on closer inspection appear to have a slight color gradient on them
For example, the following code:
x = linspace(0,2*pi,100);
y = sin(x);
figure
plot(x,y)
generates the following figure:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158701/image.png)
This happens when I plot multiple series, too - even if I try and override the default color order. Legends display the correct colors, but the data series in the figure don't. The following image uses this color order command:
set(gcf,'DefaultAxesColorOrder', [0 0 1; 1 0 0; 0 0.5 0; 0 0.75 0])
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/158702/image.png)
Both of these worked correctly on older versions of MATLAB, including most recently R2015b (on the old hard drive on this computer).
I can't find anything in the Preferences dialogue that would affect this. Can anyone offer any advice on how to fix it? I have a conference coming up, and I need to make these figures presentable.
0 个评论
采纳的回答
更多回答(2 个)
Aaron Powers
2016-4-1
I agree, that sounds funny! Have you tried in a freshly restarted MATLAB, and check to make sure you haven't added anything to the path? For example, you might want to make sure you don't have an "startup.m" that's adding anything to your path that might be affecting this.
Mike Garrity
2016-4-1
Any chance this is an Intel GPU? That looks a lot like a bug we've seen in one of their recent driver updates.
If so, there are a couple of options.
- Try installing a different version of the graphics driver. I'm afraid I don't remember the # of the bad one.
- As Andrew said, switching to the software OpenGL implementation.
- Keeping hardware opengl, but disabling the shaders using this command:
opengl hardwarebasic
Previous versions of MATLAB didn't user shaders much, so they are less prone to hitting this bug.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Graphics Performance 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!