How to prevent colorbar overlapping in the right y axis (matlab) -


First, I'm new to matlab

I have a scattered graphic that has two y axis.

I wanted to use a color palette on the east side of the figure, however, the color bar is overlapping on the right y axis and label.

  figmently = figure ('condition', [1, 1, 1200, 1200]); H1 = scatter (x, y1, 30, z) ;; [Enter image details here] [1] axis 1 = gca; Grid on hold (axis 1, 'all'); Ax2 = axes ('position', (ax1, 'position'), ... 'xx position', 'top', ... 'yaxis location', 'right', ... 'color', 'none '...' XColor ',' K ',' YColor ',' K ',' Fontesize ', 20); Grip (axis 2, 'all'); H2 = scatter (x, y2, 30, z, 'parent', ax2); T = color bar ('peer', gca); 1) I tried to reduce the width of the plot screen (not the figure) so that I had some space for the colorbar, but it did not work.  

2) I tried to increase the width of all the data screen, but the plot screen has also increased, so nothing changed.

I tried several status adjustment codes but I failed to figure out the concept out of the concept.

In short, I want to find a way to reduce the width of the plot screen so that there is enough space for dyeing.

Thank you very much in advance.

You can try to adjust your own length latitude ([XMIN XMAX YMIN YMAX]), expand your X-axis or xlim ([XMIN XMAX]) , and overlap to XMAX .

Otherwise, here's a bit of code that you want, it will work:

currentLimit = get (GCA, 'Exim')% Get the current from the X limit Axis (GCA) axis set (GCA), XLIM (current alimit (1), current limit (2) + 0.1 * current limit (2)]% set a new exclamation for the current axis

Hope that works!


Comments