RegionFunction doesn't work in ListContourPlot if also using ScalingFunctions

I am making a contour plot out of a list of values of the form {{x1,y1,f1},{x2,y2,f2},…} I want to plot this on a log log scale so I specify ScalingFunctions -> {"Log", "Log"} but I also want to only plot the data over a particular region of the range. Such as above the line specified by: RegionFunction -> (#2 > -# + 1 &) but these won't work together.

So here is a basic example that highlights the problem:

list = Flatten[Table[{i, j, i^2 - j^2}, {i, 0, 1, 0.01}, {j, 0, 1, 0.01}], 1];
ListContourPlot[list, ScalingFunctions -> {"Log", "Log"}]
ListContourPlot[list, RegionFunction -> (#2 > -# + 1 &)]
ListContourPlot[list, ScalingFunctions -> {"Log", "Log"},
RegionFunction -> (#2 > -# + 1 &)]


The first two work but when I try to combine RegionFunction and ScalingFunctions it doesn't work.

Thoughts on a workaround? Thanks!

• Please, give at least some example for list to test with. – Henrik Schumacher Nov 1 '18 at 17:28
• I just did. Good point. – E. Nerney Nov 1 '18 at 17:55
• does RegionFunction -> (Exp[#2]+Exp[#]>1 &) give the desired region or do you want the triangle as in the second plot? – kglr Nov 1 '18 at 18:05
• I want the last line of code to work. So just the upper triangular region and scaled log log axes. – E. Nerney Nov 1 '18 at 18:09
• It really doesn't matter what region I am referring to though. The point is RegionFunction and ScalingFunctions don't work together. – E. Nerney Nov 1 '18 at 18:15

Per kglr's comment, the following produces

g = ListContourPlot[list,
ScalingFunctions -> {"Log", "Log"},
RegionFunction -> (Exp[#2] + Exp[#1] > 1 &)
]


so ScalingFunctions and RegionFunction do work together. Indeed, this contour plot should correspond to the logarithmized version of this

ListContourPlot[list,
RegionFunction -> (#2 + #1 > 1 &)
]


In fact, the logarithmically scaled axes lie to you as can be seen by plotting the contour plot g from above together with the unit disk:

Show[
Graphics[Disk[]],
g
]


ListContourPlot[list, ScalingFunctions -> {"Log", "Log"},

because there are no points in list that, after logarithmical rescaling fullfil the condition of RegionFunction.
• Well the sum of to exponentials is always positive, right? With, e.g., RegionFunction -> (Exp[#2] + Exp[-45*(#1/4)^(-0.4229)] > 20 &), you will see a difference. – Henrik Schumacher Nov 7 '18 at 22:50
• I deleted my comment above about doing this for above a power law region because I figured it out. For the region above y=45(x/4)^(-0.4229) with ScalingFunctions -> {"Log", "Log"} I actually wanted RegionFunction -> (Exp[#2] - 45*(Exp[#]/4)^(-0.4299)] > 0 &) Very strange.....but I figured it out. Like why do you leave everything the same except the rescaled variables? Also why isn't it 10^(#2) instead of Exp[#2] when the axes are base 10 scaled it seems? Either way I made it work. Thanks for your response though! – E. Nerney Nov 7 '18 at 22:59
• Good point. But standard Log-Scaling is with respect to Log. Only the tick marks are to base 10. You can also use ScalingFunctions -> {"Log10", "Log10"}. If you prefer a Log10-Log10 plot. – Henrik Schumacher Nov 7 '18 at 23:16