2
$\begingroup$

Following this, I want a region plot in log-log scale as

f[x_, y_] = x^2 - y;

RegionPlot[f[10^lx, 10^ly] <= 400, {lx, 0, 5}, {ly, 0, 5}]

However, along the y-axis I want FrameTicks to be $10^5$, $10^3$ and so on, rather than $5,3,..$. How should this be done? Thank you in advance.

$\endgroup$

1 Answer 1

6
$\begingroup$

Try this: First, let us define the ticks of the y-axis:

f[x_] := {x, (HoldForm[10]^Evaluate[x])}
lst = Map[f, Range[5]]

enter image description here

Now, let us plot:

RegionPlot[f[10^lx, 10^ly] <= 400, {lx, 0, 5}, {ly, 0, 5}, 
 FrameTicks -> {{lst, None}, {Automatic, None}}]

with the following effect:

enter image description here

Have fun!

$\endgroup$
3
  • $\begingroup$ How will I modify it if the plot ranges on the x and y-axes are different, say 0 to 5 on the y-axis and 7 to 23 on the x-axis? $\endgroup$
    – PoreyS
    Dec 26, 2022 at 11:54
  • $\begingroup$ I have solved it. For example - f1[x_] := {x, (HoldForm[10]^Evaluate[x])} ; lsty = Map[f1, Range[5]]; lstx = Map[f1, Range[1, 3]] ; f[x_, y_] = x - y; RegionPlot[ f[10^lx, 10^ly] <= 40, {lx, 1, 3}, {ly, 0, 5}, FrameTicks -> {{lsty, None}, {lstx, None}}] $\endgroup$
    – PoreyS
    Dec 26, 2022 at 13:50
  • $\begingroup$ Recommend f[x_] := {x, (HoldForm[10]^x)}; lst = Map[f, Range[0, 5]] $\endgroup$
    – Bob Hanlon
    Dec 26, 2022 at 15:10

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.