0
$\begingroup$

$CAR$

Graphics[{Scale[{RGBColor[0.25, 0.63, 0.85], 
         Polygon[{{-4, 0}, {-3.85, 0.7}, {-3.2, 0.7}, {-3, 1.15}, 
             {-1.3, 1.15}, {-0.8, 0.7}, {0, 0.45}, {0, 0}, {-4, 0}}], 
         RGBColor[0.87, 0.94, 1], Polygon[{{-3.1, 0.7}, {-2.95, 1.1}, 
             {-2.1, 1.1}, {-2.1, 0.7}}], 
    Polygon[{{-1.9, 0.7}, {-1.9, 1.1}, 
             {-1.35, 1.1}, {-0.9, 0.7}}], GrayLevel[0], 
         Disk[{-1.5, 0.91}, 0.15], GrayLevel[0], Disk[{-3, 0}, 0.4], 
         Disk[{-1, 0}, 0.35], GrayLevel[0.4], Disk[{-3, 0}, 0.15], 
         Disk[{-1, 0}, 0.15]}, {Sqrt[1 - 150000^2/300000^2], 1}]}, 
   PlotRange -> {{-4, 0}, {-0.4, 1.2}}, ImageSize -> {90, 70}]

$PROJECT$

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, Red, Orange, Red, 
    Orange, Red, Orange, Red, Orange, Red}, 
     PlotLabel -> 
   Row[{"\!\(\*\nStyleBox[\"Was\",\nFontColor->RGBColor[1, 0, 0]]\
\)\!\(\*\nStyleBox[\" \",\nFontColor->RGBColor[1, 0, \
     0]]\)\!\(\*\nStyleBox[\"I\",\nFontColor->RGBColor[1, 0, 0]]\
\)\!\(\*\nStyleBox[\" \",\nFontColor->RGBColor[1, 0, \
     0]]\)\!\(\*\nStyleBox[\"Speedy\",\nFontColor->RGBColor[1, 0, 0]]\
\)\!\(\*\nStyleBox[\"?\",\nFontColor->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}], 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], 
     Point[{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, 45, "Speedometer reading in mph"}, 30, 80, 1, 
  Appearance -> "Labeled"}]
$\endgroup$
3
  • $\begingroup$ your code is malformed. Try pasting again. Convert the cell to InputForm first, then copy/paste the result. Make sure to make a copy of the cell first. $\endgroup$
    – Nasser
    Mar 18, 2015 at 6:09
  • $\begingroup$ Thank you, I did it, I hope that now it works ;) $\endgroup$
    – marle
    Mar 18, 2015 at 6:34
  • $\begingroup$ I would like to increase the PlotLabel font size. Can you help me? $\endgroup$
    – marle
    Mar 18, 2015 at 15:07

1 Answer 1

0
$\begingroup$
car = Graphics[{Scale[{RGBColor[0.25, 0.63, 0.85], 
         Polygon[...

Epilog -> {{Dashed, Line[{{x, 42}, {x, y}}], 
   Line[{{20, y}, {x, y}}]}, {AbsolutePointSize[32], 
   Inset[car, {x, y}]}}
$\endgroup$
2
  • $\begingroup$ It works perfect. Thank you very much. $\endgroup$
    – marle
    Mar 18, 2015 at 15:03
  • $\begingroup$ I would like to increase the PlotLabel font. Do you know or somebody knows how to do it? $\endgroup$
    – marle
    Mar 18, 2015 at 15:06

Your Answer

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

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