Here is another approach which is based on converting the plot to PDF format first. It makes the tick marks accessible as regular Graphics
objects. Specifically, they (and the frame) show up as open JoinedCurve
that can be identified by pattern matching. That leads to the following:
p = Plot[{Sin[x], Cos[x]}, {x, 0, 3 Pi}, Frame -> True,
FrameStyle -> Directive[Black, Thick]];
First@ImportString[ExportString[p, "PDF"], "PDF"] /.
JoinedCurve[{{{0, 2, 0}}}, x_,
CurveClosed -> {0}] :> {CapForm["Round"],
JoinedCurve[{{{0, 2, 0}}}, x, CurveClosed -> {0}]}
What I did here is to replace the identified curves by wrapping them in {CapForm["Round"], ...}
. This will affect all straight lines, including the frame itself (but the frame doesn't have end points because the corners overlap anyway). The plot lines themselves are not affected by the rounding because they aren't straight lines.
The advantage of this approach is that you don't have to manually calculate and specify the tick positions: the ticks will be modified in post-processing without changing their positions. The disadvantage is that the ticks in the resulting plot can no longer be modified by changing the options with Show
, because they are "baked in".