-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgnuplot-script
More file actions
1 lines (1 loc) · 2.67 KB
/
gnuplot-script
File metadata and controls
1 lines (1 loc) · 2.67 KB
1
b'#!/usr/bin/gnuplot\n#\n# The calibration matrix (affine transformation with offset to origin):\n#\n# [[ 1.00579223e+00 -9.69727879e-03 -8.50240184e+02]\n# [ -9.69727879e-03 1.01623506e+00 -1.77743179e+03]\n# [ 0.00000000e+00 0.00000000e+00 1.00000000e+00]]\n#\n# The same matrix, as a Python array:\n#\n# sensor.calibration = [[1.0057922291938481, -0.009697278791680974, -850.2401839948363], [-0.00969727879168103, 1.0162350647421652, -1777.4317898563836], [0.0, 0.0, 1.0]]\n#\ninput_data = "magnet-data_20200307_2144.txt"\nset output "magnet-data_20200307_2144.png"\ncircle_size = 6000 * 0.02\nraw_data_color = "#28e828"\nellipse_color = "#38a838"\naffine_offset_color = "#d0d0d0"\naffine_centered_color = "#c020c0"\nset term png size 1200, 1200 font "Helvetica,18"\nset style line 100 lc rgb raw_data_color lw 1\nset style line 300 lc rgb ellipse_color lw 3\nset style line 400 lc rgb affine_offset_color lw 3\nset style line 500 lc rgb affine_centered_color lw 3\nset style fill transparent solid 0.50\nset title "QMC5883L Magnetic Sensor X-Y Plane Calibration"\nset size ratio 1\nset xzeroaxis\nset yzeroaxis\nset xrange [-6000:6000]\nset yrange [-6000:6000]\nset label 40 center at graph 0.5,char 1.5 \\\n "Ellipse center (x, y) = (862, 1757), Semi-axis (a, b) = (2559, 2504), Rotation = 30.9\xc2\xb0"\nset bmargin 5\nset object 20 ellipse center 862.29,1757.26 size 5118.82,5008.50 angle 30.85 \\\n front fillstyle empty border lc rgb ellipse_color lw 3\nset object 10 circle center 862.29,1757.26 size 2559.41 \\\n front fillstyle empty border lc rgb affine_offset_color lw 3\nset object 30 circle center 0,0 size 2559.41 \\\n front fillstyle empty border lc rgb affine_centered_color lw 3\nplot input_data using 1:2:(circle_size) with circles linestyle 100 \\\n title "Raw Data", \\\n "<echo \'862.29 1757.26 3059.57 3069.71\\n862.29 1757.26 -421.88 3907.19\'" \\\n using 1:2:($3-$1):($4-$2) with vectors nohead linestyle 300 \\\n title "Best Fit Ellipse", \\\n "<echo \'862.29 1757.26 1114.91 4268.03\\n862.29 1757.26 1092.02 4306.34\'" \\\n using 1:2:($3-$1):($4-$2) with vectors nohead linestyle 400 \\\n title "Affine Transformation from Ellipse to Circle", \\\n "<echo \'1114.91 4268.03\\n1092.02 4306.34\'" \\\n using 1:2:(circle_size) with circles linestyle 400 \\\n title "Transformation: Example Point", \\\n "<echo \'0 0 229.74 2549.08\'" \\\n using 1:2:($3-$1):($4-$2) with vectors nohead linestyle 500 \\\n title "Transformation Circle: Offset to Origin", \\\n "<echo \'229.74 2549.08\'" \\\n using 1:2:(circle_size) with circles linestyle 500 \\\n title "Example Point: Offset to Origin"\n'