Skip to content

Commit

Permalink
move plt.show() call from main Cosymlib API to shape_map script
Browse files Browse the repository at this point in the history
  • Loading branch information
abelcarreras committed Apr 15, 2022
1 parent b73e0b8 commit a9b6df2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 1 addition & 3 deletions cosymlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -826,9 +826,7 @@ def print_minimum_distortion_path_shape(self, shape_label1, shape_label2, centra
plt.ylabel(label2_name)
axes.set_aspect('equal')

plt.savefig('shape_map.png')
if output1 is sys.stdout:
plt.show()
return plt

def print_point_group(self, tol=0.01, output=sys.stdout):
"""
Expand Down
9 changes: 7 additions & 2 deletions scripts/shape_map
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,19 @@ elif args.m_custom_2:
references.append(reference_polyhedron)

if args.m_1 or args.m_custom_1:
structure_set.print_minimum_distortion_path_shape(references[0],
plt = structure_set.print_minimum_distortion_path_shape(references[0],
references[1],
central_atom=args.central_atom,
min_dev=args.min_dev,
max_dev=args.max_dev,
min_gco=args.min_gco,
max_gco=args.max_gco,
num_points=args.n_points,
output=args.output_name)
output=common_output)

if args.output_name is None:
plt.show()
else:
plt.savefig('shape_map.png')

print_footer(common_output)

0 comments on commit a9b6df2

Please sign in to comment.