Rename a temporary variable 'var' to 'plotvar' to avoid confusion with the other variable named 'var'.