0
사용자는 "loadingfiles"에서 tkinter를 사용하여 4 개의 디렉토리를 선택하게했습니다. 여기에서 각 디렉토리의 모든 파일을로드합니다. 어떻게 모든 하위 그림을 PDF로 저장할 수 있습니까? 나는 주된 기능에서 그것을해야만한다는 것을 안다. 그러나 나는 이것에 대해 어떻게 갈 것이냐?다른 기능을 사용하여 하나의 pdf에 여러 개의 서브 도표 저장하기
def loadingfiles():
#loads all of the files from each directory
#returns Files
def initialize_and_Calculate(Files=[],*args):
fig = plt.figure()
fig.set_size_inches(9,5,forward=True)
gs1=gridspec.GridSpec(1,2)
ax0=fig.add_subplot(gs1[0,0])
ax1=fig.add_subplot(gs1[0,1])
#treat x and y as a parameter within a file in a directory. Can be any numbers
ax0.plot(x,y,'-')
ax1.plot(x1,y1,'-')
fig.tight_layout()
def main():
Files=loadingfiles() #this loads the files in directory
L=len(Files)
for c in range (0,L): #this for loops runs the initialize_and_Calc. function per directory.
initialize_and_Calculate(Files[c]) #'File[0]' is directory 1. 'File[1]' is directory 2...and so on
plt.show()
if __name__=="__main__":
main()
이것이 이해가되지 않는다면 어떻게 함수에서 '무화과'를 전달할 수 있습니까? 내 주요 기능에서 인물을 만들면 어떻게해야 '무화과'를 기능에 전달할 수 있을까요?