With the following code (simplified to a minimal working example), I am trying to create 4 subplots (scatterplots with marginal histograms), and I'd like the markers in each subplot to have different colors. However, to my surprise, there is always a small difference from the actual color requested. For instance, in the first case, rather than red (255,0,0), I could ascertain that my markers are a slightly different colour (255, 102, 102).
I tried debugging this in various ways but cannot figure out why this occurs. Can anyone help? I am using Matlab 2016B, on Windows 10, and have up to date graphics drivers installed. Thanks in advance!
h1 = figure;
markerColour_genrewise = 'red';
h2 = figure;
markerColour_genrewise = 'blue';
h3 = figure;
markerColour_genrewise = 'black';
h4 = figure;
markerColour_genrewise = 'white';
x = GMSI;
y = ratingsDiffs_avgAcrossExemplars(:, i_genre)';
h = scatterhist(x, y, 'NBins', [nbinsX nbinsY], 'MarkerSize', markerSize, 'Color', markerColour_genrewise);
set(gca,'linewidth', lineWidth, 'FontName', fontName)
mygca = get(gca,'children'); set(mygca,'markerfacecolor',markerColour_genrewise);
% irrelevant code followed here, deleted