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

Hist2d log #5980

Merged
merged 5 commits into from May 4, 2019
Merged

Hist2d log #5980

merged 5 commits into from May 4, 2019

Conversation

lfrancioli
Copy link
Contributor

Adds log option to plot.histogram2d
Also adds joint_plot to plot init


__all__ = ['output_notebook',
'show',
'histogram',
'cumulative_histogram',
'scatter',
'join_plot'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

height: int = 600,
font_size: str = '7pt',
colors: List[str] = bokeh.palettes.all_palettes['Blues'][7][::-1],
log: bool = False):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would generally prefer this, but I believe Hail house style has been to not use typehints in function signatures, since it can mess with linters, but to leave it to the typechecker above. @tpoterba confirm?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can revert if desired but my other code in plots has typehints 😛

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

happy to use type hints - just not for expressions with type polymorphism where you'd really need to use type generics (Array[T].map => Array[U])

@@ -462,6 +472,9 @@ def frange(start, stop, step):
data = grouped_ht.filter(hail.is_defined(grouped_ht.x) & (grouped_ht.x != str(x_range[1])) &
hail.is_defined(grouped_ht.y) & (grouped_ht.y != str(y_range[1]))).to_pandas()

if log:
data['c'] = np.log10(data['c'])
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you have the legend reflect the actual value rather than the log10? Idk how hard that is in bokeh but it would be awesome.

@konradjk konradjk self-assigned this Apr 29, 2019
* Use of LogColorMapper / LogTicker => preserves counts
Also removed font argument -- better display without it.
@lfrancioli
Copy link
Contributor Author

lfrancioli commented Apr 29, 2019

This is what it looks like with default fonts and LogColorMapper / LogTicker
image

Copy link
Collaborator

@konradjk konradjk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahhhh! Much better! The only thing - instead of deleting it, can we bring set_font_size into the open? It's a super useful function for fixing some of the tiny fonts that bokeh ships with.

@lfrancioli
Copy link
Contributor Author

@konradjk, I don't think you'll object but I added a little hack to get prettier axes labels in that last commit.

image

@danking danking merged commit 1557f2a into hail-is:master May 4, 2019
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

Successfully merging this pull request may close these issues.

None yet

4 participants