Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Produce log axis corner plots #85

Open
aeongrail opened this issue Jul 23, 2016 · 6 comments
Open

Produce log axis corner plots #85

aeongrail opened this issue Jul 23, 2016 · 6 comments

Comments

@aeongrail
Copy link

Hi there,

I'm relatively new to python and am giving your corner script a go! But I can seem to work out how to get the axes of the plots to display a log scale.

Besides logging the actual data (which doesn't do the right thing to the axes - but does give the right sort of shape to the plots), is there a way to do this?

@dfm
Copy link
Owner

dfm commented Jul 24, 2016

This isn't possible currently. Your best bet is to take the log of your samples and label the axis log(x).

@castillohair
Copy link
Contributor

Hi,

I have implemented log-scaled axes.

import numpy as np
import matplotlib.pyplot as plt
import corner

cov = np.array([[ 0.1, 0.04, 0.06,],
                [0.04,  0.1, 0.06,],
                [0.06, 0.06,  0.1]])
mu  = np.array([1, 1.5, 2])

x = 10**(np.random.multivariate_normal(mu, cov, size=10000))
corner.corner(x, axes_scale='log')

log_test

If there's interest, I'd be willing to tidy up the code, work on the tests, and submit a pull request. Please let me know if that is the case.

@NeutralKaon
Copy link
Contributor

NeutralKaon commented Feb 9, 2021

@castillohair -- there's definitely interest from me; please do post a gist or a diff at least!

Having had a very brief look at this, it is a bit of work: you can't just change the axes mode as the surface and contours drawn are wrong. Your help would be rather welcome!

@ZardozSav
Copy link

ZardozSav commented Mar 8, 2021

Hi !

Is that implemented yet ? I am also interested to use logscale for the axis .
If we provide bin edges and not just only the number of bins, it should work right ?

@jtlz2
Copy link

jtlz2 commented Jul 7, 2021

@castillohair Did you ever get to submitting a PR? Thanks! cc @dfm

@castillohair
Copy link
Contributor

I just submitted a pull request with the code I made a while ago. It may need some tidying up to work with the last version but I'm going to wait for comments from @dfm before dedicating time to it. In the meantime, feel free to use it or my branch at https://github.com/castillohair/corner.py/tree/log-scale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants