Im checking and I see you will have to do exactly the same but in reverse order.
First you should take a bus from Malaga to Cadiz, and then transfer to a bus from Cadiz to Rota.
I found the schedule below for buses from Malaga to Cadiz:
13:05 - CADIZ
17:30 - CADIZ
19:30 - CADIZ
00:00 - CADIZ
Walking map from Malaga cruise port to Malaga bus station
It is an approximation, Malaga bus station
is close to "Paseo de los Tilos"