Skip to content

Area plots - VertexData missing #225

Closed
@harshpurwar

Description

@harshpurwar

Running this:

x = 5:8;
y = [1 2 4 3];
area(x,y); fig2plotly();

results in the following:
Index in position 1 exceeds array bounds.
We had trouble parsing the area object.
This trace might not render properly.

However, if an area plot is done and then if fig2plotly(); is called in a separate statement, it works without any issues.
BTW, area(x,y); pause(1); fig2plotly(); also works.

More specifically, I think the issue is in updateArea.m where the following breaks:

%-get "children" using new HG2 approach-%
area_child = get(area_data.java.firstDown); 
...
xdata = area_child.VertexData(1,:);
ydata = area_child.VertexData(2,:);

area_child.VertexData is empty if fig2plotly() is called immediately after area(). Give it some time and then it just works!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions