Announcement

Collapse
No announcement yet.

FYI - WEbPlotDigitizer

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FYI - WEbPlotDigitizer

    WebPlotDigitizer is a browser based (or standalone) app that lets the user pick data points off of a graph and then generate an equation which will plot the data. The graph can be on a web page or on a graphic image loaded locally. A nice tutorial video explains the details.

    https://automeris.io/WebPlotDigitizer/
    "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
    – John F. Kennedy, February 26, 1962.

    #2
    This is just waaayyyy cool!
    thanks!
    woody

    Comment


      #3
      Indeed! I pulled data for four plots presented as a stacked area graph. Fed the data points into SageMath and used it to generate a 6th order polynomial. Used that to generate the first derivative in order to find the inflection points. A good friend and former client whom I've known for almost 40 years, who has a degree in Ag Engineering and farms, wanted to pull the data from the stacked area graph of "Seasonal Nitrogen Update". The four areas were "Leaf Blades", "Stalk and Leaf Sheaths", "Tassel, Cob, Husk Leaves", and "Grain". He was using EXCEL and hand picking a dozen points. Excel's first derivative on a 5th order polynomial was nonsensical. I used the SageMath's Notebook() capability.

      Code:
      data = [(300.000000000000, 9.94809280595666),(350.000000000000, 11.9275313210500),(400.000000000000, 13.9069698361434),(450.000000000000, 16.4262552189894),(500.000000000000, 18.9455406018354),(550.000000000000, 21.6447749405990),(600.000000000000, 24.7039071911977),
      (650.000000000000, 28.3028863095492),(700.000000000000, 32.4417122956534),(750.000000000000, 37.3003341054279),(800.000000000000, 43.4185986066254),
      (850.000000000000, 51.1564037110811),(900.000000000000, 60.3338004628773),(950.000000000000, 73.2901252889426),(1000.00000000000, 91.1050719247825),
      (1050.00000000000, 110.359610207963),(1100.00000000000, 128.534454755638),(1150.00000000000, 142.750422273126),(1197.30457668110, 152.648127676469),
      (1241.91373004330, 161.106754260348),(1299.96717901590, 171.347320288342),(1349.96717901590, 178.365329569128),(1395.95686502165, 184.679298243736),
      (1448.65023702904, 190.807360103322),(1499.99384606548, 195.686345871688),(1549.99589737699, 199.275014803774),(1601.33745510192, 201.465076419642),
      (1700.00000000000, 205.012761020607),(1750.00000000000, 207.172148491617),(1800.00000000000, 208.971638050793),(1850.00000000000, 210.771127609969),
      (1900.00000000000, 212.930515080980),(1950.00000000000, 216.169596287496),(2000.00000000000, 219.408677494012),(2050.00000000000, 222.287860788694),
      (2100.00000000000, 225.526941995210),(2150.00000000000, 228.406125289891),(2200.00000000000, 231.645206496407),(2250.00000000000, 234.884287702924),
      (2300.00000000000, 237.763470997605),(2350.00000000000, 240.642654292286),(2400.00000000000, 243.881735498802),(2450.00000000000, 246.760918793484),
      (2500.00000000000, 250.000000000000),(235.758257041639, 7.56472400629349),(165.701866488339, 5.29494782489195),(95.6475272465450, 2.83491250130777),
      (33.6753553384355, 0.753856978459226),(2590.23103921492, 255.214177434343),(1654.13349525019, 203.261380163407),]
      # 6th degree polynomial
      var('a,b,c,d,e,f,g')
      model(x) = g*x^6 + f*x^5 + e*x^4 + d*x^3 + c*x^2 + b*x + a 
      sol = find_fit(data,model)
      #print sol
      var('xx,dx,z')
      f(xx) = -7.837682944101485e-17*xx^6 + 6.485420491152026e-13*xx^5 - 2.000835782210809e-09*xx^4 + 2.7746268049000093e-06*xx^3 - 0.001613868756524219*xx^2 + 0.384986221902241*xx - 17.913132237665565
      dx = diff(f(xx),xx)
      #print "dx=",dx
      #first derivative of xx.  Use the printed equations to fill in f(xx) & f(z) for the next run
      
      p = plot([])
      p += list_plot(data,color='red')
      p += plot(f(xx),xx,(xx,0,2500),color='blue',title="6th Order Polynomial Plot of Seasonal Corn Nitrogen Uptake - Blue Region")
      show(p)
      p = plot([])
      print
      q = plot([])
      f(z) = -(4.70260976646089e-16)*z^5 + (3.24271024557601e-12)*z^4 - (8.00334312884324e-9)*z^3 + (8.323880414700028e-6)*z^2 - 0.00322773751304844*z + 0.384986221902241
      
      q += plot(f(z),z,(z,0,2500),color='green')
      show(q)
      "Print sol" printed the solution for the coefficients. I copied and pasted them into the script to create the function "f(xx)=..."

      Click image for larger version

Name:	WebPlotDigitizer_seasonal_corn.jpg
Views:	1
Size:	62.1 KB
ID:	643825
      The plot of just the blue curve
      Click image for larger version

Name:	6thOrder_blueplot.jpg
Views:	1
Size:	26.8 KB
ID:	643823
      The plot of the 1st derivative of the blue curve
      Click image for larger version

Name:	6tjOrder_derivative.jpg
Views:	1
Size:	22.3 KB
ID:	643824
      Attached Files
      Last edited by GreyGeek; Apr 06, 2018, 08:50 PM.
      "A nation that is afraid to let its people judge the truth and falsehood in an open market is a nation that is afraid of its people.”
      – John F. Kennedy, February 26, 1962.

      Comment

      Working...
      X