0.1.113
This commit is contained in:
parent
ae88acf40d
commit
0a37430ff9
@ -1,7 +1,7 @@
|
|||||||
[metadata]
|
[metadata]
|
||||||
# replace with your username:
|
# replace with your username:
|
||||||
name = guan
|
name = guan
|
||||||
version = 0.1.112
|
version = 0.1.113
|
||||||
author = guanjihuan
|
author = guanjihuan
|
||||||
author_email = guanjihuan@163.com
|
author_email = guanjihuan@163.com
|
||||||
description = An open source python package
|
description = An open source python package
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Metadata-Version: 2.1
|
Metadata-Version: 2.1
|
||||||
Name: guan
|
Name: guan
|
||||||
Version: 0.1.112
|
Version: 0.1.113
|
||||||
Summary: An open source python package
|
Summary: An open source python package
|
||||||
Home-page: https://py.guanjihuan.com
|
Home-page: https://py.guanjihuan.com
|
||||||
Author: guanjihuan
|
Author: guanjihuan
|
||||||
|
@ -302,10 +302,10 @@ def draw_dots_and_lines(coordinate_array, draw_dots=1, draw_lines=1, max_distanc
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
coordinate_array = np.array(coordinate_array)
|
coordinate_array = np.array(coordinate_array)
|
||||||
print(coordinate_array.shape)
|
|
||||||
x_range = max(coordinate_array[:, 0])-min(coordinate_array[:, 0])
|
x_range = max(coordinate_array[:, 0])-min(coordinate_array[:, 0])
|
||||||
y_range = max(coordinate_array[:, 1])-min(coordinate_array[:, 1])
|
y_range = max(coordinate_array[:, 1])-min(coordinate_array[:, 1])
|
||||||
fig, ax = plt.subplots(figsize=(6*x_range/y_range,6))
|
fig, ax = plt.subplots(figsize=(6*x_range/y_range,6))
|
||||||
|
ax.set_aspect('equal') # important code ensuring that the x and y axes have the same scale.
|
||||||
plt.subplots_adjust(left=0, bottom=0, right=1, top=1)
|
plt.subplots_adjust(left=0, bottom=0, right=1, top=1)
|
||||||
plt.axis('off')
|
plt.axis('off')
|
||||||
if draw_lines==1:
|
if draw_lines==1:
|
||||||
|
@ -307,7 +307,7 @@ def write_one_dimensional_data_without_opening_file(x_array, y_array, f):
|
|||||||
i0 += 1
|
i0 += 1
|
||||||
|
|
||||||
# 在文件中写入XYZ数据(一行一组x, y, z)
|
# 在文件中写入XYZ数据(一行一组x, y, z)
|
||||||
def write_one_dimensional_data(x_array, y_array, z_array, filename='a', file_format='.txt'):
|
def write_xyz_data(x_array, y_array, z_array, filename='a', file_format='.txt'):
|
||||||
import guan
|
import guan
|
||||||
with open(filename+file_format, 'w', encoding='UTF-8') as f:
|
with open(filename+file_format, 'w', encoding='UTF-8') as f:
|
||||||
write_xyz_data_without_opening_file(x_array, y_array, z_array, f)
|
write_xyz_data_without_opening_file(x_array, y_array, z_array, f)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user