janosh/pymatviz

`ptable_heatmap` with diagonally-split tiles

Closed this issue ยท 5 comments

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.

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

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

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

This is awesome, @DanielYang59. Thank you!

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.