Skip to content

Change default matplotlib.rcParams["axes.grid"] from True to False #3347

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
wants to merge 1 commit into from
Closed

Conversation

senseibence
Copy link

Description

When creating heatmaps, matrices, and various graphs using large datasets with seaborn, scanpy.set_figure_params() provides helpful default configurations for the plot. However, one default, caused by matplotlib.rcParams["axes.grid"] = True, provides no benefit to the vast majority of plots, making them unreadable and confusing (especially with very large plots). Below is a simple example; evidently, the distortion increases with graph complexity.

Images

Graph with default grid:

graph_with_grid

Graph without default grid:

graph_without_grid

Conclusion

This change simply modifies matplotlib.rcParams["axes.grid"] from True to False, not affecting any other components of the module. We believe this adjusted default would benefit the majority of graphs compared to the original. If one would like to use the grid lines for any reason (which we believe is a niche use case), they may run matplotlib.pyplot.rcParams["axes.grid"] = True.

Copy link

codecov bot commented Nov 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.59%. Comparing base (d0adc25) to head (7562ad2).
Report is 56 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3347   +/-   ##
=======================================
  Coverage   76.59%   76.59%           
=======================================
  Files         111      111           
  Lines       12827    12827           
=======================================
  Hits         9825     9825           
  Misses       3002     3002           
Files with missing lines Coverage Δ
src/scanpy/plotting/_rcmod.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@senseibence
Copy link
Author

Could someone help with the checks for this PR?

@senseibence senseibence closed this Dec 9, 2024
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

Successfully merging this pull request may close these issues.

1 participant