As commented in your question, note that you're only plotting one slice of the 3D colour space.
Of course, your original code doesn't work, you end up doing
so you're only plotting the hue (angle) against x and y. There's no saturation or value information in your plot. You then apply a colour map called hsv whose colours are derived from the hsv cylinder, but in no way does it mean you've done any conversion to/from hsv. The whole idea is flawed.
Here is how I'd do it:
plotradius = 100;
plotvalue = 1;
[x, y] = meshgrid(-plotradius:plotradius);
[hue, saturation] = cart2pol(x, y);
hue = (hue + pi) / (2*pi);
saturation = saturation / plotradius;
value = ones(size(hue)) * plotvalue;
outsidedisk = saturation > 1;
saturation(outsidedisk) = 0;
value(outsidedisk) = 1;
rgb = hsv2rgb(cat(3, hue, saturation, value));
imshow(rgb);
Best Answer