SORU
30 HAZİRAN 2011, PERŞEMBE


Sahne boyutu çok subplots ile Aralık matplotlib/geliştirmek

this question çok benzer ama benim rakam olması gereken kadar büyük olabilir ki, bu fark.

Matplotlib dikey olarak yığılmış araziler bir sürü oluşturmak istiyorum. Sonuç figsave kullanarak kaydedilmiş ve bir web sayfasında görüntülenecek, ne kadar uzun subplots olmaması için aralıklı olarak son görüntüyü üst üste umurumda değil.

Ne kadar büyük bir rakam olmasını sağlar olursa olsun, subplots her zaman için üst üste gibi görünüyor.

Şu anda benim kod gibi görünüyor

import matplotlib.pyplot as plt
import my_other_module

titles, x_lists, y_lists = my_other_module.get_data()

fig = plt.figure(figsize=(10,60))
for i, y_list in enumerate(y_lists):
    plt.subplot(len(titles), 1, i)
    plt.xlabel("Some X label")
    plt.ylabel("Some Y label")
    plt.title(titles[i])
    plt.plot(x_lists[i],y_list)
fig.savefig('out.png', dpi=100)

CEVAP
30 HAZİRAN 2011, PERŞEMBE


Plt kullanabilirsiniz.subplots_adjust bu subplots Link arasındaki aralığı değiştirmek için

subplots_adjust(left=None, bottom=None, right=None, top=None, wspace=None, hspace=None)

left  = 0.125  # the left side of the subplots of the figure
right = 0.9    # the right side of the subplots of the figure
bottom = 0.1   # the bottom of the subplots of the figure
top = 0.9      # the top of the subplots of the figure
wspace = 0.2   # the amount of width reserved for blank space between subplots
hspace = 0.5   # the amount of height reserved for white space between subplots

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • Ampisound

    Ampisound

    12 Kasım 2006
  • Jack Vale Films

    Jack Vale Fi

    8 ŞUBAT 2007
  • Rachel Raum

    Rachel Raum

    10 EYLÜL 2007