implementing plot_variable fuction successfully.