Running this code again in MATLAB R2015a, this is what I get:Īlternatively, you can always use a legend that delineates what histogram comes from which data. colours = permute(get(gca, 'colororder'), ) Ĭolours_resize = imresize(colours, 50.0, 'nearest') Assuming you have the image processing toolbox, this is the code I wrote to visualize those colours for each plot you place in your figure. The RGB tuples in this case are slightly more complex and so it's hard to infer what they are by just looking at the colours.Īs an additional bonus, we can create an image that visualizes these colours for you. A light mixture of red, green and blue, which looks like a dark gray.Ĭurrently (March 10th, 2016), I am using MATLAB R2015a and this is the colour map I get: > get(gca,'colororder').A mixture of red and green which is yellow.Devuelva el objeto de barra como b, de forma que pueda personalizar otros aspectos de la grfica ms tarde. Cree una grfica de barras roja llamando a la funcin bar y especificando el argumento color opcional como 'red'. A mixture of red and blue, which is magenta Especificar el color de una grfica de barras.A mixture of green and blue, which is cyan.The first row denotes the first colour to go on the plot, followed by the second row denoting the second colour and so on. On my machine at the time of this post when I was running MATLAB R2013a and with Mac OSX 10.9.5, this is what I got: > get(gca,'colororder')Įach row gives you the red, green and blue values for a particular colour. This will return a 2D matrix where each row gives you the proportion of red, green and blue for each plot that you produce. If you actually want to know what the colour order is for your plot, make sure the plot is open in MATLAB, then do the following: get(gca,'colororder') For versions after R2014b, this follows the parula colour map, where the first plot would be a lighter blue followed by the second plot being a copper orange of sorts. In the jet colour map, the first plot is blue, followed by the second plot being green. To get the color order for your MATLAB version, you can use the get() function to get the color order in RGB. The default color order in MATLAB varies depending on the Matlab version. Take note that versions before R2014b, the default colour order for MATLAB uses the jet colour map. This tutorial will discuss how to get the default color order using the get() function in MATLAB. Good question! There is a default colour order for MATLAB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |