Consider the following sequence:
1.retrieve data
2.make invisible copy
3.close original data table
4.create graphs
5.add a function to one graph to close the invisible table when it is closed.
Something like as follows:
dt_original=opendatabase(parameters);
dt=dt_original<<subset(rows(),invisible);
close(dt_original,nosave);
plot_graph=dt<<graphbuilder(parameters);
plot_graph<< Subscribe("Close Invisible table", On Close( close(dt,nosave) ) );