To create a bar plot with two y-axes in MATLAB, you can use the yyaxis()
function. Here's an example of how you can create a bar plot with six bars, where the first y-axis represents the sum of squared error value and the second y-axis represents the adjusted r squared and f-statistic values:
main.m781 chars26 lines
This code will create a bar plot with six bars, where the sum of squared error values will be represented on the left y-axis (in red) and the adjusted r squared and f-statistic values will be represented on the right y-axis (in blue).
Note that padding with zeros has been added for the left y-axis to match the number of bars on the right y-axis.
Make sure to replace the input data (sseValues
, adjRSquared
, fStatistic
) with your own data.
I hope this helps!
gistlibby LogSnag