Welcome to our forum.
I believe the National Electrical Code (NEC) (I also believe it's part of the BOCA code as well) is at least 5 feet - it has to do with the possibility of electrocution.
Here's a few pics of mine. And looking closer at mine.....I'd say I'm lucky if mine's 2' from the tub. More than likely my situation fails code....but I have a fiberglass screen to crash through prior to electruction