4
$\begingroup$

Consider:

Manipulate[
 Plot[4 x^3 - x^5, {x, -2, 2},
  PlotRange -> {{-3, 3}, Automatic},
  AxesLabel -> {"x", "y"},
  Ticks -> {{{a, "x"}, {-a, "-x"}}, {{4 a^3 - a^5, 
      "f(x)"}, {-4 a^3 + a^5, "f(-x)"}}},
  PlotLabel -> 
   "Graph of f(x) = 4\!\(\*SuperscriptBox[\(x\), \(3\)]\)- \
\!\(\*SuperscriptBox[\(x\), \(5\)]\)",
  Epilog -> {
    Red, PointSize[Large],
    Point[{{a, 4 a^3 - a^5}, {0, 0}, {-a, -4 a^3 + a^5}}],
    Red, Dashed,
    Line[{{a, 4 a^3 - a^5}, {-a, -4 a^3 + a^5}}],
    Blue,
    Line[{{a, 0}, {a, 4 a^3 - a^5}, {0, 4 a^3 - a^5}}],
    Line[{{-a, 0}, {-a, -4 a^3 + a^5}, {0, -4 a^3 + a^5}}]
    }], {{a, 1}, -2, 2}]

Which produces this image.

enter image description here

Is it possible to place the tick marks -x and f(-x) on the other side of their axes?

Update: Some final adjustments due to tsuresuregusa. I really appreciate the help of my colleagues on Mathematica Stack Exchange.

Manipulate[
 Plot[4 x^3 - x^5, {x, -2, 2}, PlotRange -> {{-3, 3}, Automatic}, 
  AxesLabel -> {"x", "y"}, Ticks -> False, 
  PlotLabel -> 
   "Graph of f(x) = 4\!\(\*SuperscriptBox[\(x\), \(3\)]\)- \
\!\(\*SuperscriptBox[\(x\), \(5\)]\)",
  Epilog -> {
    Text["f(x)", {-.2 Sign[a], 4 a^3 - a^5}], 
    Text["x", {a, -.3 Sign[a]}], 
    Text["f(-x)", {.3 Sign[a], -4 a^3 + a^5}], 
    Text["-x", {-a, .4 Sign[a]}], Red, PointSize[Large], 
    Point[{{a, 4 a^3 - a^5}, {0, 0}, {-a, -4 a^3 + a^5}}], Red, 
    Dashed, Line[{{a, 4 a^3 - a^5}, {-a, -4 a^3 + a^5}}], Blue, 
    Line[{{a, 0}, {a, 4 a^3 - a^5}, {0, 4 a^3 - a^5}}], 
    Line[{{-a, 0}, {-a, -4 a^3 + a^5}, {0, -4 a^3 + a^5}}]}], {{a, 1},
   0.6, 2}]
$\endgroup$
2
  • 1
    $\begingroup$ what about epilog them by hand? Text["f(-x)", {-.2 Sign[a], 4 a^3 - a^5}] and so on $\endgroup$ Jan 31, 2016 at 2:12
  • $\begingroup$ Related, perhaps even duplicate: (6395), (64898) $\endgroup$
    – Mr.Wizard
    Jan 31, 2016 at 3:33

1 Answer 1

7
$\begingroup$

I meant this in my comment

Manipulate[
 Plot[4 x^3 - x^5, {x, -2, 2}, PlotRange -> {{-3, 3}, Automatic}, 
  AxesLabel -> {"x", "y"}, Ticks -> False, 
  PlotLabel -> 
   "Graph of f(x) = 4\!\(\*SuperscriptBox[\(x\), \(3\)]\)- \
\!\(\*SuperscriptBox[\(x\), \(5\)]\)", 
  Epilog -> {Text["f(-x)", {-.2 Sign[a], 4 a^3 - a^5}], 
    Text["-x", {a, -.3 Sign[a]}], 
    Text["f(x)", {.2 Sign[a], -4 a^3 + a^5}], 
    Text["x", {-a, .3 Sign[a]}], Red, PointSize[Large], 
    Point[{{a, 4 a^3 - a^5}, {0, 0}, {-a, -4 a^3 + a^5}}], Red, 
    Dashed, Line[{{a, 4 a^3 - a^5}, {-a, -4 a^3 + a^5}}], Blue, 
    Line[{{a, 0}, {a, 4 a^3 - a^5}, {0, 4 a^3 - a^5}}], 
    Line[{{-a, 0}, {-a, -4 a^3 + a^5}, {0, -4 a^3 + a^5}}]}], {{a, 
   1}, -2, 2}]

enter image description here

$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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