Reran with tight_layout for interactive plots
This is just so everything looks nice in nbviewer. I added plt.tight_layout() to the interactive_plot context manager, which makes plots fill the output cell better.
This commit is contained in:
@@ -34,17 +34,16 @@ def plot_height_std(x, lw=10):
|
||||
facecolor='yellow', alpha=0.4)
|
||||
plt.xlabel('student')
|
||||
plt.ylabel('height (m)')
|
||||
plt.show()
|
||||
|
||||
|
||||
def plot_correlated_data(X, Y, xlabel=None,
|
||||
def plot_correlated_data(X, Y, xlabel=None,
|
||||
ylabel=None, equal=True):
|
||||
|
||||
plt.scatter(X, Y)
|
||||
|
||||
|
||||
if xlabel is not None:
|
||||
plt.xlabel('Height (in)');
|
||||
|
||||
plt.xlabel('Height (in)');
|
||||
|
||||
if ylabel is not None:
|
||||
plt.ylabel('Weight (lbs)')
|
||||
|
||||
@@ -112,7 +111,6 @@ def display_stddev_plot():
|
||||
ax.xaxis.set_ticklabels(['$-2\sigma$', '$-1\sigma$','$\mu$','$1\sigma$', '$2\sigma$'])
|
||||
ax.yaxis.set_ticks([])
|
||||
ax.grid(None, 'both', lw=0)
|
||||
plt.show()
|
||||
|
||||
if __name__ == '__main__':
|
||||
display_stddev_plot()
|
||||
Reference in New Issue
Block a user