How to deal with y=0 tic for special formatted label [duplicate]

时光毁灭记忆、已成空白 提交于 2020-01-03 02:28:07

问题


Suppose I have a script like this

set terminal png enhanced
set output "test.png"
set ytics format "%.1t 10^{%S}"
set ytics 5000
set mytics 5
set xrange [0:16000]
plot x

Which produces the following.

I do wnat major tics as well as minor tics. However, the tic at zero looks ugly, so I would like to modify or delete it.

I tried set ytics (5000,10000,15000). This is possible, but then I loose the minor tics. Also, I don't want to put the tics manually.

So a solution to this problem would

  • remove the y=0 tic or
  • modify the set ytics format or
  • adds minor tics for manual major tics, but according to the manual this is not possible.

An other solution that I didn't think of is of course also appreciated!


回答1:


You can just overwrite the 0 tic with set ytics ('0' 0):

set ytics format "%.1t 10^{%S}"
set ytics 5000
set ytics add ('0' 0)
set mytics 5
set xrange [0:16000]
plot x

See also excluding a tic number in scientific format.



来源:https://stackoverflow.com/questions/19857384/how-to-deal-with-y-0-tic-for-special-formatted-label

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