Plot a Colour Wheel scale

32 visualizaciones (últimos 30 días)
JMS
JMS el 8 de Abr. de 2014
Comentada: Image Analyst el 15 de Abr. de 2014
Hello! Please, can anyone tell how I can plot a Colour Wheel scale from specific data?
For example, if I have a [y,z] = meshgrid(-5: .35: 5, -5: .35: 5); Or [y,z] = meshgrid(-2: .1: 2, -2: .1: 2);
I also have attached file for example. Thanks in advance.

Respuesta aceptada

Image Analyst
Image Analyst el 8 de Abr. de 2014
See my attached demo. It does that.
  3 comentarios
Image Analyst
Image Analyst el 9 de Abr. de 2014
It's one of the images it plots. If you want to mask it by a circle to make it round instead of square, you can use code from the FAQ to do that: http://matlab.wikia.com/wiki/FAQ#How_do_I_create_a_circle.3F
JMS
JMS el 10 de Abr. de 2014
That is better and helps more.
Thanks.

Iniciar sesión para comentar.

Más respuestas (1)

Kelly Kearney
Kelly Kearney el 9 de Abr. de 2014
A simpler way:
r = linspace(0,1,10);
theta = linspace(0, 2*pi, 100);
[rg, thg] = meshgrid(r,theta);
[x,y] = pol2cart(thg,rg);
pcolor(x,y,thg);
colormap(hsv);
shading flat;
axis equal;
  20 comentarios
Kelly Kearney
Kelly Kearney el 15 de Abr. de 2014
Aaaaaah!
You've used the phrase "have the color wheel in RGB from the quiver plot data" several times now, and it remains just as meaningless as before.
Your quiver plot has absolutely nothing to do with a color wheel. You can create a pretty picture of a color wheel several ways (such as the examples ImageAnalyst and I gave) using Matlab. Or you could pull out a piece of paper and some crayons and draw one there. But it's still just a pretty picture, and it has no connection to your quiver plot data.
I gave an example of how to plot directional data by color, overlaid with a quiver plot, and then I drew a small wheel next to it as a guide. Is that even remotely close to what you're looking for?
Image Analyst
Image Analyst el 15 de Abr. de 2014
(Sound of hand slapping forehead) Yeah, I'm pretty much baffled too, and about to give up. I don't even know that he has vector field data. He just takes a vector spanning a certain range in x and certain range in Y, calls meshgrid and calls that his vector field. It's totally made up/synthesized. JMS do you have any actual real world data?
It sounds like JMS wants to create a color wheel but instead of using the normal values and ranges required to produce one (like I did), he wants to use some special specified range (-2 to +2) for some unknown reason. OK, well, if you insist on doing that, then you're going to have to transform those into the range that is required, and then create the wheel picture. Of course that could all be wrong since I don't know what he wants.
Maybe he wants to create an image of the velocity according to the equations, and just simply apply a colormap to it:
% First create velocityImage from equations. Then:
imshow(velocityImage);
colormap('hsv');
colorbar;
You don't get a pretty perfect color wheel but what you do get is an image where the color corresponds to the magnitude of the velocity.

Iniciar sesión para comentar.

Categorías

Más información sobre Red en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by