동일한 데이터를 두 가지 형식, 즉 로그 배율 및 선형 배율로 플롯합니다.동일한 '설정'을 가진 matplotlib 서브 플로트
기본적으로 나는 똑같은 음모가 있지만 다른 음계가 하나씩 다른 음절을 사용하고 싶습니다.
import matplotlib.pyplot as plt
# These are the plot 'settings'
plt.xlabel('Size')
plt.ylabel('Time(s)');
plt.title('Matrix multiplication')
plt.xticks(xl, rotation=30, size='small')
plt.grid(True)
# Settings are ignored when using two subplots
plt.subplot(211)
plt.plot(xl, serial_full, 'r--')
plt.plot(xl, acc, 'bs')
plt.plot(xl, cublas, 'g^')
plt.subplot(212)
plt.yscale('log')
plt.plot(xl, serial_full, 'r--')
plt.plot(xl, acc, 'bs')
plt.plot(xl, cublas, 'g^')
모든 '설정'
plt.subplot 전에이 무시됩니다은 내가 지금해야하는 것은 이것이다.
내가 원하는대로 작동하도록 할 수는 있지만 각 서브 플로트 선언 후에 모든 설정을 복제해야합니다.
두 서브 플로트를 동시에 구성하는 방법이 있습니까?
예기치 않은 오류가 발생하지 않도록 try 블록을 편집했습니다. (편집 대기열에 있음). – Joooeey