3
$\begingroup$

Consider the following code.

f[x_] := Sin[x];
Plot[f[x], {x, 0, 2*Pi}, 
  PlotRange -> {{0, 2*Pi}, {-2, 2}}, 
  Axes -> False, Frame -> True, FrameStyle -> Black, 
  FrameLabel -> {Style["x", FontSize -> 18], Style["sin(x)", FontSize -> 18]}, 
  LabelStyle -> Directive[FontFamily -> "Times New Roman", 14], 
  ImagePadding -> {{Automatic, 15}, {Automatic, 10}}, 
  FrameTicks -> {{{-2, 0, 2}, None}, {{0, \[Pi], 2 \[Pi]}, None}}, 
  FrameStyle -> Directive[Black, Thickness[0.003]], 
  RotateLabel -> False]

enter image description here

I want to expand the gap between the frame label and the frame, namely the gap occupied by the red rectangle below.

enter image description here

$\endgroup$
0

1 Answer 1

3
$\begingroup$

Use Spacings inside Labeled

Labeled[Plot[f[x], {x, 0, 2*Pi}, PlotRange -> {{0, 2*Pi}, {-2, 2}}, 
  Axes -> False, Frame -> True, FrameStyle -> Black, 
  ImagePadding -> {{Automatic, 15}, {Automatic, 10}}, 
  FrameTicks -> {{{-2, 0, 2}, None}, {{0, \[Pi], 2 \[Pi]}, None}}, 
  FrameStyle -> Directive[Black, Thickness[0.003]], 
  RotateLabel -> False], 
 TraditionalForm /@ {Sin[x], x}, {Left, Bottom}, 
 Spacings -> {5, 0}]

enter image description here

$\endgroup$

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