MATLAB: Is it possible draw left y-axis with red color and the right y-axis with blue color axiscolorplot and use different colors for the left ylabel and right ylabel? Best Answer Yes it is. Here is an example of a plot with different y axis colors:t = linspace(0,1,1000);a = sin(2*pi*t);b = sin(4*pi*t);fig = figure;left_color = [1 0 0];right_color = [0 0 1];set(fig,'defaultAxesColorOrder',[left_color; right_color]);yyaxis leftplot(t, a)yyaxis rightplot(t, b) Related SolutionsMATLAB: When ploting the left y axis always be the bule I can not change the color When using any of the plot commands it is possible to add a string to format the plotted line.plot(x,y,format); % Where format looks something like '--k' for a black dashed line MATLAB: How to change color of x and y axis by red and blue set(gca,'xcolor','r','ycolor','b') Related QuestionY-axis scaleSetting background color for patchesScaling y-axisTwo y-axis colorsPlot without axis but with backgroundLine colour of two y-axis plotBlack axes for yyaxis (not default blue and orange)
Best Answer