When I export a 2D surface plot with a colorbar from MATLAB to a png file, it results in corrupted images when I use the opengl hardware renderer, as seen here:
Everything else is working fine. But after I created one figure with a colorbar, all other surface plots that I export to png files are corrupted, even if they don't contain any colorbars.
opengl info
in MATLAB gives the following output:
Version = 3.0 Mesa 10.1.0
Vendor = Intel Open Source Technology Center
Renderer = Mesa DRI Intel(R) Haswell Desktop
MaxTextureSize = 8192
Visual = 0x20 (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)
Software = false
# of Extensions = 190
Driver Bug Workarounds:
OpenGLBitmapZbufferBug = 0
OpenGLWobbleTesselatorBug = 0
OpenGLLineSmoothingBug = 0
OpenGLClippedImageBug = 0
OpenGLEraseModeBug = 0
I tried all these OpenGL workarounds but nothing helped.
Has anybody an idea how to resolve this issue?
My system:
On my colleague's computer, which is exactly the same, but has a different OS (debian wheezy) this problem is not appearing. On his computer opengl info
gives:
Version = 2.1 Mesa 8.0.5
Vendor = VMware, Inc.
Renderer = Gallium 0.4 on llvmpipe (LLVM 0x209)
MaxTextureSize = 4096
Visual = 0xfc (TrueColor, depth 24, RGB mask 0xff0000 0xff00 0x00ff)
Software = false
# of Extensions = 143
Driver Bug Workarounds:
OpenGLBitmapZbufferBug = 0
OpenGLWobbleTesselatorBug = 0
OpenGLLineSmoothingBug = 0
OpenGLClippedImageBug = 0
OpenGLEraseModeBug = 0
Could it be that in his case it works because Gallium/llvmpipe
is a software renderer in reality?
What's the problem with the colorbar?
Unfortunately, MATLAB isn't fantastic when it comes to standardisation, the problem with colour map is that when saved or not used with something other than MATLAB, the encoded image isn't saved or generated for easy use for other applications because MATLAB optimises the mapping for MATLAB applications only, if I do find an example that can help you I'll edit my answer but I hope this sheds some light on your problem.
Otherwise its matlabs fault and it isn't saving images correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With