Beispiel #1
0
right = 0.98  # the right side
hspace = 0.20  # height reserved for white space
wspace = 0.05  # width reserved for blank space
plt.subplots_adjust(left=left,
                    bottom=bottom,
                    right=right,
                    top=top,
                    wspace=wspace,
                    hspace=hspace)

tit = plt.title('1850')
#showdate = ax.text(0.5, 0.95, '1850', fontweight = 'bold', color = cset[0], bbox=dict(facecolor='lightsteelblue', edgecolor='black', boxstyle='round,pad=1'))

save = True
if save:
    metadata = dict(title='Temperature anomaly (SPHINX lcb0 experiment)',
                    artist='Federico Fabiano')
    writer = ImageMagickFileWriter(
        fps=10, metadata=metadata)  #, frame_size = (1200, 900))
    with writer.saving(fig, cart + "Temp_anomaly_animation_flat.gif", 150):
        for i, (year, col) in enumerate(zip(anni, cset)):
            print(year)
            animate(i)
            writer.grab_frame()
else:
    line_ani = animation.FuncAnimation(fig,
                                       animate,
                                       len(anni),
                                       interval=100,
                                       blit=False)
line = zonal_anom_b[anni == anni[0]].squeeze()
ax.plot(lat, line, color=cset[0])
plt.ylim(-3., 18.)
showdate = ax.text(0.,
                   24.,
                   '1850',
                   fontweight='bold',
                   color=cset[0],
                   bbox=dict(facecolor='lightsteelblue',
                             edgecolor='black',
                             boxstyle='round,pad=1'))

save = True

if save:
    metadata = dict(title='Zonal temperature anomaly (SPHINX lcb experiments)',
                    artist='Federico Fabiano')
    writer = ImageMagickFileWriter(
        fps=10, metadata=metadata)  #, frame_size = (1200, 900))
    with writer.saving(fig, cart + "Zonal_temp_anomaly_animation.gif", 100):
        for i, (year, col) in enumerate(zip(anni, cset)):
            print(year)
            update_lines(i)
            writer.grab_frame()
else:
    line_ani = animation.FuncAnimation(fig,
                                       update_lines,
                                       len(anni),
                                       interval=100,
                                       blit=False)