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: updateTernaryPlot.m
    path of file: ./repos/plotly_matlab/plotly/plotlyfig_aux/handlegraphics
    
    the code of the file until where you have to start completion: function obj = updateTernaryPlot(obj, ternaryIndex)

    %-AXIS INDEX-%
    axIndex = obj.getAxisIndex(obj.State.Plot(ternaryIndex).AssociatedAxis);

    %-GET DATA STRUCTURES-%
    ternaryData = get(obj.State.Plot(ternaryIndex).Handle);
    axisData = get(obj.State.Plot(ternaryIndex).AssociatedAxis);
    figureData = get(obj.State.Figure.Handle);

    %-CHECK FOR MULTIPLE AXES-%
    [xsource, ysource] = findSourceAxis(obj, axIndex);

    %-ASSOCIATE TERNARY-AXES WITH LAYOUT-%
    obj.data{ternaryIndex}.subplot = sprintf('ternary%d', xsource+1);


    
function obj = updateTernaryPlot(obj, ternaryIndex)

    %-AXIS INDEX-%
    axIndex = obj.getAxisIndex(obj.State.Plot(ternaryIndex).AssociatedAxis);

    %-GET DATA STRUCTURES-%
    ternaryData = get(obj.State.Plot(ternaryIndex).Handle);
    axisData = get(obj.State.Plot(ternaryIndex).AssociatedAxis);
    figureData = get(obj.State.Figure.Handle);

    %-CHECK FOR MULTIPLE AXES-%
    [xsource, ysource] = findSourceAxis(obj, axIndex);

    %-ASSOCIATE TERNARY-AXES WITH LAYOUT-%
    obj.data{ternaryIndex}.subplot = sprintf('ternary%d', xsource+1);

    %=========================================================================%
    %
    %-UPDATE TRACE PLOT-%
    %
    %=========================================================================%

    %-set trace-%
    obj.data{ternaryIndex}.type = 'scatterternary';

    if ~strcmpi('none', ternaryData.Marker) && ~strcmpi('none', ternaryData.LineStyle)
        obj.data{ternaryIndex}.mode = 'lines+markers';
    elseif ~strcmpi('none', ternaryData.Marker)
        obj.data{ternaryIndex}.mode = 'markers';
    elseif ~strcmpi('none', ternaryData.LineStyle)
        obj.data{ternaryIndex}.mode = 'lines';
    else
        obj.data{ternaryIndex}.mode = 'none';
    end