Skip to content

[Bug]: Curve styles gets mixed up when edited in the Curves Tab of Figure Options (Edit Axis) #22384

Closed
@gabrovche

Description

@gabrovche

Bug summary

This happens when QT5, resp. Automatic backend is selected in Preferences (I'm using WinPython 3.9.10).
I have fixed the _exec() bug on in my edition to avoid the figure to freeze on dialogue close - that's why reporting to the 3.5.2 branch, even though I'm using matplotlib 3.5.1.
How to reproduce:
If a figure have multiple curves with different styles (dashed, continuous, doted, etc.) and one edits their Labels in the Curves Tab of Figure Options dialogue (invoked by clicking on Edit Axes button on the top of the figure) the line styles get get "scrambled" upon hitting Apply or OK button.
E.g. the Code snippet below produced a figure like the one shown in "expected outcome". Upon editing the default _child0,_child1,_child2 titles like this:
_child2 -> Test
_child1 -> Test 3
_child0 -> do not edit
Then the figure gets updated to the state depicted in "actual outcome" - i.e. line styles are scrambled.
Derived from the "new colors/styles" I suspect that the list of curves/styles gets "re-sorted" and the new curve positions are wrongly mapped!

Code for reproduction

figure()
plot([1,0],[1,1],'--')
plot([0,0],[0,1],'-')
plot([0,1],[1,0],'-.')

Actual outcome

grafik

Expected outcome

grafik

Additional information

No response

Operating system

Windows 10

Matplotlib Version

3.5.1, with _exec() fix applied

Matplotlib Backend

QT5

Python version

3.9.10

Jupyter version

No response

Installation

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions