Skip to content

Raise exception when performing plot_2D_Data for DataND with one value for requested axis #91

@EmileDvs

Description

@EmileDvs

The plot_2D_Data is not working if the axis is requested whereas it has only one value. The plot crashes because xlabel and xticks are not initialized if they are None, due to the following code part:

        if (
            axis.extension
            in [
                "whole",
                "interval",
                "oneperiod",
                "antiperiod",
                "smallestperiod",
                "axis_data",
                "list",
            ]
            and len(axis.values) > 1
            or (len(axis.values) == 1 and len(axes_list) == 1)
        )

Maybe it is best to clearly raise an Exception for this case ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions