You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to propose making tick marks point outward by default (and for the 2.0 release). The idea for this comes from William Cleveland's Elements of Graphing Data. I quote directly from him:
...tick marks should point outward. This format prevents data from being obscured (page 33)
The idea is really simple. Data belongs on the inside of the axes frame. If your tick marks point inwards, there is a good chance that the tick marks and data will interfere. This type of interference happens often in practice with dense amounts of data in line/scatter plots and with all kinds of color/surface plots. Here is a simple example:
The tick marks on a a default styled pcolor plot are almost impossible to see along some borders:
The tick marks outwards become extremely helpful and visible:
Cleveland's way of describing this choice also helps me to understand the default visual styling of ggplot2 and seaborn, which use a) no tick marks and b) light grid lines against a grey bg. This is simply a different way of providing the visual guides for plots that don't interfere with the data itself. The other option for the defaults would be to move in this direction (no tick marks with light grid lines on a grey bg), but I think that is probably too much change for the defaults.
Could also look at the seaborn ticks style which does this through the rcParams. (I actually use it more than the "default" seaborn style for personal work...).
Should also mention that R base plots look this way by default.
I should note that if there isn't enough support to change the default on
this, I think it would be nice to have a method to quickly do this on an
axes (maybe ticks_out and ticks_in).
On Sun, Jun 7, 2015 at 7:06 PM, Eric Firing [email protected]
wrote:
On 2015/06/07 3:48 PM, Brian E. Granger wrote:
I should note that the code for doing this on a particular axis is this:
Notice how the leftmost and rightmost bars have mysteriously turned into stacked bars or... something? wtf is this? OHH right it's just really confusing ticks.
[EDIT: whether you have to use 100 or 200 to get the exact effect I'm referring to seems to depend on the matplotlib version in some way I don't understand... historically it's been 100 for me, and it seems to be 100 for @ellisonbg below, but I seem to need 200 now, so eh, try both if you don't see what I'm talking about.]
As for making a PR for this: my suggestion would be to:
create two new built-in styles called "matplotlib1" and "_matplotlib2.0", which initially are identical to the current default style
arrange so that by default we style.use("matplotlib1")
make this change to the "_matplotlib2.0" style
And then we can accumulate all the visual changes for 2.0 in the "_matplotlib2.0" style, and when we're done we rename "_matplotlib2.0" -> "matplotlib2.0", release 1.last, and then switch our default to be style.use("matplotlib2.0") and release 2.0.
FWIW, I was surprised today to see this new default, and am very much against it. While I can see situations where this can be useful, the following simple example is in my opinion worse than before:
I think what bugs me is the outward ticks on the top and right axes. Many of the examples I've found that look ok with outward ticks have ticks only on the left and bottom axes and no axes on the top and right. I don't think mixing the full axes box and outward ticks works. I'm not expecting the default to be changed back of course, but just wanted to make sure I voiced an opinion as a user, in case others feel the same.
Reacted by Adam Ginsburg, Erik Tollerud and Sam Foreman
In many cases, there are reasons to remove the T+R axes+ticks. This usually makes sense when there is no/little data in the upper right portion of the plot that you need to judge the position of visually. Another approach is to put always keep the B+L axes+ticks and use grid lines to guide the eye. That is the route that vega-lite as gone:
I think the vega-lite style works well in general, but as a default in matplotlib, I think using grid lines by default is going a bit too far from. Thus the box+tick marks.
What I don't think is appropriate as a default style is to have no T+R axes+ticks and no grid lines. Then there is too little to guide the eye.
I have described the reasoning for outward tick marks above and won't repeat it again.
Activity
neilpanchal commentedon Jun 8, 2015
This makes so much sense. I never noticed it but now I will everyday. This must be done.
mlgill commentedon Jun 8, 2015
I have a code snippet I use all the time that puts the tick marks outside for this exact reason. So I'm all for it.
mlgill commentedon Jun 8, 2015
@MrTomWhite Changing the tick mark direction, what I was referring to, is a setting that is applied after the plot is made....
And I definitely don't have the time to be dealing with PRs right now.
ellisonbg commentedon Jun 8, 2015
I should note that the code for doing this on a particular axis is this:
ellisonbg commentedon Jun 8, 2015
Oh, the
width=1part is probably not needed, but I have found it to be nice.mwaskom commentedon Jun 8, 2015
Could also look at the seaborn
ticksstyle which does this through the rcParams. (I actually use it more than the "default" seaborn style for personal work...).Should also mention that R base plots look this way by default.
efiring commentedon Jun 8, 2015
On 2015/06/07 3:48 PM, Brian E. Granger wrote:
More generally, it is also controlled by matplotlibrc, or by modifying
the corresponding rcParams entries, or by using a style file to handle this.
e.g. in your matplotlibrc:
xtick.direction : out
ytick.direction : out
xtick.major.width : 1
ytick.major.width : 1
etc.
Eric
ellisonbg commentedon Jun 8, 2015
I should note that if there isn't enough support to change the default on
this, I think it would be nice to have a method to quickly do this on an
axes (maybe
ticks_outandticks_in).On Sun, Jun 7, 2015 at 7:06 PM, Eric Firing [email protected]
wrote:
Brian E. Granger
Cal Poly State University, San Luis Obispo
@ellisonbg on Twitter and GitHub
[email protected] and [email protected]
ellisonbg commentedon Jun 8, 2015
The default histogram styling (tick marks in) is another case where you can be pretty sure you will never see the tick marks along the lower frame:
njsmith commentedon Jun 8, 2015
For extra histogram fun, try plotting a non-normal distribution with lots of bins:
Notice how the leftmost and rightmost bars have mysteriously turned into stacked bars or... something? wtf is this? OHH right it's just really confusing ticks.
[EDIT: whether you have to use 100 or 200 to get the exact effect I'm referring to seems to depend on the matplotlib version in some way I don't understand... historically it's been 100 for me, and it seems to be 100 for @ellisonbg below, but I seem to need 200 now, so eh, try both if you don't see what I'm talking about.]
njsmith commentedon Jun 8, 2015
As for making a PR for this: my suggestion would be to:
style.use("matplotlib1")And then we can accumulate all the visual changes for 2.0 in the "_matplotlib2.0" style, and when we're done we rename "_matplotlib2.0" -> "matplotlib2.0", release 1.last, and then switch our default to be
style.use("matplotlib2.0")and release 2.0.gumption commentedon Jun 8, 2015
I prefer the outward tick marks, and support making outward (vs. inward) tick marks the default.
empet commentedon Jun 8, 2015
A figure with inward ticks looks better. Many journals stress in their submission/publication guidelines that figure tick marks must point inward.
35 remaining items
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
Outward ticks (Fix matplotlib#4502)
astrofrog commentedon May 17, 2016
FWIW, I was surprised today to see this new default, and am very much against it. While I can see situations where this can be useful, the following simple example is in my opinion worse than before:
I think what bugs me is the outward ticks on the top and right axes. Many of the examples I've found that look ok with outward ticks have ticks only on the left and bottom axes and no axes on the top and right. I don't think mixing the full axes box and outward ticks works. I'm not expecting the default to be changed back of course, but just wanted to make sure I voiced an opinion as a user, in case others feel the same.
ellisonbg commentedon May 17, 2016
In many cases, there are reasons to remove the T+R axes+ticks. This usually makes sense when there is no/little data in the upper right portion of the plot that you need to judge the position of visually. Another approach is to put always keep the B+L axes+ticks and use grid lines to guide the eye. That is the route that vega-lite as gone:
I think the vega-lite style works well in general, but as a default in matplotlib, I think using grid lines by default is going a bit too far from. Thus the box+tick marks.
What I don't think is appropriate as a default style is to have no T+R axes+ticks and no grid lines. Then there is too little to guide the eye.
I have described the reasoning for outward tick marks above and won't repeat it again.