1

Please suggest how to plot $ \sin\theta $ in degree. I am trying using the given below code but it is not working (It works if used Ticks without Frame -> True).

Plot[{Sin[θ°]}, {θ, 0, 360}, Frame -> True, 
      PlotStyle -> {Red, Thickness[.009]}, 
      FrameTicks -> {{Automatic, Automatic}, {Range[0, 360, 45], 
      Automatic}}, FillingStyle -> LightBlue, Filling -> Bottom]

enter image description here

Gopal Verma
  • 1,055
  • 7
  • 11

1 Answers1

2

One way to introduce units on the horizontal axis would be to define

ticks = Thread[{Range[0, 360, 45], 
   Quantity[Range[0, 360, 45], "°"]}];

And then plot with

Plot[{Sin[θ °]}, {θ, 0, 360}, Frame -> True, 
 PlotStyle -> {Red, Thickness[.009]}, 
 FrameTicks -> {{Automatic, Automatic}, {ticks, Automatic}}, 
 FillingStyle -> LightBlue, Filling -> Bottom]

enter image description here

A simple way to vary the filling color is with Lighter and Darker. For example, FillingStyle -> Lighter[Blue, 3/10] makes the filling color about 30% lighter than Blue alone.

Another way is with FillingStyle -> Directive[Opacity[7/10],Blue]. This also makes the filling color about 30% lighter than Blue alone. Directive has many useful options and can be applied in many ways.

The Mathematica documentation describes many other ways to specify colors. Another example is use FillingStyle -> Hue[0.6, 0.2]. The 0.6 value makes it blue. Lower or raise the second value to get a lighter or darker blue.

LouisB
  • 12,528
  • 1
  • 21
  • 31
  • ,Thanks, It is working.Can you also suggest that how to vary opacity of filling style. Please use blue instead of LightBlue. – Gopal Verma Feb 17 '20 at 00:14