3
$\begingroup$

I'm having a problem where when I display lines over an image (using Show) it works fine, but if I adjust the image colors first (using either ImageAdjust[] or Lighter[]) the lines vanish. Am I misunderstanding how image adjustment works? Here's a simplified example:

g = Graphics @@ GeoGraphics[GeoRange -> "World", GeoProjection -> {"Orthographic", "Centering" -> GeoPosition[{-22, 110}]}, GeoGridLines -> Automatic, AspectRatio -> 1, GeoBackground -> "Satellite"];
h = Lighter[g, 1];
l1 = Plot[.18 x - .4, {x, -Pi/2, Pi/2}, Axes -> False];
Show[g, l1]
Show[h, l1]

Why does the second show not have the overplotted line?

Thanks much for any help you can provide...

example of overplots

$\endgroup$
0

1 Answer 1

4
$\begingroup$

The reason l1 is not visible in Show[h, l1] is that h has a vastly different plot range than l1:

PlotRange /@ {g, l1, Show[h]}

{{{-0.999874, 0.999371}, {-0.999977, 0.999573}}, {{-1.5708,    1.5708}, {-0.682743, -0.117257}}, {{0., 360.}, {0., 360.}}}

 Row[Show[#, Frame -> True, ImageSize -> 300]& /@ {h, g}]

enter image description here

To see h and l1 together, you can rescale h to the plot range of g using RescalingTransform:

Show[MapAt[GeometricTransformation[#, 
    RescalingTransform[PlotRange[Show[h]], PlotRange[g]]] &, 
  Show@h , {1}], l1, PlotRange -> All] 

enter image description here

$\endgroup$

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.