automeris-io / WebPlotDigitizer

Computer vision assisted tool to extract numerical data from plot images.
https://automeris.io
GNU Affero General Public License v3.0
2.58k stars 354 forks source link

The data points extracted are in the wrong order. #308

Open wxzforever opened 8 months ago

wxzforever commented 8 months ago

The data points extracted are in the wrong order. For example, I have a curve like a circle. When I extracted the points and re-drawed the graph, the order of the points was not in clockwise or counterclockwise order. Suppose the circle is divided into upper and lower parts, then the extracted points are one above, one below, one above and one below.

So simply put, if the curve is a circle, the data points are not arranged in clockwise or counterclockwise order.

Fig 1 Fig 2 Fig 3

nbehrnd commented 8 months ago

For the cyclic voltammetry I suggest to split the digitization. Define one set of data which only is about the oxidation sweep, and a second second only about the reduction (picking the color .and. the pen of sufficient width usually does it well enough). Prior to export of the data -- and for each trace -- view each data set; instead of «raw», pick the «sort by x, ascending» where x relates to the first column in the .csv / abscissa in the diagram. While on this widget, select a fixed precision (e.g. 3 decimals). Then close and eventually export the data.

nbehrnd commented 8 months ago

I was able to record a silent .mp4 about how I suggest to proceed. This, the raw data, and an extracted sweep of oxidation/reduction as individual .csv files are enclosed in the .zip attached below (consider about 2 MB in total file size to fetch the attachement).

digitize_cv.zip

If one provides the data e.g. to gnuplot, the CV duck looks very similar to the one in the publication. Except for the termini, however one easily can move the digitized points in the digitizer prior to their export:

test

(Little particularity for gnuplot: by default it assumes the columns to be separated by white space. But it is not problematic as one can reload the archived project, and change the column separator to an explicit blank space. As use of gnuplot appears to be less widespread than as it once used to be, I intentionally wrote the corresponding scripts a bit in a way you can see both the long/verbose form of some of the commands, as well their short version. For more information about the program, visit the gnuplot.info web page.)

test_plots.zip

Note that the digitized data are distorted; instead of -20 I erroneously defined -30 as the lower reference value of the ordinate (about 38s into the video). While this affects the data, it does not invalidate the method per sé.

nbehrnd commented 7 months ago

@wxzforever About a month after the question was addressed and one approach to tackle the problem was provided I would suggest if the problem still exist, please clarify. Else if the problem was resolved, close the ticket.