机器学习之Octave:plot函数绘图

基础

plot(X,y);

X:数据矩阵,每一列为一个特征
y:数据结果向量

形状参数

  • linestyle
    ‘-’ solid lines (default).
    ‘–’ dashed lines.
    ‘:’ dotted lines.
    ‘-.’ dash-dotted lines.
  • markerstyle
    ‘+’ crosshair
    ‘o’ circle
    ‘*’ star
    ‘.’ point
    ‘x’ cross
    ‘s’ square
    ‘d’ diamond
    ‘^’ upward-facing triangle
    ‘v’ downward-facing triangle
    ‘>’ right-facing triangle
    ‘<’ left-facing triangle
    ‘p’ pentagram
    ‘h’ hexagram
  • color
    ‘k’ blacK
    ‘r’ Red
    ‘g’ Green
    ‘b’ Blue
    ‘m’ Magenta
    ‘c’ Cyan
    ‘w’ White
  • LineWidth:number
  • MarkerSize :number
  • MarkerEdgeColor:number
  • MarkerFaceColor:number

e.g. :

plot(angles, y, 'ro', 'LineWidth', 2, MarkerSize, 7);

其它

  • 标题
title('...');
  • 横轴、纵轴
xlabel('...');
ylabel('...');
  • 图例
legend('...'[, '...'])

你可能感兴趣的:(机器学习,Octave)