Skip to content

SP4: Error when multiple axes have the same axis index #2539

@swharden

Description

@swharden

Discussed in #2538

Originally posted by cxjcqu April 1, 2023
If AxisIndex of XAxis and XAxis2 are both equal to 0, the graph can only be moved up and down, not left and right. If AxisIndex of XAxis and XAxis2 are both equal to 1, an error will occur. YAxis and YAxis2 have similar problems.

Situation 1

plt.XAxis.AxisIndex = 0;
plt.YAxis.AxisIndex = 0;
plt.XAxis2.AxisIndex = 0;
plt.YAxis2.AxisIndex = 0;

In this case, the graph cannot be scaled or moved. It may be because Axis and Axis2 are independent of each other and cannot be assigned the same index. Programs can be optimized and improved to allow graphics to zoom and move, because many charts require ticks on both the top and bottom as well as the left and right sides, and the tick labels should be the same, like the curve below.

Situation 2

plt.XAxis.AxisIndex = 1;
plt.YAxis.AxisIndex = 1;
plt.XAxis2.AxisIndex = 1;
plt.YAxis2.AxisIndex = 1;

In this case, the program can cause errors. It is necessary to carry out fault tolerant processing on the program.

666

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