2/21/2023 0 Comments Matlab ed color plot![]() ![]() Plot(fun_to_plot(i,:),'color',Cmap1(i,:)) īeyond parula, Theres a bunch of other built in colormaps for matlab available here under the 'Predefined Colormaps' heading ( turbo and jet are different ways to get a rainbow of all colors - but not a great pick if you want to be accessible to colorblind ppl). This will generate an nx3 matrix of colors equally spaced out on the parula colormap, so then just set each row of this matrix equal to a row of Cmap1, as it provides the 1x3 matrix of RGB values of a color Cmap1(1,:)Ĭoding it up like this is particularly helpful if you're plotting things in a loop so you can just set n in your colormap to the number of loops and then in the plot command use your iterable to call the variable, along the lines of this: n=5 ![]() To try it, run the following code: Cmap1 = parula(n) % n= the number of different colors you want ![]() To plot the given matrix’s color map, you can use the mesh() function, which plots the variable on a given x and y-axis. Plot a Color Map Using the mesh() Function in MATLAB. My favorite of these generally is the parula colormap which is a Matlab built in function. In this tutorial, we will discuss how can we plot a color map using the mesh(), meshc(), meshz(), and surf() function in MATLAB. Since my father is a deuteranope (R/G Colorblind), I'm always partial to making colorblind friendly visualizations. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |