
Observe in the output that we have obtained a scatter plot of red color, as passed by us in the input argument.
MATLAB SCATTER PLOT CODE
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) Observe in the code that we have passed pre-defined color code for green as an argument (Please refer to the table at the end of the article for pre-defined color codes)įor this example, we will scatter plot of red color Let us first define an array to create a Bar plot:
MATLAB SCATTER PLOT HOW TO
How to Set the Color of Bar Plots?įor this example, we will create a bar plot with bars of green color. Observe in the code that we have passed pre-defined color codes as arguments (Please refer to the table at the end of the article for pre-defined color codes) How our input and output will look like in MATLAB console?Įxplanation: As we can see in our output, we have got our functions in the colors as passed by us in the input. Here we discuss the Uses of MATLAB with the Description of Scatter Plots. You may also look at the following article.Note: For this example, we will be creating our functions in following colors: 1 st function in Green, 2 nd function in Blue and 3 rd function in Yellow] example: plot(X, a, ‘g’, X, b, ‘b’, X, c, ‘y’) This is a guide to Scatter Plots in Matlab.

Similarly, ‘MarkEdgecolor’ will be used to change the outline colour of the circles. Linewidth,1 will set out the outline of the circles in the plot to 1mm. This function will modify the scatter plot graph for the ‘Name’ and ‘Value ’ pair mentioned in the argument. we can get Square shape with argument ‘s’ in the function. If we need some other shape like a square, this function can be used. We just need to pass the argument ‘filled’ in the function for the circles to be filled in scatter plot graph.ĭefault shapes for scatter plots are circles. This function will help in filling the circles. Now, what if we need all these circles to be solid or in other words, filled with colours. This helps us in differentiating higher and lower values as per our need 4. We can clearly visualize circles of changing colours. And then the scatter function will help to map the elements present in c to colours present in the colormap. Here, elements present in a, b, and c will determine the location and colour of the circles.

It will help in specifying the colour as follows: This function will define the colour of the circles to be plotted in the graph. The significance of doing this is that we will get our attention diverted towards higher values immediately. We can clearly visualize that the circles in the graph are of different sizes. Let’s take the same example as in previous explanation, to keep things simple for better understanding

Solution: We will get the following graph in MATLAB Such type of graphs are also called as ‘Bubble Plots’Įxample: Let us define two variables a & bĪ = linspace(0, 30, 100) ī = linspace(10, 50, 100).

