Skip to content

[heavy_tails] update axis labels #319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions lectures/heavy_tails.md
Original file line number Diff line number Diff line change
Expand Up @@ -516,11 +516,12 @@ for data, label, ax in zip(data_list, labels, axes):

ax.loglog(x_grid, [eccdf(x, data) for x in x_grid],
'o', markersize=3.0, alpha=0.5, label=label)
ax.set_xlabel("log rank")
ax.set_ylabel("log size")

ax.set_ylabel("log prob")

ax.legend()


ax.set_xlabel("log value")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shlff , from this display it looks like the xlabel on 523 comes after ax.legend(). Don't you want it to be on line 520 and indented the same as ylabel?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jstac .

There are three stacked plots aligned by the same x-axis. With the above code I intended to keep only the x-axis label for the bottom plot to avoid repetition.

However, to add more clarity, I think it might be better to change it back. Please find the commit below.


fig.subplots_adjust(hspace=0.4)

plt.show()
Expand Down Expand Up @@ -630,7 +631,7 @@ def empirical_ccdf(data,
if not xlabel:
xlabel='log value'
ax.set_xlabel(xlabel, fontsize=12)
ax.set_ylabel("log prob.", fontsize=12)
ax.set_ylabel("log prob", fontsize=12)

if label:
ax.legend(loc='lower left', fontsize=12)
Expand Down Expand Up @@ -825,8 +826,8 @@ for n in range(1, N):

# Plot
ax.plot(range(N), sample_mean, alpha=0.6, label='$\\bar{X}_n$')

ax.plot(range(N), np.zeros(N), 'k--', lw=0.5)
ax.set_xlabel(r"$n$")
ax.legend()

plt.show()
Expand Down