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

Skip to content

wrong colour when second model plots into empty axes #19

@lukashergt

Description

@lukashergt

When plotting 2 models one of which has more parameters than the other, e.g. LCDM and rLCDM, and if we then plot the model with less parameters first including the unshared parameter, then the second model will have the wrong colour in the axes with the unshared parameter.

The colour should be dependent on the call to plot_2d and thus on the model. It should not depend on whether any axis is drawn in for the first or subsequent time.

Example code:

fig, axes= ns_lcdm.plot_2d(['A_s', 'n_s', 'r'], label='LCDM')
ns_rlcdm.plot_2d(axes=axes, diagonal_kwargs={'ls': '--'}, label='rLCDM')
leg = get_legend_proxy(fig)
axes['n_s']['n_s'].legend(leg, ['LCDM', 'rLCDM'], bbox_to_anchor=(1, 1), loc='lower left')

image

Note, how in the above code the second model gets the additional keyword ls='--' which shows that rLCDM is drawn in orange in the upper two axes rows and blue in the bottom row.

For now this behaviour can be circumvented by plotting the model with the most parameters first. This won't help in cases where two models each have an additional parameter not shared with the other, though, say e.g. r+LCDM and alpha+LCDM.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions