I am looking for a way to plot the difference of two tables, where some elements may be missing in the first or in the second table.
A simple example, given two tables:
A = {{0., 9.84}, {0.5, 9.34}, {1.5, 8.34}, {2., 7.84}, {2.5, 7.34}, {3., 6.84}, {3.5, 6.34}, {4., 5.84}, {4.5, 5.34}, {5., 4.84}};
B = {{0., 10.01}, {0.5, 10.51}, {1., 11.01}, {1.5, 11.51}, {2., 12.01}, {2.5, 12.51}, {3., 13.01}, {4., 14.01}, {4.5, 14.51}, {5., 15.01}};
In the table A the element with the x-value (first elements in the tables) 1 is missing, and in the table B there is no element with x-value 3.5. I need to plot the difference of y-values (second elements in the table) vs x-values. Basically, I need to generate a difference table like this:
{{0., -0.17}, {0.5, -1.17}, {1.5, -3.17}, {2., -4.17}, {2.5, -5.17}, {3., -6.17}, {4., -8.17}, {4.5, -9.17}, {5, -10.17}}