# defining colors

6 messages
Open this post in threaded view
|

## defining colors

 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-- Dr. Eduardo J. Adam Prof. Adjunto Instrumentación y Control de Procesos Facultad de Ingeniería Química Santiago del Estero 2654, (S3000AOJ), Santa Fe, SF, Argentina Tel. +54 (0342) 457-1167 Int. 2742 _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
Open this post in threaded view
|

## Re: defining colors

 On Sat, Nov 12, 2011 at 5:37 PM, Eduardo J. Adam <[hidden email]> 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 > -- > > Dr. Eduardo J. Adam > Prof. Adjunto Instrumentación y Control de Procesos > Facultad de Ingeniería Química > Santiago del Estero 2654, (S3000AOJ), Santa Fe, SF, Argentina > Tel. +54 (0342) 457-1167 Int. 2742 > > > > _______________________________________________ > Help-octave mailing list > [hidden email] > https://mailman.cae.wisc.edu/listinfo/help-octave> > 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 -- M. Sc. Juan Pablo Carbajal ----- PhD Student University of Zürich http://ailab.ifi.uzh.ch/carbajal/_______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
Open this post in threaded view
|

## Re: defining colors

 Administrator On Nov 12, 2011, at 2:44 PM, Juan Pablo Carbajal wrote: > On Sat, Nov 12, 2011 at 5:37 PM, Eduardo J. Adam <[hidden email]> 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 _______________________________________________ Help-octave mailing list [hidden email] https://mailman.cae.wisc.edu/listinfo/help-octave
Open this post in threaded view
|

## Re: defining colors

 A short while ago, the members of the forum explained to me how to produce arbitrary colors. To show my thanks, I added a short section to the octave wiki, which might be found here http://wiki.octave.org/wiki.pl?Producing_Graphical_OutputI hope that might be helpful. PS It is interesting to learn of the existence of more predefined colors from this thread! Best wishes However good you think Octave is, it's much, much better.