

CHANGING PLOT COLOR MATLAB CODE
Use the following code to try it out x = -pi:pi/10:pi To change the background color of the axis: set (gca, 'color', 1 1 0) To change the background color of the figure: set (gcf, 'color', 1 1 0) In general, if you want to know the properties of a plot, try get (gca) for axis properties get (gcf) for figure properties This will return a list of available property names and property values. The axes are counted along the top row of the Figure window, then the second row, etc. H = subplot(m,n,p), or subplot(mnp), breaks the Figure window into an m-by-n matrix of small axes, selects the p-th axes for the current plot, and returns the axes handle. Subplot helps have plots side by side on the same sheet. Plot(x,y2,'b','LineWidth',2) Matlab subplot One of the many ways to plot multiple functions on the same plot is to use hold on or insert the corresponding equations in the plot code.

The Graph Plotting multiple graphs on the same plot

Here is another example which you can learn a lot from If you want, you can customize these aspects of your plot. These defaults provide a clean and consistent look across the different plots you create.
CHANGING PLOT COLOR MATLAB HOW TO
Here is how to change the thickness of the line of your plot in Matlab Answers Trial Software Product Updates Specify Line and Marker Appearance in Plots MATLAB creates plots using a default set of line styles, colors, and markers. point o circle x x-mark + plus * star s square d diamond v triangle (down) ^ triangle (up) triangle (right) p pentagram h hexagram - dashed. For example if my data is above 0 the plot line would be green and if below 0 the plot line would be red. I would like to have the plot line change colour automatically when is above or below a set number. The only problem is the colour of the plot lines. ( You can get that information with help plot) MATLAB does all the calculations and plotting just fine. Here is the code you can use to change the line style. Let’s go ahead a plot the following code x=-100:0.5:100 Just like it is to change the color of your plot in Matlab, the same goes for changing the line style, increasing the thickness of the line or some other aspect of it You must surely have grasped how to add the color code to get your graph to the wanted color, and notice at the beginning of this post the different color and code you can make use of while using this technique Matlab plotting line style Let’s twist the code a little to change the plot color
