Skip to content

GetLegend() fails when called before rendering #527

@el-aasi

Description

@el-aasi

I would like to:
I am trying to get the legend and save it as an image so that I can place it outside the graph area to not obstruct the graph itself.

This is what I have tried:
I have tried using the plt.GetLegendBitmap(); method and I am not sure if this is a bug or I am just a tool and I am not using it properly, but the image that I am getting from the method is a 1x1 bitmap, which when saved is unusable. I have tried saving it in a different format (btm, png, jpeg) but nothing seems to make the difference. I was thinking that it was because I did not have the plt.Legend() method, so I included it first with location set to none, and with location set to upperLeft still no luck.

image

This is what I get.

If I am a tool let me know how can I use it properly. Thanks and have a great day.

Just saw the #388 issue, will try the options provided there too see if I can fix my issue.

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