Skip to content

kf_book/gaussian_internal.py axis label error #352

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

Closed
BorgPhysics opened this issue Aug 31, 2020 · 2 comments
Closed

kf_book/gaussian_internal.py axis label error #352

BorgPhysics opened this issue Aug 31, 2020 · 2 comments

Comments

@BorgPhysics
Copy link

The kf_book/gaussian_internal.py code has a bug that over-writes the x and y axis titles. The plot_correlated_data code here:

if xlabel is not None:
plt.xlabel('Height (in)');

if ylabel is not None:

plt.ylabel('Weight (lbs)')

Should be something like this:

if xlabel is None:
    xlabel = 'Height (in)'

if ylabel is None:
    ylabel = 'Weight (lbs)'
    
plt.xlabel(xlabel);
plt.ylabel(ylabel)
@BorgPhysics
Copy link
Author

I see in other examples that None is passed in to drop the labels entirely. I guess that it should be this in order to fit with the other code:
if xlabel is not None:
plt.xlabel(xlabel);

if ylabel is None:
plt.ylabel(ylabel)

rlabbe added a commit that referenced this issue Oct 13, 2020
axis labels were hard coded, ignoring value passed in.

Also added docstring to function.
@rlabbe
Copy link
Owner

rlabbe commented Oct 13, 2020

Thanks, fixed!

@rlabbe rlabbe closed this as completed Oct 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants