Saturday, January 18, 2014

Converting plots to data

It is a problem which occurs ever so often in applied work, you have a plot, but you want the data. There are at least two programs which can help you there; PlotDigitizer and Engauge Digitizer. I got both on my openSuse machine. Both are available for Windows, for Mac there are only older versions of Engauge.

I tried these programs on a relatively simple problem. I saw a plot in a book and wanted to calculate that line myself. So I took my camera, photographed the plot and got to work.



Engauge Digitizer

Engauge has been there for quite a while. It is many features, but looks a bit outdated. It was not able to import my original figure (2992*2992 pixels, 694 KB) but had no problems after resizing to 500*500 pixels, 55.9 KB.
It is clearly the program which can handle more exotic plots. For me it is not intuitive. For instance, it took me quite some time to figure out how to export the results. Initially I copied-pasted the results to a spreadsheet, later I managed to create a .csv after all. Engauge comes with a manual so everything can be resolved. Engauge has the ability to do point detection, to use that it is probably best to crop the figure as much as possible, Engauge has no qualms finding points in text, black blobs, axis labels and such. Probably in a colored plot automatic detection would work better, you have some settings to guide it.

PlotDigitizer

PlotDigitizer looks much more modern. It had no problems with the large photo, except that it could not scale that photo enough to fit on the screen. The modern interface allows manual adding/removing/moving of points. There is also a possibility to trace a line on screen and it will add points it detects there. PlotDigitizer exports to .xml. It is also possible to cipy-paste the results. While I see the advantage of a file including documentation, it would also be nice to get the data out of the file.

The file I got needed some extra processing before I had the data.frame.
library(XML)
mytree <- xmlTreeParse('test12.xml') 
mylist <- xmlToList(mytree)
mylist2 <- mylist[4:length(mylist)]
mydf <- do.call(rbind,mylist2)
convert <- data.frame(x=as.numeric(mydf[,'dx']),
           y=as.numeric(mydf[,'dy']))

Conclusion

The programs complement each other. Engauge is great for automated extraction, complex plots. However, it is not so easy for occasional usage. PlotDigitizer is easy to use, great if you want to manually select your points.

21 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Correct the spelling of "Converting" in the title.

    ReplyDelete
  3. I have had good luck with WebPlotDigitizer: http://arohatgi.info/WebPlotDigitizer/

    ReplyDelete
  4. There are other quite good data extractors out there. My favorite is DataThief, http://datathief.org/ . Don't waste your time slogging thru R-code to do what a dedicated tool does much better and faster.

    ReplyDelete
  5. I've been looking into these programs. You're right, it's a common problem. Engauge is open-source (c++), which may help anyone who needs to adapt the algorithms for specific scenarios. The interesting thing is that it seems simple at first (scatterplots of a few solid circles are indeed easier), but the more you think about how to code it to deal with a range of images, the harder it gets!

    ReplyDelete
  6. Neat tools for a common problem. Just wanted to add that one should always think about the errors introduced by digitizing, and how reliable are the numbers one gets through this tools, not to mention the original (often unseen or unreported) errors in the data themselves.
    Thanks for the post.

    ReplyDelete
  7. Digitizing is the need of the time. Without it, life will come to a halt.

    ReplyDelete
  8. Gracefully written information on this blog are going to support me for my coming assignments. Every point was very clear and taught me few new parameters. I would like to use this information in coming future
    Embroidery Digitizing

    ReplyDelete
  9. Nice post, it is useful for me. It is very informative. Such a great post as you share it. by digitizing company in usa

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. You have written a outstanding blog where you added a photograph of a plot. It will help me to solve some of my problems i am facing now.
    Digitizing

    ReplyDelete
  12. The contents of this blog are always very interesting, educative and informative, I must commend you for the good work you are doing here while I urge you to keep it up. Thanks for sharing this wonderful article on digitizing embroidery.
    Dezinesol is the best graphic design company provided services like logo design , vector art, embroidery digitizing. Place your order today.

    ReplyDelete
  13. Embroidery digitizing is an art form that combines technology and creativity to bring designs to life. True Digitizing excels in this craft, providing top-notch services in the USA. With precision and expertise, they transform ordinary designs into stunning embroidered masterpieces. Whether it's logos, monograms, or intricate patterns, True Digitizing's team of skilled professionals ensures that every detail is captured accurately

    ReplyDelete
  14. Appliqué embroidery has a rich history that spans cultures and centuries. Its timeless appeal lies in the ability to combine different fabrics, colors, and textures to craft unique and eye-catching designs. From delicate floral patterns to bold geometric shapes, the possibilities are limited only by your imagination. A1 Digitizing understands the significance of preserving this art form and brings it to life in the digital realm.

    ReplyDelete
  15. True Digitizing offers top-notch digitizing services in the USA. Our skilled team ensures precision and quality in every design. From logos to embroidery, we digitize it all! Experience affordable, reliable, and fast digitizing solutions. Trust True Digitizing for your embroidery needs and elevate your brand's image with our expert craftsmanship.

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. Digitizing services is a trailblazer in the realm of digitizing services, specializing in transforming intricate designs into stunning embroidered masterpieces. Our team of seasoned professionals leverages cutting-edge technology and a profound understanding of design intricacies to bring your vision to life with precision and finesse.

    ReplyDelete
  18. "Exciting times ahead! AGI promises unprecedented capabilities, but also demands careful stewardship. Collaboration between disciplines is key to harnessing its full potential responsibly."
    regards: Artificial General Intelligence

    ReplyDelete
  19. Great insights on choosing top-notch Embroidery Pattern Digitizing services! Your guide makes navigating the vast world of embroidery digitizing much clearer. Thanks for the valuable info.

    ReplyDelete