You can find various tutorials online, such as this.
However, please note that OnlineGDB supports standard input and output only, no graphics as the programs actually run on a server, not on your local machine, so all of the plotting wouldn't work in OnlineGDB. You can have your own Python installation on your local machine though.
Good luck!