Thanks to visit codestin.com
Credit goes to github.com

Skip to content

wrong colour when second model plots into empty axes #31

@lukashergt

Description

@lukashergt

Describe the bug

A clear and concise description of what the bug is.

Similar to #19 when plotting 2 models it sometimes happens that the colours for the 2nd model aren't consistent due to the colour cycle not being properly updated in the 1st call.

This was introduced through #21 by switching from direct calls to ax.plot([], []) to only passing x=[] (but only to one function).

To Reproduce

ns1 = NestedSamples(root="./tests/example_data/pc")
ns2 = NestedSamples(root="./tests/example_data/pc")
fig, axes = make_2d_axes(['x0', 'x1', 'x2', 'x3'])
ns1.plot_2d(axes=axes, types={'diagonal': None, 'lower': 'kde', 'upper': 'kde'}, label='foo')
ns2.plot_2d(axes=axes, types={'diagonal': 'kde', 'lower': 'kde', 'upper': 'scatter'}, diagonal_kwargs={'ls': '--'}, upper_kwargs={'alpha': 0.3}, label='bar')

image

Expected behavior

In the above image:

  • the dashed lines in the diagonal plots should be orange
  • the scatter plots in the upper plots should be orange

Additional context

  • In the diagonal case this must be due to somehow nothing being drawn in the 1st call where diagonal=None.

  • In the 2D case this has to do with ax.plot and ax.scatter not sharing the same colour cycle, so both have to be called every time.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions