我有7个高度不同的BarPlot。我只想绘制高度为15的所有内容(例如)。这是我的代码和渲染的图像:
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from matplotlib import style
from numpy import *
import numpy as np
from pylab import *
....
def create_plots0():
xs=[]
ys=[]
for i in range(280):
xs.append(i)
k=np.loadtxt('best_polymer.txt')
for i in range(280):
ys.append(k[i][0])
return xs, ys
...
ax1=fig.add_subplot(711)
ax2=fig.add_subplot(712)
ax3=fig.add_subplot(713)
ax4=fig.add_subplot(714)
ax5=fig.add_subplot(715)
ax6=fig.add_subplot(716)
ax7=fig.add_subplot(717)
x,y=create_plots0()
ax1.bar(x,y,color='Gray')
....
plt.show()
fig.savefig('Prova6.png')[Barplots][1]