mirror of
https://github.com/CoolProp/CoolProp.git
synced 2026-04-01 03:00:13 -04:00
Writing matplotlibrc on the fly for REFPROP plots
This commit is contained in:
@@ -12,8 +12,6 @@ plots_path = os.path.join(web_dir,'fluid_properties','fluids','REFPROPplots')
|
||||
template = """
|
||||
from __future__ import division, print_function
|
||||
import matplotlib
|
||||
matplotlib.use('Agg') #Force mpl to use a non-GUI backend
|
||||
|
||||
import numpy as np, matplotlib.pyplot as plt
|
||||
|
||||
import CoolProp
|
||||
@@ -72,9 +70,13 @@ plt.savefig(fluid+'.pdf')
|
||||
plt.close('all')
|
||||
|
||||
"""
|
||||
|
||||
if not os.path.exists(plots_path):
|
||||
os.makedirs(plots_path)
|
||||
|
||||
with open(os.path.join(plots_path, 'matplotlibrc'), 'w') as fp:
|
||||
fp.write("backend : agg\n")
|
||||
|
||||
for fluid in CoolProp.__fluids__:
|
||||
print('fluid:', fluid)
|
||||
file_string = template.format(fluid = fluid)
|
||||
|
||||
Reference in New Issue
Block a user