Skip to main content

plotting - Longer ticks without specifying the ticks itself


I know similar questions have been asked here before, but i can't figure out this specific problem.


I have a lot of plots that i'd like to bring to a publishable form, but in my current customization the ticks are barley visible, therefore i'd like to make them a little bit longer, without having to specify the tick positions itself.



An example would a be a plot like this


ListPlot[Abs@Sin[N[#]] & /@ Range[350],
Frame -> True,
Joined -> True,
PlotRange -> {{35, 300}, {0, 1.05}},
FrameLabel ->
Evaluate[Style[#, 30] & /@ {"T [MeV]", "\[Sigma]/\!\(\*SubscriptBox[\(\[Sigma]\), \(0\)]\)"}],
FrameStyle -> Thick,
LabelStyle -> Directive[25, Thick],
ImageSize -> {720*GoldenRatio, 720}

]

I know i can customize the ticks by adding the following option


FrameTicks -> {
{
{#, If[Chop[Mod[#, 0.25]] == 0, Chop@#, ""], {If[Chop[Mod[#, 0.25]] == 0, 0.015, 0.008], 0}}&/@Range[0, 1.05, 0.05]
,
{#, "", {If[Chop[Mod[#, 0.25]] == 0, 0.015, 0.008], 0}}&/@Range[0,1.05,0.05]
}, {
{#, If[Chop[Mod[#, 50]] == 0, Floor@#,""], {If[Chop[Mod[#, 50]] == 0, 0.015,0.008], 0}}&/@Range[0, 350, 10]

,
{#, "", {If[Chop[Mod[#, 50]] == 0, 0.015, 0.008], 0}}&/@Range[0, 350, 10]
}}

which i adopted from some code i found here.


So basiclly what i'd like are slightly longer ticks on all sides, with numbers on the left and bottom.



Answer



As pointed out by Virgil in the comments, the CustomTicks package resolved the issue.


Comments