What are some good exercises I can do if I have broken my ankle to keep in shape?

Be creative. Upper extremity exercises are for the most part ok to do. You can try using a rower with one leg only, an aerodyne type bicycle with just the arms doing the work and the foot resting but not pushing on pedals. Core work like sit ups, one leg planks, one leg yoga poses can also be safely done. Check with the physician managing your ankle to be sure.
Non impact. It depends on the fracture. If you are non weight bearing, do upper body exercise and leg lifts. If you can weight bear under the advice of your doctor, you can usually use a stationary bike or exercise in a pool.