MATLAB: When ploting the left y axis always be the bule I can not change the color change the color of the plot when ploting the left y axis always be the bule I can not change the color Best Answer 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 Related SolutionsMATLAB: Two y-axis colors Assuming you did something similar to the code below, you can access the axis properties directly and change the color to whatever you want.% Create a figure and axis with 2 Y axesfigure;ax = axes; % or ax = gca();yyaxis('left');yyaxis('right');% Set the color of each axis to blackax.YAxis(1).Color = [0 0 0];ax.YAxis(2).Color = [0 0 0]; MATLAB: Black axes for yyaxis (not default blue and orange) Try this: figureyyaxis leftplot((1:10), rand(1, 10), 'g')yyaxis rightplot((5:15), sin((5:15)/5), 'r')ax = gca;ax.YAxis(1).Color = 'k';ax.YAxis(2).Color = 'k';Experiment to get the result you want. Related QuestionHow to change the default line style of plots generated using yyaxisHow to add tick just for the left axisPlot with two different x-axixScatter 3y-axisHow to add a ‘No Data’ label on a Bar plot
Best Answer