![]() You need to type in the x- and y-scale, and then it scales the data from pixes to the units given.įrom pynput import mouse class MyException ( Exception ): pass X = Y = NumberOfMouseClicks = 0 print ( 'Click Origin' ) def on_click ( x, y, button, pressed ): button = str ( button ) global NumberOfMouseClicks NumberOfMouseClicks = NumberOfMouseClicks + 1 if NumberOfMouseClicks = 1 : print ( 'Click Top Right' ) if NumberOfMouseClicks = 3 : print ( 'Click data points. First you select the origin and top right corner to scale the axes, and then click through some points to capture the curve. Next I decided to write a short Python Script to extract and convert the coordinates by clicking on them. This gets the job done, but is certainly not ideal (or quick). Therefore you will need to invert the y-axis and scale to fit the origin of the graph. ![]() Note that the origin of the screen coordinates is the top left and the units are in pixels. You can drag the cursor across the line, write down the screen coordinates at various intervals, and recreate the chart. For this example I will use the chart "Exports and Imports to and from Denmark & Norway from 1700 to 1780" by William Playfair 1. ![]() Extract with Mac Screen CoordinatesĪ quick way to extract the data is to use the Mac screen capture tool to display the screen coordinates of the cursor. The data was provided by a third party in that format so I had to work with what I was given. I recently needed to extract data from the screenshot of a graph.
0 Comments
Leave a Reply. |