|
79 | 79 | " if ax is None:\n", |
80 | 80 | " fig, ax = plt.subplots()\n", |
81 | 81 | " for n, _traj in enumerate(data):\n", |
82 | | - " h, e = np.histogram(_traj, bins=30, density=True)\n", |
83 | | - " ax.fill_between(e[1:], h, step='pre', alpha=.33, color='C{}'.format(n))\n", |
84 | | - " \n", |
85 | | - " ylims = (0, ax.get_ylim()[1])\n", |
| 82 | + " ax.hist(_traj, bins=30, alpha=.33, density=True, color='C{}'.format(n));\n", |
| 83 | + " ylims = ax.get_ylim()\n", |
86 | 84 | " xlims = ax.get_xlim()\n", |
87 | 85 | " for n, _traj in enumerate(data):\n", |
88 | 86 | " ax.plot(\n", |
|
100 | 98 | " ax.text(0.86 * xlims[1], 0.5 * ylims[1], '$x(time)$', ha='left', va='center', rotation=90)\n", |
101 | 99 | " ax.set_xlabel('TICA coordinate')\n", |
102 | 100 | " ax.set_ylabel('histogram counts & trajectory time')\n", |
103 | | - " ax.set_ylim(0, ax.get_ylim()[1]) # fill_between resets lower ylim < 0\n", |
104 | 101 | " ax.legend(loc=2)" |
105 | 102 | ] |
106 | 103 | }, |
|
908 | 905 | "name": "python", |
909 | 906 | "nbconvert_exporter": "python", |
910 | 907 | "pygments_lexer": "ipython3", |
911 | | - "version": "3.6.6" |
| 908 | + "version": "3.6.5" |
912 | 909 | }, |
913 | 910 | "toc": { |
914 | 911 | "base_numbering": 1, |
|
0 commit comments