2
$\begingroup$

I would like to customize the RegionPlot with the following:

  1. Add text ticks to the RegionPlot
  2. Change 1 to show as a or another text
  3. Add a vertical Red line at such a tick location

Code:

RegionPlot[{x^2 + y^2 < 2}, {x, 0, 1.5}, {y, -1.5, 1.5}, 
 FrameTicks -> {{None, None}, {{1}, None}}]

Expected Outcome:

enter image description here

$\endgroup$
1
  • $\begingroup$ RegionPlot[{x^2 + y^2 < 2} , {x, 0, 1.5}, {y, -1.5, 1.5} , FrameTicks -> {{None, None}, {{{1, Style["a", 16, Red]}}, None}} , Frame -> True , Epilog -> { Red, AbsoluteThickness[2] , InfiniteLine[{{1, 0}, {1, 1}}] } ] $\endgroup$
    – Syed
    Nov 18, 2022 at 7:56

2 Answers 2

2
$\begingroup$
  • The parametric of the Ticks is {{x, label, {plen, mlen}, style}}.

  • we extend the tick to full size by using {plen, mlen}={1., 0.}, that is, the positive directions is 1. and the negative directions is 0.

RegionPlot[{x^2 + y^2 < 2}, {x, 0, 1.5}, {y, -1.5, 1.5}, 
 FrameTicks -> {{None, 
    None}, {{{1, Style["a", Blue, 14], {1., 0.}, 
      Directive[Red, Thick]}}, None}}]

enter image description here

$\endgroup$
0
$\begingroup$

Something like:

RegionPlot[{x^2 + y^2 < 2}, {x, 0, 1.5}, {y, -1.5, 1.5}, 
 FrameTicks -> {{{{-1, "mone"}, {-0.5, "mhalf"}, {0, "zero"}, {0.5, 
      "half"}, {1, "one"}}, 
    None}, {{{0, "zero"}, {0.5, "half"}, {1, "one", {1, 0}, 
      Directive[Red, Thick]}, {1.5, "onehalf"}}, None}}]

enter image description here

$\endgroup$

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.