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

Conversation

Projects
None yet
4 participants
@lfrancioli
Copy link
Collaborator

commented Apr 29, 2019

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

@lfrancioli lfrancioli requested a review from konradjk Apr 29, 2019


__all__ = ['output_notebook',
'show',
'histogram',
'cumulative_histogram',
'scatter',
'join_plot'

This comment has been minimized.

Copy link
@konradjk

konradjk Apr 29, 2019

Collaborator

typo

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

This comment has been minimized.

Copy link
@konradjk

konradjk Apr 29, 2019

Collaborator

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?

This comment has been minimized.

Copy link
@lfrancioli

lfrancioli Apr 29, 2019

Author Collaborator

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

This comment has been minimized.

Copy link
@tpoterba

tpoterba Apr 29, 2019

Collaborator

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'])

This comment has been minimized.

Copy link
@konradjk

konradjk Apr 29, 2019

Collaborator

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

lfrancioli added some commits Apr 29, 2019

Better implementation of log option in histogram2d:
* Use of LogColorMapper / LogTicker => preserves counts
Also removed font argument -- better display without it.

@lfrancioli lfrancioli force-pushed the lfrancioli:hist2d_log branch from f43ec57 to ff5c833 Apr 29, 2019

@lfrancioli

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 29, 2019

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

@konradjk
Copy link
Collaborator

left a comment

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

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 30, 2019

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

image

@lfrancioli lfrancioli force-pushed the lfrancioli:hist2d_log branch from d231ca8 to 4aa162f May 1, 2019

@danking danking merged commit 1557f2a into hail-is:master May 4, 2019

1 check was pending

ci-test
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.