janosh / matbench-discovery

An evaluation framework for machine learning models simulating high-throughput materials discovery.
https://matbench-discovery.materialsproject.org
MIT License
110 stars 18 forks source link

Fixes to Figures for Updated Manuscript #154

Closed CompRhys closed 2 weeks ago

CompRhys commented 3 weeks ago

playing with figures, I think 5x3 works well but need to delete the empty plots in the parity plots per the histogram plots if possible. Putting the caption below the big V-shape plot lets us use all traces, I think the plot is only useful if we see the large differences.

TODO:

janosh commented 3 weeks ago

can we clean up the empty plots on 5x3 layout?

69b0a8e makes a 4x3 each-parity-models showing only compliant models but dropping Voronoi RF

each-parity-models-4x3

CompRhys commented 3 weeks ago
image

attempt to rotate optimal recall either so it sits on the line or is horizontal

CompRhys commented 3 weeks ago

rotate optimal recall line label -- the issue here is that the figure is dynamically sized, but the angle doesn't adjust dynamically. attempted to fix width but doesn't seem to work. Maybe something in pmv adjusts?

janosh commented 3 weeks ago

i think this works.

# Calculate text angle based on data range
dev_fig = fig.full_figure_for_development(warn=False)
x_max = dev_fig.layout.xaxis.range[1]
y_max = dev_fig.layout.yaxis.range[1]
dx = n_stable / x_max
dy = 1 / y_max
textangle = -math.degrees(math.atan2(dy, dx))

would go here

https://github.com/janosh/matbench-discovery/blob/b4eb49e415e6c7cf86d2acb98a930fdcbf5bea3c/matbench_discovery/plots.py#L789-L794

janosh commented 2 weeks ago

might make sense to start grouping scripts into

could also leave that for a future PR

CompRhys commented 2 weeks ago

i think this works.

# Calculate text angle based on data range
dev_fig = fig.full_figure_for_development(warn=False)
x_max = dev_fig.layout.xaxis.range[1]
y_max = dev_fig.layout.yaxis.range[1]
dx = n_stable / x_max
dy = 1 / y_max
textangle = -math.degrees(math.atan2(dy, dx))

would go here

https://github.com/janosh/matbench-discovery/blob/b4eb49e415e6c7cf86d2acb98a930fdcbf5bea3c/matbench_discovery/plots.py#L789-L794

This isn't a full fix, to get this to work you have to set the figure size early which may impact some of the svelte plots. Plotly issue here: https://github.com/plotly/plotly.py/issues/4858