3
$\begingroup$

Some plotting functions produce a Graphics with a "ScalingFunctions" suboption within the Method option. What does "ScalingFunction" do and how do I use it? Can I use it to transform arbitrary graphics in a non-linear way?

Example:

g = RegionPlot[x^2 + y^2 < 1, {x, -2, 2}, {y, -2, 2}]; Options[g, Method] (* {Method -> {"ScalingFunctions" -> None, "TransparentPolygonMesh" -> True, "AxesInFront" -> True}} *) 

Note:

This doesn't appear to be the same thing as ScalingFunctions.

$\endgroup$
8
  • $\begingroup$ I think it scales ticks, not coordinates. It looks like the first element is affecting the range of generated ticks and the second scales their positions additionaly. Try "ScalingFunctions" -> {# + 1 &, # + 1 &} and Dynamic@MousePosition["Graphics"]. It affects only y axis though. $\endgroup$ Commented Sep 14, 2016 at 14:02
  • $\begingroup$ @Kuba Can you give an example? I tried things like these and there wasn't any change in either ticks or MousePosition. Graphics[{Line[{{0, 0}, {1, 1}}], Line[{{1, 1}, {2, 2}}]}, Frame -> True, Method -> {"ScalingFunctions" -> {# + 1 &, # + 1 &}}] $\endgroup$ Commented Sep 14, 2016 at 14:05
  • $\begingroup$ RegionPlot[x^2 + y^2 < 1, {x, -2, 2}, {y, -2, 2}, Method -> {"ScalingFunctions" -> {# + 1 &, # + 1 &}}] $\endgroup$ Commented Sep 14, 2016 at 14:06
  • $\begingroup$ @Kuba But then you are passing the option to RegionPlot and not to Graphics. Some of these plotting functions reinterpret options, e.g. DensityPlot[..., PlotRange->...] and Show[DensityPlot[...], PlotRange -> ...] behave differently. Could it be that this in fact is a RegionPlot-specific option and doesn't even make sense for Graphics? Maybe it's retained in Graphics by mistake. $\endgroup$ Commented Sep 14, 2016 at 14:08
  • $\begingroup$ I don't know. But Graphics ignores syntax that RegionPlot complains about (third function, different slot #2). $\endgroup$ Commented Sep 14, 2016 at 14:13

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.