3
$\begingroup$

Is it possible to rename ticks with a name like this: "$0.125 \, V_{FS}$"?

In the below code I wrote "$0.125 \, V$", I don't know how can I insert the subscript.

ListPlot[{{0, 0}, {0.125, 0.125}, {0.25, 0.25}, {0.375, 0.375}, {0.5, 
   0.5}, {0.625, 0.625}, {0.75, 0.75}, {0.875, 0.875}}, 
 InterpolationOrder -> 0, Joined -> True, 
 PlotRange -> {{0, 1}, {0, 1}}, FrameTicks -> {
   {{{0, "000"}, {0.125, "001"}, {0.25, "010"}, {0.375, "011"}, {0.5, 
      "100"}, {0.625, "101"}, {0.75, "110"}, {0.875, "111"}}, 
    Automatic},
   {{{0.125, "0.125 V"}, {0.25, "0.25 V"}, {0.375, "0.375 V"}, {0.5, 
      "0.5 V"}, {0.625, "0.625 V"}, {0.75, "0.75 V"}, {0.875, 
      "0.875 V"}}, Automatic}
   }, Frame -> True]

Thank you for your willingness.

$\endgroup$
4
$\begingroup$
ListPlot[{{0, 0}, {0.125, 0.125}, {0.25, 0.25}, {0.375, 0.375}, {0.5,  0.5},
  {0.625, 0.625}, {0.75, 0.75}, {0.875, 0.875}}, 
 InterpolationOrder -> 0, Joined -> True, 
 PlotRange -> {{0, 1}, {0, 1}}, 
 FrameTicks -> {{{{0, "000"}, {0.125, "001"}, {0.25, "010"}, {0.375, "011"},
  {0.5, "100"}, {0.625, "101"}, {0.75, "110"}, {0.875,  "111"}}, Automatic},
  {{#, Row[{ToString@#, Subscript[V, FS]}]} & /@ Range[.125, .875, .125], Automatic}},
 Frame -> True]

enter image description here

$\endgroup$
  • $\begingroup$ today you are my personal professor! $\endgroup$ – Gennaro Arguzzi Sep 17 '18 at 10:10
  • $\begingroup$ @Gennaro, glad i could help. $\endgroup$ – kglr Sep 17 '18 at 10:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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