1
$\begingroup$

I have the following function that I would like to plot:

g1[x_, t_] := Tan[x]*Sin[2 Pi t] + Cot[x]*Cos[2 Pi t];
rs1 := {x, -2 \[Pi], 2 \[Pi]};
rx1 := {-2 \[Pi], 2 \[Pi]};
ry1 := rx1;
b = rx1[[2]] - rx1[[1]];
b1 = Table[i*b/8 + rx1[[1]], {i, 7}]

Plot[g1[x, 0.01], Evaluate[rs1], PlotRange -> {rx1, ry1}, 
 PlotStyle -> {Purple}, Axes -> False, AspectRatio -> Automatic, 
 Frame -> True, FrameTicks -> {b1, b1}, FrameStyle -> White, 
 FrameTicksStyle -> Black]

enter image description here

This is very close to what I want, but I want the labeled tick marks to be longer and I want shorter ones in between (with no corresponding number next to them). So, for example, there should be another black tick in between 0 and pi/2, pi/2 and pi, pi and 3pi/2, and one after 3pi/2, and repeated on the negative side, and they should have no numbers. But that's all.

I drew on the image to make it easier to see where I want those smaller tick marks.

enter image description here

How would I do that?

$\endgroup$
3
$\begingroup$
ticks = Subdivide[## & @@ Rest@rs1, 8];
minorticks = Thread[{MovingAverage[ticks, 2], "", {0, .02}}, List, 1];
majorticks = Thread[{Rest@Most@ticks, Rest@Most@ticks, {0, 0.03}}, List, 2];


Plot[g1[x, 0.01], Evaluate[rs1], PlotRange -> {rx1, ry1}, 
 PlotStyle -> {Purple}, Axes -> False, AspectRatio -> Automatic, 
 Frame -> True, 
 FrameTicks -> {Join[majorticks, minorticks], Join[majorticks, minorticks]}, 
 FrameStyle -> White, 
 FrameTicksStyle -> Black]

enter image description here

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.