3
$\begingroup$

I need repetitive plots like this below. I invented that I refuse to use pen and I will plot the points in Mathematica, then change opacity, then change contrast and voula get the points to the graph -- or better idea perhaps just transparency -- well this is many of the ways how you can do it in Photoshop.

How can I have a background image so I can just insert the mathematica plot on the plot?

Input here

Goal better than hand-drawn versions such as here and here

P.s. Extra upvotes for fun answers!

enter image description here

Data

points2 = {{0.30, 2.25}, {0.39, 2.45}, {0.35, 2.45}, {0.19, 
    2.28}, {0.15, 2.22}, {0.03, 2.1}, {0.13, 2.13}, {0.19, 
    2.17}, {0.18, 2.25}, {0.01, 2.68}, {0.24, 2.22}, {0.22, 
    2.18}, {0.26, 2.17}, {0.24, 2.30}, {0.27, 2.50}, {0.29, 
    2.12}, {0.28, 2.13}, {0.29, 2.14}, {0.27, 2.21}, {0.28, 2.17}};

where 0.30 corresponds to the 30 on the x-axis and so on.
$\endgroup$
2
  • 1
    $\begingroup$ Overlay is probably what you want. $\endgroup$
    – Verbeia
    Commented Nov 14, 2014 at 6:35
  • $\begingroup$ @Verbeia how are Inset and Overlay different? $\endgroup$
    – hhh
    Commented Nov 15, 2014 at 5:27

1 Answer 1

3
$\begingroup$

You can use Inset:

img = Import["https://i.sstatic.net/o3mES.png"];

Graphics[{
  Inset[img, {0.2, 2.2}, Automatic, {0.55, 0.7}],
  Red, AbsolutePointSize[7], Point[points2]
 },
  PlotRangePadding -> 0.1
]

enter image description here

I'll leave you to work out the alignment yourself but it can all be controlled with the parameters of Inset.

Or for interactive placement you can Rasterize the image, plot your points, copy the points graphic, then double-click the Raster graphic and paste the points into it:

enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you +1! I love to combine Mathematica to real life :D $\endgroup$
    – hhh
    Commented Nov 15, 2014 at 5:25

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.