Skip to content
Advertisement

Seaborn Adjusting Markers

enter image description here

As you can see here, the X axis labels here are quite unreadable. This will happen regardless of how I adjust the figure size. I’m trying to figure out how to adjust the labeling so that it only shows certain points. The X axis are all numerical between -1 to 1, and I think it would be nice and more viewer friendly to have labels at -1, -.5, 0, .5 and 1.

Is there a way to do this? Thank you!

Here’s my code

JavaScript

Advertisement

Answer

Basically seaborn is wrapper on matplotlib. You can use matplotlib ticker function to do a Job. Refer the below example.

Let’s Plots tick every 1 spacing.

JavaScript

everytick

Now Let’s plot ticks every 5 ticks.

JavaScript

every5

P.S.: This solution give you explicit control of the tick spacing via the number given to ticker.MultipleLocater(), allows automatic limit determination, and is easy to read later.

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement