![]() ![]() Here we discuss where and how to use the Colors in Matlab with different examples implementing it. example plot (X1,Y1,LineSpec1.,Xn,Yn,LineSpecn) assigns specific line styles, markers, and colors to each x - y pair. Use this syntax as an alternative to specifying coordinates as matrices. All these capabilities are achieved by MATLAB in significantly less amount of time when its performance is compared to a non-interactive programming language like C. example plot (X1,Y1.,Xn,Yn) plots multiple pairs of x - and y -coordinates on the same set of axes. In addition to its computing powers, MATLAB also provides its users with the ability to draw and visualize the data for better understanding and drawing inferences. ![]() As you must be familiar with the point that arrays do not require any dimensioning, and thus enabling MATLAB to solve problems related to computing, especially those involving matrix & vector formulations with better performance. MATLAB as a system utilizes arrays as its basic data element. Similarly, if we need to have our plot in the shape of triangles facing upward, we will subscript or color code with ‘^’ which is the code for upward-facing triangles. So as explained previously, we will simply replace ‘r’ in our code with ‘y’ for YELLOW color. ![]() Output: Now, the output will be the same as above but this time in ‘RED’ color, as shown in the below graph:įinally, let us try it for YELLOW color. To convert our graph into ‘RED’ color we will simply add ‘r’ to out code, as follows: Now let us convert it into colors of our wish. Output: The output for this function will be in ‘BLUE’ color by default as shown in the below graph. Let us now understand the use of some of the above-mentioned colors: Example #1įirst, we will plot a graph and will let MATLAB plot it with default color: Note that the RGB color specs that you provided happen to be the first 4 default colors that Matlab will use in a plot so I've changed them in this example so that we could see that the colors actually change. It is simple to draw an inference in this case as we mostly associate the red color with danger or word of caution.īelow is the list of some letters which we can add to our code to provide the desired color to our plot while plotting in MATLAB. This isn't very elegant but it does what you want by first doing the plot command and then changing the colors. For example, red color can be used to show negative trends in some data and green to show positive trends. It is straightforward and easy to visualize a trend in data when it is plotted as compared to just looking at the raw figures and color-coding gives it an even stronger appeal. First, we use plot function to create a graphical representation of our data and then we use a specific code to get the graph of the desired color. As the name suggests, the purpose of colors in MATLAB is to plot the graph of a function with the desired color. The objective of this article is to have a thorough understanding of Colors in MATLAB. MATLAB comprises a number of techniques and functions to perform the above-mentioned capabilities. Hadoop, Data Science, Statistics & others Where can we Use Matlab?īelow are a few areas where we can use Matlab: ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |