You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: plotion.m
    path of file: ./repos/spinw/swfiles/+swplot
    
    the code of the file until where you have to start completion: function varargout = plotion(varargin)
% plots magnetic ion properties
% 
% ### Syntax
% 
% `swplot.plotion(Name,Value)`
% 
% `hFigure = swplot.plotion(Name,Value)`
%
% ### Description
% 
% `swplot.plotion(Name,Value)` visualizes selected properties of magnetic
% ions stored in a [spinw] object onto an swplot figure. The supported
% properties are the g-tensor and single ion anisotropy.
% 
% ### Name-Value Pair Arguments
% 
% `'mode'`
% : String that defines the type of property that is visualized:
%   * `'aniso'`     ellipsoid is plotted to visualize single ion anisotropy,
%   * `'g'`     	ellipsoid is plotted to visualize g-tensor.
% 
% `'scale'`
% : Scaling factor for the size of the ellipsoid relative to the 
%   shortest bond length. Default value is 1/3.
% 
% `'alpha'`
% : Transparency (alpha value) of the ellipsoid (1 for opaque, 0 for
%   transparent), default value is 0.3.
% 
% `'radius1'`
% : Minimum radius of the ellipsoid, default value is 0.08 \\ang.
% 
% `'lineWidth'`
% : Line width in pt of the main circles surrounding the ellipsoid, 
%   if zero no circles are drawn. Default is 0.5 pt.
% 
% `'color'`
% : Color of the ellipsoid, one of the following values:
%   * `'auto'`      all ellipsoids get the color of the central atom,
%   * `'colorname'` all ellipsoids will have the same color defined by the
%                   string, e.g. `'red'`,
%   * `[R G B]`     all ellipsoids will have the same color defined by the RGB
%                   code.
% `'color2'`
% : Color of the lines of the main circles, default value is `'auto'` when
%   the ellipses will have the same color as the ellipsoids. Can be either
%   a row vector of RGB code or string of a color name, see the `color`
%   parameter.
% 
% #### General paraters
%
% These parameters have the same effect on any of the `swplot.plot...`
% functions.
%
% `'obj'`
% : [spinw] object.
% 
% `'unit'`
% : Unit in which the plotting range is defined. It can be one of the
%   following strings:
%   * `'lu'`        plot range is defined in lattice units (default),

    
function varargout = plotion(varargin)
% plots magnetic ion properties
% 
% ### Syntax
% 
% `swplot.plotion(Name,Value)`
% 
% `hFigure = swplot.plotion(Name,Value)`
%
% ### Description
% 
% `swplot.plotion(Name,Value)` visualizes selected properties of magnetic
% ions stored in a [spinw] object onto an swplot figure. The supported
% properties are the g-tensor and single ion anisotropy.
% 
% ### Name-Value Pair Arguments
% 
% `'mode'`
% : String that defines the type of property that is visualized:
%   * `'aniso'`     ellipsoid is plotted to visualize single ion anisotropy,
%   * `'g'`     	ellipsoid is plotted to visualize g-tensor.
% 
% `'scale'`
% : Scaling factor for the size of the ellipsoid relative to the 
%   shortest bond length. Default value is 1/3.
% 
% `'alpha'`
% : Transparency (alpha value) of the ellipsoid (1 for opaque, 0 for
%   transparent), default value is 0.3.
% 
% `'radius1'`
% : Minimum radius of the ellipsoid, default value is 0.08 \\ang.
% 
% `'lineWidth'`
% : Line width in pt of the main circles surrounding the ellipsoid, 
%   if zero no circles are drawn. Default is 0.5 pt.
% 
% `'color'`
% : Color of the ellipsoid, one of the following values:
%   * `'auto'`      all ellipsoids get the color of the central atom,
%   * `'colorname'` all ellipsoids will have the same color defined by the
%                   string, e.g. `'red'`,
%   * `[R G B]`     all ellipsoids will have the same color defined by the RGB
%                   code.
% `'color2'`
% : Color of the lines of the main circles, default value is `'auto'` when
%   the ellipses will have the same color as the ellipsoids. Can be either
%   a row vector of RGB code or string of a color name, see the `color`
%   parameter.
% 
% #### General paraters
%
% These parameters have the same effect on any of the `swplot.plot...`
% functions.
%
% `'obj'`
% : [spinw] object.
% 
% `'unit'`
% : Unit in which the plotting range is defined. It can be one of the
%   following strings:
%   * `'lu'`        plot range is defined in lattice units (default),
%   * `'xyz'`       plot range is defined in the $xyz$ Cartesian coordinate
%                   system in \\ang units.
%
% `'range'`
% : Defines the plotting range. Depend