question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Should imshow display a grid by default when under seaborn style?

See original GitHub issue

Currently, if seaborn is imported, imshow will overlay a white grid over its image: $ python -c 'from pylab import *; import seaborn; imshow(rand(20, 20)); show()' I feel that if one is calling directly imshow, rather than some higher level method in seaborn, it is more likely that one is just trying to plot some real image data and does not want the grid. Is there a way to avoid adding the grid for such plots? (other than wrapping each call using set_style…)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
mwaskomcommented, Dec 17, 2014

You can also use axes_style in a with statement, which will at least save you one line of code per plot:

with sns.axes_style("white"):
    plt.imshow(x)
2reactions
mwaskomcommented, Dec 17, 2014

Well, that’s expected behavior. I don’t know why matplotlib draws imshow the way it does, but one way to avoid this is to set the zorder of the image to something greater than 0, should should put it over the grid.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Controlling figure aesthetics — seaborn 0.12.1 documentation
Seaborn splits matplotlib parameters into two independent groups. The first group sets the aesthetic style of the plot, and the second scales various...
Read more >
How to get rid of grid lines when plotting with Seaborn + ...
This is the best answer since you can use it with seaborn, pandas and matplotlib alike. Just call ax.grid(False) on whatever axes you...
Read more >
Seaborn is actually quite good for data visualization
Apply the default default seaborn theme, scaling, and color palette. ... Categorical variables that will determine the faceting of the grid.
Read more >
Chapter 4. Visualization with Matplotlib - O'Reilly
imshow () by default follows the standard image array definition where the origin is in the upper left, not in the lower left...
Read more >
Customizing Matplotlib with style sheets and rcParams
You can control the defaults of almost every property in Matplotlib: figure size and DPI, line width, color and style, axes, axis and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found