help-octave
[Top][All Lists]
Advanced

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

Re: defining colors


From: Ben Abbott
Subject: Re: defining colors
Date: Sat, 12 Nov 2011 16:15:36 -0500

On Nov 12, 2011, at 2:44 PM, Juan Pablo Carbajal wrote:

> On Sat, Nov 12, 2011 at 5:37 PM, Eduardo J. Adam <address@hidden> wrote:
>> Dear octave users,
>> Is It possible to define different colors to the traditional colors used by
>> the command plot,  by means of mixing red, blue and green colors and then,
>> use this new color for a plot?
>> How can I do that?
>> 
>> Eduardo
>> 
> 
> Sure!
> 
> colors are defined with a 3x1 vector each element between 0 and one or
> 0 and 255 depending on the function. The first element is the amount
> of red, second green, and third is blue.
> To plot with and arbitrary color just do
> 
> plot(rand(10,1),'-o', 'color', [0.8 0.2 0.2])
> 
> I hope this helps

You can also set the order of plot colors in the axes properties. For example,

        set (gcf, "colororder", jet (11))

This will define 11 colors using the jet() colormap.  You can test drive the 
color by ...

        plot (rand (11))

If you like this approach, but don't care for the colors, you can try the 
colormaps below.

        autumn
        bone
        cool
        copper
        flag
        gray
        hot
        jet
        ocean
        pink
        prism
        rainbow
        spring
        summer
        winter

Ben



reply via email to

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