polarhistogramFS

creates a polarhistogram

Syntax

  • H=polarhistogramFS(Y)example
  • H=polarhistogramFS(Y,Name,Value)example

Description

example

H =polarhistogramFS(Y) Example with all default arguments.

example

H =polarhistogramFS(Y, Name, Value) Call with grouping variable.

Examples

expand all

  • Example with all default arguments.
  • load citiesItaly
    polarhistogramFS(citiesItaly);

  • Call with grouping variable.
  • load citiesItaly
    zone=[repelem("N",46) repelem("CS",57)]';
    polarhistogramFS(citiesItaly,'groupvars',zone);
    Click here for the graphical output of this example (link to Ro.S.A. website).

    Related Examples

    expand all

  • Call with grouping variable and DataVars.
  • load citiesItaly
    zone=[repelem("N",46) repelem("CS",57)]';
    polarhistogramFS(citiesItaly,'DataVars',[2 5],'groupvars',zone);

  • Call with grouping variable, DataVars and nbins.
  • load citiesItaly
    zone=[repelem("N",46) repelem("CS",57)]';
    polarhistogramFS(citiesItaly,'DataVars',1:4,'groupvars',zone,'nbins',10);

  • Use of FaceAlpha.
  • load citiesItaly
    zone=[repelem("N",46) repelem("CS",57)]';
    polarhistogramFS(citiesItaly,'DataVars',1:4,'groupvars',zone,'nbins',10,'FaceAlpha',0.01);

  • Grouping variable with more than two levels.
  • load citiesItaly
    zone=[repelem("N",46) repelem("C",21) repelem("S",36)]';
    polarhistogramFS(citiesItaly,'DataVars',1:4,'groupvars',zone,'nbins',10);

  • Example of DisplayStyle 'stairs'.
  • load citiesItaly
    zone=[repelem("N",46) repelem("C",21) repelem("S",36)]';
    polarhistogramFS(citiesItaly,'DataVars',1:4,'groupvars',zone,'nbins',10,'DisplayStyle','stairs');

  • Example of DisplayStyle 'stairs' with Linewidth.
  • load citiesItaly
    zone=[repelem("N",46) repelem("C",21) repelem("S",36)]';
    polarhistogramFS(citiesItaly,'DataVars',1:4,'groupvars',zone,'nbins',10,'DisplayStyle','stairs','LineWidth',2);
    Click here for the graphical output of this example (link to Ro.S.A. website)

  • load citiesItaly Example of nbins as a vector.
  • load citiesItaly
    % Example of nbins as a vector.
    % In this case nbins contains the edges
    polarhistogramFS(citiesItaly,'DataVars',1:2,'groupvars','','nbins',[1000:1000:5000 30000],'DisplayStyle','stairs','LineWidth',2);

  • Call with grouping variable inside the table.
  • load citiesItaly
    zone=[repelem("N",46) repelem("CS",57)]';
    C=citiesItaly;
    C.zone=zone;
    polarhistogramFS(C,'DataVars',2:5,'groupvars',"zone");

    Input Arguments

    expand all

    Y — Input data. 2D array or table.

    n x p data matrix; n observations and p variables. Rows of Y represent observations, and columns represent variables.

    Rows of TBL represent observations, and columns represent variables.

    Data Types: single|double

    Name-Value Pair Arguments

    Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

    Example: 'DataVars',[2 4] , 'groupvars',2 , 'nbins',10

    DataVars —Table variables for which to compute polarhistograms.numeric vector | string array of cell array of character vectors.

    For examples if 'DataVars' is [3 5], polar histogram is done for variables 3 and 5. If 'DataVars' is ["Name1" "Name4"] variable with these names inside the input table are used

    Example: 'DataVars',[2 4]

    Data Types: character vector | string array | cell array of character vectors | vector of positive integers | logical vector

    groupvars —Grouping Variable.identifiers for the grouping variables in input array Y.

    If groupvars is [] then the output refers to the overall sample. It can be vector of length n or a string (char) or a number identifying a particular column in the input table Y.

    Example: 'groupvars',2

    Data Types: character vector | string array | cell array of character vectors | vector of positive integers | logical vector | []

    nbins —number of bins or bin edges.scalar | vector.

    If nbins is a scalar, then we assume that it is referred to the number of bins. Alternatively if nbins is a numeric vector of length>1, we assume that nbins(1) is the leading edge of the first bin, and nbins(end) is the trailing edge of the last bin elements. The elements of input vector y are binned into nbins equally spaced containers if nbins is a scalar or into length(nbins)-1 containers if nbins is not a scalar.

    Remark: note that it is possible to pass all the options which are allowed inside polarhistogram. See the examples below for further details.

    Example: 'nbins',10

    Data Types: numeric vector

    Output Arguments

    expand all

    H —array of graphic objects. Graphic object of size length(groupvars)-by-length(DataVars)

    In position i,j it contains the handle for i-th level of groupvars for variable DataVars.

    References

    Tufte E.R. (1983), "The visual display of quantitative information", Graphics Press, Cheshire.

    See Also

    This page has been automatically generated by our routine publishFS