from plotly.subplots import make_subplots
import plotly.graph_objects as go
import numpy as np

# Functions
def func_1(x, y):
    return x + y

def func_2(x, y):
    return x * y

# Make data
x = np.linspace(0, 10)
y = np.linspace(0, 10)
z1 = np.vectorize(func_1)(*np.meshgrid(x, y))
z2 = np.vectorize(func_2)(*np.meshgrid(x, y))

# Make plots
fig = make_subplots(rows=1, cols=2)
fig.add_trace(go.Heatmap(x=x, y=y, z=z1, showscale=False), row=1, col=1)
fig.add_trace(go.Heatmap(x=x, y=y, z=z2, showscale=False), row=1, col=2)

# Link to JS & export
full_html = fig.to_html(full_html=True, include_plotlyjs='cdn')
full_html = full_html.replace('</body>', '<script src="demo.js"></script>\n</body>')
with open('output.html', 'w') as f:
    f.write(full_html)