

So in your code, rather than using "Color",my_green*1.1 for each line, use "Color",my_colour(kl,:), where my_colour is whatever series of RGB triplets you have defined.

Use the below-given weblink for the datasheet for using various RGB.
Matlab plot colors given rgb code#
I'd simply use parula(50), treat its indices as linspace(jacobi(1), jacobi(end), 50) and then my_colour = interp1(linspace(jacobi(1), jacobi(end), 50), parula(50), jacobi). 25 2.3K views 2 years ago my Matlab videos Stunning plot colours in MATLAB RGB code for changing plot colours. Then you can (need to?) modify the resulting colour bar's labels by hand to reflect your input values. Note that indexing into a colour map will produce linearly spaced colours, thus you'll need to either interpolate or calculate a lot to get the specific ones you need. Plot(x, x+ii, 'Color', colour_map(ii, :)) You can use any colour map to produce a series of RGB-triplets for the plotting routines to read (Or create an m-by-3 matrix with elements between 0 and 1 yourself): n = 10 % Plot 10 linesĬolour_map = jet(n) % Get colours. How can I color each line based on its Jacobi constant value? Text(AstroData.mu_SEM_sys-1,0-0.001,'$Earth + Moon$','Interpreter',"latex") Using RGB triplets to change colors Changing colors in 3D Graphs m-file that created this page BACK TO MAIN PLOTTING PAGE This document gives BASIC ways to color graphs in MATLAB. 'color',my_blue,'MarkerFaceColor',my_blue,'MarkerSize',20) Share Follow answered at 18:33 You 22. The Lineseries and ColorSpec documentation entries have more information about this. 'color','MarkerFaceColor',my_green,'MarkerSize',10) 3 Answers Sorted by: 15 Use the Color property with a ColorSpec triple: plot (x, y, 'Color', 0.5, 1.0, 0.0, 'LineStyle', '-') The vector here contains RGB values between 0.0 and 1.0. In many MATLAB plotting functions, you can specify the color as either a string or as a 3 element vector that directly lists the red, green, and blue values.

"Color",my_green*1.1) hold on %"Color",my_green*1.1 Below, I create a set of Qualitative colormaps by creating colors in the HSV colorspace (very similar to HSL) and then converting the colors back to RGB. % Family of 50 planar Lyapunov orbits around L1 in dimensionless unitįor k1 = 1:(numel(files_L1_L2_Ly_prop)-2) I want to use a colormap to color my curves and then show in a lateral bar the legend that show the numerical values corresponding to each color of orbit.īy considering my example image, I would want to add the array of constants in the lateral bar and then to color each curve according the lateral bar. I produced a plot that contains 50 curves and each of them corresponds to a specific value of a parameter called "Jacobi constant", so I have 50 values of jacobi constant stored in array called jacobi_cst_L1: 3.000900891023230
