In the following script I would like to change on the X-Axis the 0 to a 100 and delete the labels for 3000/5000/6000/7000. I successfully get the Xaxis with TAxis* a = G1->GetXaxis(); and adjust the labeling with
a->SetNdivisions(510, kTRUE); But when I would like to change the label with a->ChangeLabel(0,-1,-1,-1,-1,-1,“100”); I get an error.
Processing original.c...
In file included from input_line_11:1:
/Users/couet/Downloads/original.c:165:18: warning: implicit conversion from 'double' to 'Width_t' (aka 'short') changes value from 2.5 to 2 [-Wliteral-conversion]
G1->SetLineWidth(2.5);
~~~~~~~~~~~~ ^~~
/Users/couet/Downloads/original.c:191:18: error: redefinition of 'm'
TMarker *m = new TMarker(1000,y, 7);
^
/Users/couet/Downloads/original.c:183:18: note: previous definition is here
TMarker *m = new TMarker(100,y, 7);
^
/Users/couet/Downloads/original.c:199:18: error: redefinition of 'm'
TMarker *m = new TMarker(2000,y, 7);
^
/Users/couet/Downloads/original.c:183:18: note: previous definition is here
TMarker *m = new TMarker(100,y, 7);
^
/Users/couet/Downloads/original.c:207:18: error: redefinition of 'm'
TMarker *m = new TMarker(4000,y, 7);
^
/Users/couet/Downloads/original.c:183:18: note: previous definition is here
TMarker *m = new TMarker(100,y, 7);
^
/Users/couet/Downloads/original.c:215:18: error: redefinition of 'm'
TMarker *m = new TMarker(8000,y, 7);
^
/Users/couet/Downloads/original.c:183:18: note: previous definition is here
TMarker *m = new TMarker(100,y, 7);
Thank you very much. That answers a lot. But I still have two problems:
The dots with MarkerStyle 8 are not visible, when you plot the .tex file.
I changed the Label 0 on the Axis with 100, but the picture in my paper is sadly too big so one notices the difference. Is there a way to add the label 100 at the axis position 100? Alternatively one coul just move the old 100 which was at the position of 0 slightly to the right.
Changing the alignment to “left” will shift it a bit to the right but that might be not enough. If you want to place a label in some random place not related to the real axis labelling the best might be to remove label 0 and draw 100 as a TText where you need it.