![]() ![]() You can learn more about this topic at matwork. ![]() Use the following code to try it out x = -pi:pi/10:pi Subplot(2,1,1), PLOT(income) subplot(2,1,2), PLOT(outgo) If you want more of your lines to be distinct in both color and line style, use the withcolor option and specify an equal number of colors and line styles. 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. I have a plot with 4 different colors, and I want to change the green (light green) to deep green, so it would be like: plot (x,y,color, 0 0.7 0) if m 1 color. Plot(x,y2,'b','LineWidth',2) Matlab subplot Answers (1) Brendan Hamm on 5 Translate One thing you could do is just change the ColorOrder property of the axes itself: Theme Copy f figure colors 0 0 0.7 0.7 0 0 0 0 0 0 0.7 0 0 b,r,k,g a axes ('ColorOrder',colors) plot your lines and they will be plotted with these colors in order. 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 Here is how to change the thickness of the line of your plot in Matlab point o circle x x-mark + plus * star s square d diamond v triangle (down) ^ triangle (up) triangle (right) p pentagram h hexagram - dashed. ( You can get that information with help plot) 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 Your other option is to change with a single. 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 One thing you could do is just change the ColorOrder property of the axes itself: Then plot your other lines. Inside your application as you've written it a and b are not the numbers 5 and 8 but the char arrays '5' and '8', and '58' is not a valid color or line style for the plot function (as the error message indicates. Let’s twist the code a little to change the plot color ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |