Manipulate[
ContourPlot[r*(y/x), {x, 20, 42}, {y, 20, 42},
ContourStyle ->
Directive[RGBColor[1., 0.77, 0.], Opacity[1.],
AbsoluteThickness[1.999], Dashed],
ContourLabels -> False,
Contours -> {27, 28, 28.5, 29.5, 47, 49, 50, 52, 94, 96, 97, 99},
ContourShading -> {Red, Orange, Red, Orange, LightGray, Orange,
Red, Orange, LightGray, Orange, Red, Orange, Red},
PlotLabel ->
Row[(Style[#1,
17] & ) /@ {"\!\(\*\nStyleBox[\"Was\",\n\
FontSlant->\"Italic\",\nFontColor->RGBColor[1, 0, 0]]\)\!\(\*\n\
StyleBox[\" \
\",\nFontSlant->\"Italic\",\nFontColor->RGBColor[1, 0, 0]]\
\)\!\(\*\nStyleBox[\"I\",\nFontSlant->\"Italic\",\n\
FontColor->RGBColor[1, 0, 0]]\)\!\(\*\nStyleBox[\" \
\",\nFontSlant->\"Italic\",\nFontColor->RGBColor[1, 0, 0]]\
\)\!\(\*\nStyleBox[\"Speedy\",\nFontSlant->\"Italic\",\n\
FontColor->RGBColor[1, 0, \
0]]\)\!\(\*\nStyleBox[\"?\",\nFontSlant->\"Italic\",\n\
FontColor->RGBColor[1, 0, 0]]\) if your speedometer reads ",
NumberForm[r, {4, 0}],
" mph -> you're actually traveling to ",
NumberForm[r*(y/x), {4, 0}], " mph"}],
LabelStyle -> Directive[Black, 20], Axes -> True, Ticks -> True,
ImageSize -> 674, AxesOrigin -> {20, 20}, AspectRatio -> 0.65,
Epilog -> {{Dashed, Line[{{x, 42}, {x, y}}],
Line[{{20, y}, {x, y}}]},
{AbsolutePointSize[32], Inset[car, {x, y}]}}],
{{x, 30,
"old tire diameter inches"}, 20, 42, 0.1, Appearance -> "Labeled"},
{{y, 30, "new tire diameter inches"}, 20, 42, 0.1,
Appearance -> "Labeled"}, {{r, 38, "Speedometer reading in mph"},
30, 80, 1, Appearance -> "Labeled"}]
$\begingroup$
$\endgroup$
1
-
$\begingroup$ Please provide the simplest code the demonstrates your issue. Also, you don't have a "dashed line going down to the axis". What do you really want to do? $\endgroup$– JagraCommented Mar 19, 2015 at 17:15
Add a comment
|
1 Answer
$\begingroup$
$\endgroup$
1
Update: To get a dashed line from the point {x,y}
down to the x
axis, use
Epilog -> {{Dashed, Line[{{x, 0}, {x, y}}], Line[{{20, y}, {x, y}}]},
{AbsolutePointSize[32], Inset[car, {x, y}]}}]
You can change your epilog to:
Epilog -> {{Dashed, Line[{{x, 42}, {x, 20}}], Line[{{20, y}, {x, y}}]},
{AbsolutePointSize[32], Inset[car, {x, y}]}}]
to get a dashed line from the top to bottom frame.
Or use the options GridLines
and Method
in ContourPlot
: i.e., add
GridLines -> {{{x, Directive[Black, Dashed]}}, None},
Method -> "GridLinesInFront" -> True}
after Epilog->...
in your code. You can remove Line[{{x, 42}, {x, y}}]
from the Epilog
setting if you don't want two overlapping dashed lines.
-
$\begingroup$ Thank you very much. It works!!!!!!! $\endgroup$– marleCommented Mar 19, 2015 at 21:58