The Gibbs free energy determins if two substances are miscible at certain temperature since it will get minimized:
$$ \Delta G = \Delta H - T \Delta S$$ Where $ \Delta G < 0$ determines if a process is spontaneous. This seems kind of similar to lagrangian mechanics where the action gets minimized:
$$ dS = \int (T-V) dt $$ Where $T-V=L$; the lagrangian.
Also if you look at the diagrams it almost seems like a path. Is this similarity coincidental? Or is this to be expected and actual two different formulations of the same thing?