问题
I'm plotting a histogram in gnuplot
and the bars end up covering the tics in the x axis, like so:

Is there any way to prevent this?
回答1:
I don't know for sure if this will work or not, but you can try this:
set grid noxtics noytics noztics front
From reading the documentation, it looks like that will push the tics to the top of the stack of objects when plotting (i.e. they'll get plotted after the bars making them visible (I think)). Another option is to use transparency in your fillstyle, but that may not work depending on your terminal (and it may not be desirable).
回答2:
You can add some lines to your script like
plot 'data.dat' # whatever your plot command is
set yrange [0:GPVAL_DATA_Y_MAX*1.05]
replot
This extends the y range above the highest data point just a bit. To find out the highest y point you have to plot once, then plot again after setting the y range. Another option would be to do
set xtics out
This makes the xtics point out instead of in.
来源:https://stackoverflow.com/questions/12253438/histogram-bar-hiding-tics