Skip to content

Commit

Permalink
fix MaterSim#148, plotly_vxrd
Browse files Browse the repository at this point in the history
  • Loading branch information
qzhu2017 committed Jun 21, 2021
1 parent dd68510 commit f1c3a2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion flask/app/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def plot():
aria-hidden="true"></span><span class="sr-only">Error:</span> \
Showing <strong>{}</strong> with <i>{}</i> profiling.').format(
session.get("FILENAME"), method), 'info')
return xrd.plotly_pxrd(profile=method)
return xrd.plotly_pxrd(profile=method, height=450)

def compare():
"""
Expand Down
5 changes: 3 additions & 2 deletions pyxtal/XRD.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ def plot_pxrd(self, filename=None, minimum_I=0.01, show_hkl=True,\
plt.close()


def plotly_pxrd(self, profile='gaussian', minimum_I = 0.01, html=None):
def plotly_pxrd(self, profile='gaussian', minimum_I = 0.01, height=450, html=None):
import plotly.graph_objects as go

"""
Expand Down Expand Up @@ -360,7 +360,8 @@ def plotly_pxrd(self, profile='gaussian', minimum_I = 0.01, html=None):
trace2 = go.Scatter(x=spectra[0], y=spectra[1], name='Profile: ' + profile)
fig = go.Figure(data=[trace2, trace1])

fig.update_layout(xaxis_title = '2&#952; ({:.4f} &#8491;)'.format(self.wavelength),
fig.update_layout(height=height,
xaxis_title = '2&#952; ({:.4f} &#8491;)'.format(self.wavelength),
yaxis_title = 'Intensity',
title = 'PXRD of '+self.name)

Expand Down

0 comments on commit f1c3a2c

Please sign in to comment.