I have (x,y) data here: http://pastebin.com/raw/NUNC5Jb2
Now I would like to overplot a ListLinePlot
of this data on top of an image
:
I did the following:
data = Import["http://pastebin.com/raw/NUNC5Jb2"];
{minx, maxx} = MinMax[data[[All, 1]]];
{miny, maxy} = MinMax[data[[All, 2]]];
ListLinePlot[data, PlotRange -> {{minx, maxx}, {miny, maxy}},
AspectRatio -> ImageAspectRatio@image,
PlotStyle -> {RGBColor[1, 0, 0]}, Frame -> True,
Prolog -> {Texture[image],
Polygon[{Scaled[{0, 0}], Scaled[{1, 0}], Scaled[{1, 1}],
Scaled[{0, 1}]},
VertexTextureCoordinates -> {{0, 0}, {1, 0}, {1, 1}, {0, 1}}]},
Ticks -> None]
The result is:
Does also another solution exists?
Prolog->{Inset[image, Sequence @@ (ImageScaled /@ {{0, 0}, {0, 0}, {1, 1}})]}
which is slightly less verbose. Is there anything in particular you're looking for? $\endgroup$ – N.J.Evans Feb 9 '17 at 16:12Prolog -> Inset[image, Automatic, Automatic, Scaled[1]]
$\endgroup$ – Jason B. Feb 10 '17 at 17:50Prolog -> {Inset[image, Scaled[{.5, .5}], Automatic, Scaled[1]]}]
then the gaps vanish. $\endgroup$ – mrz Feb 11 '17 at 20:29ImagePadding -> None
and it seemed to be the same as your plot $\endgroup$ – Jason B. Feb 11 '17 at 20:56