2
$\begingroup$

I need to add well-defined ticks in this range Ticks -> {Range[0, Pi, Pi/6], Automatic} to the following plot

enter image description here

This is the code but it is incomplete. Comments and suggestion to solve it

Plot[{  1/2 (1 + Cos[x]^2), Sin[x]^2/(1 + Cos[x]^2) , 
  1/2 (1 + Cos[x]^2) BesselJ[0, Sin[Pi/3] x]^2, 
  Sin[x]^2/(1 + Cos[x]^2) BesselJ[0, Sin[Pi/3] x]^2}, {x, 0, Pi}, 
 Ticks -> {Range[0, Pi, Pi/6], Automatic},  PlotLegends -> Placed[{Subscript[(Subscript[\[Sigma], s]), PW],  Subscript[\[CapitalPi], PW](\[Theta]), Subscript[(Subscript[\[Sigma], s]), BB], 
    Subscript[\[CapitalPi], BB](\[Theta])}, {0.86, 0.5}]]
$\endgroup$
4
$\begingroup$

Use the options Frame and FrameTicks in Plot and the option LegendFunction -> Framed in LineLegend:

Plot[{1/2 (1 + Cos[x]^2), Sin[x]^2/(1 + Cos[x]^2), 
  1/2 (1 + Cos[x]^2) BesselJ[0, Sin[Pi/3] x]^2, 
  Sin[x]^2/(1 + Cos[x]^2) BesselJ[0, Sin[Pi/3] x]^2}, {x, 0, Pi},
 Frame -> True, 
 FrameTicks -> {{Automatic, Automatic}, {Range[0, Pi, Pi/6], Automatic}}, 
 PlotLegends -> Placed[LineLegend[{Subscript[(Subscript[σ, s]), PW], 
     TraditionalForm@Subscript[Π, PW][θ], Subscript[(Subscript[σ, s]), BB], 
     TraditionalForm@Subscript[Π, BB][θ]}, LegendFunction -> Framed], {0.86, 0.5}]]

enter image description here

Use LegendFunction -> "Frame" to get

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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