Skip to main content
Became Hot Network Question
added 83 characters in body
Source Link
csn899
  • 1
  • 6
  • 17
Manipulate[
 Plot[A Sin[\[Omega] x + \[Phi]] + B, {x, -10, 10}, 
  PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B], PlotRange -> {-6, 6}, 
  Axes -> True, AxesStyle -> Arrowheads[{0.0, 0.04}], 
  AxesLabel -> {x, y}, ImageSize -> 700, 
  Ticks -> {Table[i, {i, -4 \[Pi], 4 \[Pi], \[Pi]/4}], 
    Table[t, {t, -5, 5, 0.5}]}], {{A, 1}, -5, 5, 
  Appearance -> "Labeled"}, {{\[Omega], 1}, -3, 8, 
  Appearance -> "Labeled"}, {{\[Phi], 0}, -\[Pi], 2 \[Pi], 
  Appearance -> "Labeled"}, {{B, 0}, -1, 5, Appearance -> "Labeled"}]

enter image description here

How to modify the following label code so that when the value of [Phi] is negative, only a - sign is used to connect it in the middle, instead of continuously appearing in the label+-

PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B]

enter image description here

Manipulate[
 Plot[A Sin[\[Omega] x + \[Phi]] + B, {x, -10, 10}, 
  PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B], PlotRange -> {-6, 6}, 
  Axes -> True, AxesStyle -> Arrowheads[{0.0, 0.04}], 
  AxesLabel -> {x, y}, ImageSize -> 700, 
  Ticks -> {Table[i, {i, -4 \[Pi], 4 \[Pi], \[Pi]/4}], 
    Table[t, {t, -5, 5, 0.5}]}], {{A, 1}, -5, 5, 
  Appearance -> "Labeled"}, {{\[Omega], 1}, -3, 8, 
  Appearance -> "Labeled"}, {{\[Phi], 0}, -\[Pi], 2 \[Pi], 
  Appearance -> "Labeled"}, {{B, 0}, -1, 5, Appearance -> "Labeled"}]

enter image description here

How to modify the following label code so that when the value of [Phi] is negative, only a - sign is used to connect it in the middle, instead of continuously appearing in the label+-

PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B]
Manipulate[
 Plot[A Sin[\[Omega] x + \[Phi]] + B, {x, -10, 10}, 
  PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B], PlotRange -> {-6, 6}, 
  Axes -> True, AxesStyle -> Arrowheads[{0.0, 0.04}], 
  AxesLabel -> {x, y}, ImageSize -> 700, 
  Ticks -> {Table[i, {i, -4 \[Pi], 4 \[Pi], \[Pi]/4}], 
    Table[t, {t, -5, 5, 0.5}]}], {{A, 1}, -5, 5, 
  Appearance -> "Labeled"}, {{\[Omega], 1}, -3, 8, 
  Appearance -> "Labeled"}, {{\[Phi], 0}, -\[Pi], 2 \[Pi], 
  Appearance -> "Labeled"}, {{B, 0}, -1, 5, Appearance -> "Labeled"}]

enter image description here

How to modify the following label code so that when the value of [Phi] is negative, only a - sign is used to connect it in the middle, instead of continuously appearing in the label+-

PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B]

enter image description here

Source Link
csn899
  • 1
  • 6
  • 17

How to modify the label code that appears on the image so that+- does not appear together?

Manipulate[
 Plot[A Sin[\[Omega] x + \[Phi]] + B, {x, -10, 10}, 
  PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B], PlotRange -> {-6, 6}, 
  Axes -> True, AxesStyle -> Arrowheads[{0.0, 0.04}], 
  AxesLabel -> {x, y}, ImageSize -> 700, 
  Ticks -> {Table[i, {i, -4 \[Pi], 4 \[Pi], \[Pi]/4}], 
    Table[t, {t, -5, 5, 0.5}]}], {{A, 1}, -5, 5, 
  Appearance -> "Labeled"}, {{\[Omega], 1}, -3, 8, 
  Appearance -> "Labeled"}, {{\[Phi], 0}, -\[Pi], 2 \[Pi], 
  Appearance -> "Labeled"}, {{B, 0}, -1, 5, Appearance -> "Labeled"}]

enter image description here

How to modify the following label code so that when the value of [Phi] is negative, only a - sign is used to connect it in the middle, instead of continuously appearing in the label+-

PlotLabel -> 
   "f(x)=" <> ToString[A] <> "sin(" <> ToString[\[Omega]] <> "x+" <> 
    ToString[\[Phi]] <> ")+" <> ToString[B]