#630 set xtics {no}label {level <n>}

open
nobody
None
5
2013-07-15
2013-07-12
Shigeharu TAKENO
No

For a data file "data":

04/09 45 9
04/16 49 5
04/23 41 13
04/30 33 21
05/14 40 14
...

we can set strings of column 1 to xtic labels:

set grid
plot 'data' using 0:2:xtic(1) t 'present' w lp lt 3,\ '' using 0:3 t 'absent' w boxes lt 1

I wanted to put them on the top of the boxes instead of xtic labels:

set grid
plot 'data' using 0:2 t 'present' w lp lt 3,\ '' using 0:3 t 'absent' w boxes lt 1, \ '' using 0:($3+2):1 not w labels

In this case, though I wanted to remain xtic mark for the grid and
to remove xtic labels since xtic labels are taken from column 0
which has no mean, I could not find the simple way to do that.

I think it may be useful if there is the following option of "set
xtics" to remove only xtic labels:

set xtics {no}label {level <n>}

Ex.
set xtics label # All level xtic labels are ON except level 1
set xtics label level 3 # level 3 xtic labels are ON
# (others are no change)
set xtics nolabel # All level xtic labels are OFF
set xtics nolabel level 3 # level 3 xtic labels are OFF

Attached patch may realize the feature.

1 Attachments

Discussion

  • Ethan Merritt
    Ethan Merritt
    2013-07-14

    In this case, though I wanted to remain xtic mark for the grid and
    to remove xtic labels since xtic labels are taken from column 0
    which has no mean, I could not find the simple way to do that.

    set format x ""

     
  • Ethan Merritt
    Ethan Merritt
    2013-07-15

    I may not understand correctly, but perhaps this does what you want?
    ~
    plot 'data' using 0:2:xticlabels("") t 'present' w lp lt 3,\ '' using 0:3 t 'absent' w boxes lt 1, \ '' using 0:($3+2):1 not w labels

    Since xticlabels(FOO) tries to interpret FOO as a string value, setting it to "" produces an empty label.

     
  • Thanks for your alternative solutions.