4

Is there a simple way, besides changing my function to use Degree as input, to display the x-axis in degrees in a plot of a function defined with its independent variable taking radians?

m_goldberg
  • 107,779
  • 16
  • 103
  • 257
henry leung
  • 51
  • 1
  • 2

1 Answers1

4
f[range_List, divs_] := {# Pi/180, # Degree} & /@ FindDivisions[range 180/Pi, divs, 10]; 
plot[g_, range_]:= Plot[g[x], Evaluate@Join[{x}, range], Ticks-> {f[range, 10], Automatic}];
g = Sin;
plot[g, {0, 2 Pi}]

Mathematica graphics

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453