2014-05-14 2 views
0

I가 그것을 허용하는 내 파이썬 코드를 조정할 수 있는지가 궁금 enter image description here사용하기 matplotlib 10 줄거리를 보여 한꺼번에

을 같이 나는 단지 모두 하나의 그림 9를 인쇄하기 matplotlib 사용할 수있는 10 줄거리가 10 번째 음모에 맞습니까?

여기에 지금까지 플롯을 구성한 방법이 나와 있습니다.

fig = plt.figure(figsize=(10,8)) 
a1 = fig.add_subplot(331) 
a2 = fig.add_subplot(332) 
a3 = fig.add_subplot(333) 
a4 = fig.add_subplot(334) 
a5 = fig.add_subplot(335) 
a6 = fig.add_subplot(336) 
a7 = fig.add_subplot(337) 
a8 = fig.add_subplot(338) 
a9 = fig.add_subplot(339) 
+0

모든 것에 적합하도록 2x5 레이아웃으로 만들 수 있습니다. – Ray

+0

서브 Plot의 논쟁이 331 또는 332 인 이유는 무엇입니까? 1,2,3 – Boris

답변

3

그냥 플롯 그리드를 증가 :

fig = plt.figure(figsize=(10,8)) 
a1 = fig.add_subplot(521) 
a2 = fig.add_subplot(522) 
a3 = fig.add_subplot(523) 
a4 = fig.add_subplot(524) 
a5 = fig.add_subplot(525) 
a6 = fig.add_subplot(526) 
a7 = fig.add_subplot(527) 
a8 = fig.add_subplot(528) 
a9 = fig.add_subplot(529) 
a10 = fig.add_subplot(5,2,10) 

fig.add_subplot(52X) 5 행에 대한 짧은 손으로, 2 열, X 번째 플롯에 의해. 코드는 3 x 3 격자이기 때문에 9 개의 플롯 만 허용됩니다 (fig.add_subplot (33X)). 5 x 2 그리드로 증가 시키면 10 번째 플롯이됩니다.

원하는대로 원하는대로 열 또는 행 수를 다시 배열 할 수 있습니다.

+0

감사합니다. 그러나 내 플롯 제목이 축 값과 겹치기 때문에 무화과 크기를 어떻게 조정합니까? – user1821176

관련 문제