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

ptable_heatmap with diagonally-split tiles #130

Closed
keeganq opened this issue Apr 5, 2024 · 5 comments · Fixed by #131
Closed

ptable_heatmap with diagonally-split tiles #130

keeganq opened this issue Apr 5, 2024 · 5 comments · Fixed by #131
Labels
enhancement New feature or request ptable Periodic table

Comments

@keeganq
Copy link

keeganq commented Apr 5, 2024

Hi, thanks for this really awesome repository! Very easy to use with satisfying results.

Are there plans to add functionality for joint periodic table plots for comparing two values? Similar to the one shown here: https://www.nature.com/articles/s42256-023-00716-3/figures/2

Would be great to have this kind of visualization in the toolkit, as I think it's much easier than trying to compare two ptable_heatmap plots.

@janosh
Copy link
Owner

janosh commented Apr 5, 2024

yeah, i almost implemented this as a reusable function at one point. don't remember why it didn't happen and unfortunately don't have time right now. but it's been on the roadmap for a while and a PR would be very welcome!

pinging @DanielYang59 just in case you'd like to work on this. no expectations of course

@janosh janosh added enhancement New feature or request ptable Periodic table labels Apr 5, 2024
@janosh janosh changed the title Joint PTable for Comparison ptable_heatmap with diagonally-split tiles Apr 5, 2024
@DanielYang59
Copy link
Collaborator

Looks good. I would have a try and see how everything goes. Thanks for pinging me!

@DanielYang59
Copy link
Collaborator

DanielYang59 commented May 5, 2024

Hi @keeganq We just added the requested plotter with #131, and please let me know if you have further suggestions on it.

To use the new plotter, you could use the following (basically just pass a {element_name: [*values]} dict to the plotter, and the length of [*values] would determine how each tile is split):

# %% Evenly-split tile plots laid out as a periodic table
data_dict = {
elem.symbol: [
random.randint(0, 10),
random.randint(10, 20),
]
for elem in Element
}
fig = ptable_heatmap_splits(
data=data_dict,
colormap="coolwarm",
start_angle=135,
cbar_title="Periodic Table Evenly-Split Heatmap Plots",
)

Currently it looks like:
ptable-heatmap-splits

@keeganq
Copy link
Author

keeganq commented May 6, 2024

This is awesome, @DanielYang59. Thank you!

@DanielYang59
Copy link
Collaborator

No worries at all. This can never be done so well without @janosh's suggestions.

Meanwhile we're trying to improve the API for ptable plotters, so if you have any comments/suggestions during usage, please let me know. That would be valuable feedback for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ptable Periodic table
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants