Skip to content

Instantly share code, notes, and snippets.

@raphaeldussin
Created October 18, 2019 14:17
Show Gist options
  • Select an option

  • Save raphaeldussin/49f00a3bd9214d93acb2b8e87411dca5 to your computer and use it in GitHub Desktop.

Select an option

Save raphaeldussin/49f00a3bd9214d93acb2b8e87411dca5 to your computer and use it in GitHub Desktop.
set time axis with cftime
pic_start = cftime.num2date(0, 'days since 0001-01-01')
pic_end = cftime.num2date(1200*365.25, 'days since 0001-01-01')
plt.figure(figsize=[8,6])
ax1 = plt.subplot(211)
plt.plot(ds_nadw_CM4_piC['time'], ds_nadw_CM4_piC['vol_nadw_atl'], 'k')
ax1.set_xlim([pic_start, pic_end])
ax2 = plt.subplot(212)
plt.plot(ds_nadw_CESM2_piC['time'], ds_nadw_CESM2_piC['vol_nadw_atl'], 'r')
ax2.set_xlim([pic_start, pic_end])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment