Histogram bar hiding tics

我与影子孤独终老i 提交于 2019-12-22 08:52:06

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!