Strange brown color appears in saturated data points in parula colormap (R2015a for Win)

1 view (last 30 days)
On R2015a for Windows, I noticed strange behaviour of the parula colormap.
[X,Y,Z] = peaks(25);
shading interp
axs = gca;
>> axs.CLim
ans =
-6.3265 7.9966
So far so good. However, when I try the following
axs.CLim = [-6 0];
I've got this. The ugly brown area, which are saturated, is supposed to be bright yellow.
I saved this figure in jpeg format, and opened it on Mac. It just looks the same, excluding the possibility that my Windows machine's color representation is somehow messed up.
With the same code, I could not reproduce the result on MATLAB R2015b for Mac (see below). Not sure it has been fixed in R2015b (could not find related information in Release note) or it's related to Windows environment or my particular Windows environment.
So, it appears a bug to me. Has any one experienced the same phenomenon? Is there any work around? At the moment, I'm mainly using R2015a for Win, and having a problem in installing R2015b for Win. So this is rather frustrating.

Accepted Answer

Kouichi Nakamura
Kouichi Nakamura on 6 Nov 2015
Customer Support taught me a workaround for this.
h = figure;
[X,Y,Z] = peaks(25);
shading interp
axs = gca;
axs.CLim = [-6 0];
h.Renderer = 'painters';
This really worked well on VMware Fusion 8.

More Answers (1)

Kouichi Nakamura
Kouichi Nakamura on 6 Nov 2015
Edited: Kouichi Nakamura on 6 Nov 2015
I have asked about the same issue via the customer support. Below is an excerpt from their reply. They think this is a bug related to software OpenGL.
"We apologize for the inconvenience caused. We believe this is a bug related to rendering with "Software OpenGL".
What is "Software OpenGL" : In rendering a figure using OpenGL, MATLAB supports two ways, through graphics hardware and software OpenGL on Linux and Windows system. On Mac OS, MATLAB always uses hardware functionality.
By default in Windows/Linux, MATLAB uses hardware OpenGL if your graphics hardware supports it. However, in a virtual environment as in VMware, MATLAB automatically switches to software OpenGL.
I have reported the issue to the development team and the team is investigating the issue. Unfortunately, there is no workaround at the moment as long as software openGL is being used. You mentioned the issue was not reproduced on R2015b at your end. We believe this is because you launched R2015b on Mac OS system (not using software OpenGL rendering).
If there is graphics hardware support in your VMware, you might try staring MATLAB with the '-nosoftwareopengl' option to force hardware OpenGL."
In MATLAB R2015a, I typed the following command to force the hardware version of OpenGL to be used.
opengl hardware
Then here is the outcome of the same code as above. Obviously, it is not great either.
I obtained details about software and hardware OpenGL:
>> opengl software
>> opengl info
Version: '1.1.0'
Vendor: 'Microsoft Corporation'
Renderer: 'GDI Generic'
MaxTextureSize: 1024
Visual: 'Visual 0x7a, (RGB 24 bits (8 8 8), Z depth 16 bits, Software, Single buffer, Antialias 0 samples)'
Software: 'true (known graphics driver issues)'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {3x1 cell}
MaxFrameBufferSize: 0
>> opengl hardware
>> opengl info
Version: '3.0 Mesa 10.6.0 (git-beb7765)'
Vendor: 'VMware, Inc.'
Renderer: 'Gallium 0.4 on SVGA3D; build: RELEASE; LLVM;'
MaxTextureSize: 16384
Visual: 'Visual 0x09, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antial...'
Software: 'false (known graphics driver issues)'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {176x1 cell}
MaxFrameBufferSize: 16384
It seems that although hardware-accelerated OpenGL 3.0 is available in my system, it somehow does not work with MATLAB and software OpenGL 1.1.0 is used instead to produce the poor images.


Community Treasure Hunt

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

Start Hunting!