diff --git a/examples/uglyPlot.m b/examples/uglyPlot.m index 8ebcac6..8d2e462 100644 --- a/examples/uglyPlot.m +++ b/examples/uglyPlot.m @@ -60,4 +60,4 @@ c2 = colorbar; c2.Title.String = 'Zscore'; -%prettify_plot; +prettify_plot; diff --git a/prettify_plot/prettify_colorbar.asv b/prettify_plot/prettify_colorbar.asv index 7d7a42f..221380a 100644 --- a/prettify_plot/prettify_colorbar.asv +++ b/prettify_plot/prettify_colorbar.asv @@ -29,7 +29,7 @@ for iColorBar = 1:length(colorbars) currColorbar.Title.String = ''; elseif ~isempty(currColorbar.XLabel.String) %x label string label = currColorbar.Xlabel.String; - currColorbar.Label.String = ''; + currColorbar.Xlabel.String = ''; else label = ''; end @@ -40,7 +40,8 @@ for iColorBar = 1:length(colorbars) currColorbar.Parent = colorbarProperties(iColorBar).Parent; currColorbar.Units = 'Points'; - currColorbar.Position = [400, colorbarProperties(iColorBar).Position_ori(2:4)]; % QQ hardcoded + colorbarProperties(iColorBar).Parent.Position + currColorbar.Position = [colorbarProperties(iColorBar).Position_ori(1)+35, colorbarProperties(iColorBar).Position_ori(2:4)]; % QQ hardcoded currColorbar.Label.String = colorbarProperties(iColorBar).Label;%QQ error - this doesn't work with XLabel. currColorbar.Label.Rotation = 270; % Rotate the label to be horizontal currColorbar.Label.Position = [3, 0.5, 0]; % You might need to adjust these values diff --git a/prettify_plot/prettify_colorbar.m b/prettify_plot/prettify_colorbar.m index d7ee0d7..bccdcef 100644 --- a/prettify_plot/prettify_colorbar.m +++ b/prettify_plot/prettify_colorbar.m @@ -39,14 +39,15 @@ function prettify_colorbar(colorbars, ChangeColormaps, DivergingColormap,... colorbarProperties(iColorBar).Position_ori = currColorbar.Position; currColorbar.Parent = colorbarProperties(iColorBar).Parent; - currColorbar.Units = 'Points'; - currColorbar.Position = [colorbarProperties(iColorBar).Position_ori(1)+35, colorbarProperties(iColorBar).Position_ori(2:4)]; % QQ hardcoded + %currColorbar.Units = 'Points'; + %colorbarProperties(iColorBar).Parent.Position + %currColorbar.Position = [colorbarProperties(iColorBar).Position_ori(1)+35, colorbarProperties(iColorBar).Position_ori(2:4)]; % QQ hardcoded currColorbar.Label.String = colorbarProperties(iColorBar).Label;%QQ error - this doesn't work with XLabel. currColorbar.Label.Rotation = 270; % Rotate the label to be horizontal currColorbar.Label.Position = [3, 0.5, 0]; % You might need to adjust these values currColorbar.Limits = colorbarProperties(iColorBar).Limits; - currColorbar.Units = 'Normalized'; % set back to normalized so it scales with figure + %currColorbar.Units = 'Normalized'; % set back to normalized so it scales with figure % add colorbar limits above and below % currColorbar.Title.String = num2str(colorbarProperties(iColorBar).Limits(2));