
Stem plot color matlab code#
Here we discuss an introduction to Matlab Plot Colors, along with color code table and respective examples. There could be instances when we have to plot multiple functions in a single plot, in such cases, colors become very handy to differentiate between different functions. For horizontal stem plots, the locs are y positions, and the heads are x values. For vertical stem plots (the default), the locs are x positions, and the heads are y values. stem(.,'fill') specifies whether to color the circle at the end of the stem. Additionally, X can be a row or a column vector and Y a matrix with length(X) rows. Using Basic Colors in Graphs Changing Colors 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. X and Y are vectors or matrices of the same size. MATLAB can be used to plot our data for visualizing and intuitively understanding it. A stem plot draws lines perpendicular to a baseline at each location locs from the baseline to heads, and places a marker there. stem(X,Y) plots X versus the columns of Y. Observe in the output that we have obtained a scatter plot of red color, as passed by us in the input argument. Observe in the code that we have passed pre-defined color code for red as an argument (Please refer to the table at the end of the article for pre-defined color codes)

For this example, we will scatter plot of red color
