help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Coloring grid spaces in a 2D by index


From: Brett Green
Subject: Re: Coloring grid spaces in a 2D by index
Date: Tue, 2 Jul 2019 20:16:41 -0400

It would also be very nice if I could have some areas discretely colored, but others mixed. For example, I would like to keep the blue, red, green and orange regions for minindex(m,j)==1,2,3,4, but the case currently colored black and assigned minindex(m,j)==5 would be better represented as a mixture of red and blue which continuously interpolates between them, as minindex(m,j) takes noninteger values between 1 and 2 (which are the integers which are colored with blue and red).

I've had another idea: superimposing plots with different colormaps. That would allow me to have one colormap with just a few discrete colors in one plot, and then a different colormap for the blue-to-red continuum. I'll try that and send an update if I get something to work.

- Brett Green


On Tue, Jul 2, 2019 at 5:37 PM Brett Green <address@hidden> wrote:
Thank you!

I mentioned in my first question that I had trouble with pcolor, but maybe I can get it to work the way I need if I write a custom colormap with 6 entries. I haven't played with colormaps much, so I'm not sure if it'll work, but I suppose it's worth a shot.

imshow would be good if I could control the axes. I definitely need to have a set of coordinates to go along with the plot, but I didn't see anything about that for imshow in the documentation. Since it's meant for image processing, I didn't really expect anything, though.

- Brett Green


On Tue, Jul 2, 2019 at 3:20 PM Carlo De Falco <address@hidden> wrote:


> Il giorno 02 lug 2019, alle ore 19:48, BGreen <address@hidden> ha scritto:
>
> I would like to have a grid in which each box is filled with a color
> corresponding to a value. What is the best way to do this?


you may want to try the commands pcolor[1], or imshow[2],
hope this helps,
c.

[1] https://octave.org/doc/interpreter/Two_002dDimensional-Plots.html#XREFpcolor
[2] https://octave.org/doc/interpreter/Displaying-Images.html#XREFimshow



reply via email to

[Prev in Thread] Current Thread [Next in Thread]