MATLAB Answers


Color Bar goes Crazy for Multiple Plots in same axes

Asked by John
on 4 Oct 2012

What I am plotting is a slice of data (a contour plot), perpendicular to an image that shows the ground surface. If I use a colorbar just plotting the contour plot, I don't have any problems. However, if I have both the image and the contour plot, the color bar goes crazy. it fills the whole figures window with numbers and "x y z" like a matrix. Has anyone encountered this? Is there a way to just associate a colorbar with a single plot when the axes has multiple plots?

  1 Comment

I realize now that what it does is multiply all of the labels. so if I remove the x-labels, x-ticks, etc, it doesn't have the same problem. I would like to keep the labels on of course, only one instance of each rather than dozens. It also multiplies things I added to the plot with text(). This is very strange behavior.


No products are associated with this question.

1 Answer

Answer by John
on 4 Oct 2012
 Accepted answer

Ok, many thanks to the folks at Matlab support. fixed this problem for me. the problem is with the opengl renderer. Because my figure has transparency, it was necessary to use opengl, but, by switching to software and off the graphics card using the command:

opengl software

The issue was fixed.


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!