CALPHAD tools for designing thermodynamic models, calculating phase diagrams and investigating phase equilibria.
bocklund on cs_dat_support_linear
WIP: io.cs_dat: ChemSage DAT fi… FIX: grammar: floating-point nu… ENH/WIP: cs_dat: Stoichiometric… and 120 more (compare)
bocklund on cs_dat_support_linear
WIP: io.cs_dat: ChemSage DAT fi… FIX: grammar: floating-point nu… ENH/WIP: cs_dat: Stoichiometric… and 120 more (compare)
github-actions[bot] on website
DOC: Deploy latest docs to webs… (compare)
bocklund on triangular-fixes
bocklund on develop
FIX: Improve Triangular axes pr… (compare)
github-actions[bot] on website
DOC: Deploy latest docs to webs… (compare)
bocklund on ci-py39
bocklund on develop
MAINT/CI: Support Python 3.9 (#… (compare)
8ed33ba
) and that should trigger the tests to run our GitHub Actions workflow. Thank you for your patience! We're still learning the ins-and-outs of GitHub Actions and refining our test and CI stack.
font.size
...
## note that font.size controls default text sizes. To configure
## special text sizes tick labels, axes, labels, title, etc, see the rc
## settings for axes and ticks. Special text sizes can be defined
## relative to font.size, using the following values: xx-small, x-small,
## small, medium, large, x-large, xx-large, larger, or smaller
but that requires me to also patch
ax.set_ylabel(_axis_label(y), position=(0.18,0.45), fontsize=2*base_font_size)
adding a hard coded position for the y axis label (the one on the slanted upper axis in the triangle). Otherwise labels collide, and labelpad
does not do anything
I would suggest that you do something like this:
%matplotlib inline
from pycalphad import Database, eqplot, equilibrium, variables as v
import matplotlib.pyplot as plt
dbf = Database("Cr-Fe-Ni_Miettinen.tdb")
comps = ['CR', 'FE', 'NI', 'VA']
phases = sorted(dbf.phases.keys())
conditions = {v.N: 1, v.P: 101325, v.T: 1000, v.X('NI'): (0.0, 1.0, 0.1), v.X('CR'): (0.0, 1.0, 0.1)}
eq = equilibrium(dbf, comps, phases, conditions)
# plot the result
fig = plt.figure(dpi=200)
ax = fig.gca(projection='triangular')
eqplot(eq, x=v.X('CR'), y=v.X('NI'), ax=ax)
box = ax.get_position()
ax.set_position([box.x0, box.y0, box.width, box.height])
ax.tick_params(axis='both', which='major', labelsize=8, pad=10000)
ax.grid(True)
plot_title = '-'.join([component.title() for component in sorted(comps) if component != 'VA'])
ax.set_title(plot_title, fontsize=16)
ax.set_xlabel('X(CR)', fontsize=10, labelpad=8)
ax.set_ylabel('X(NI)', fontsize=10, labelpad=5)
You can pass in your own axes and set all the parameters after the fact.
triangular
projection seems to break the pad
argument for ax.tick_params
(it has no effect). Othat than that, you can set everything except the parameters for the lines outside of ternplot
/eqplot
.
git blame
has me on the hook for all that code, but I have no recollection of writing it. It's several years old, so it's unclear whether it worked at some point and broke or whether it never worked.