I have used PixelValuePositions to get coordinates from a figure. But I would like to move the figure, so the origin is in the middle of the figure.

An example could be a circle, where the origin of the circle would be moved to the origin of the coordinate-system.

Which commands should I look at?

  • 1
    $\begingroup$ I think we need more details. What is the format of the figure? Do you just want to display the figure with axes where the origin is in the new position? Or do you want a set of data like a list of ordered triples with the x and y coordinates shifted so that (0, 0) is the coordinate of the particular pixel? It's also pretty unclear why you tagged this with the education tag. $\endgroup$ – march Dec 2 '15 at 23:53

Minimal working example for the case stated in OP:

ColorConvert[Rasterize[Graphics[Circle[]]], "Grayscale"]
PixelValuePositions[%, 0, 0.5]
ListPlot[Transpose@(Transpose@% - Mean@%)]

enter image description here


Not the answer you're looking for? Browse other questions tagged or ask your own question.