Space-race drama Hidden Figures – about a group of black female mathematicians who were instrumental in getting the Apollo missions off the ground – has retained its position at the top of the US box office as a slew of more obviously commercially targeted films failed to score with audiences.

The film, which stars Taraji P Henson, Octavia Spencer and Janelle Monáe, and is directed by Theodore Melfi, saw off competition from new arrivals such as big-budget action comedy Monster Trucks, which could only manage seventh with an estimated $10.5m on its opening weekend, and the Jamie Foxx kidnap thriller Sleepless, which fared even more poorly, with $8.46m for eighth place. Outdoing both was little-heralded horror film The Bye Bye Man, which managed to land in fifth place with $13.38m.

Hidden Figures’ estimated $20.45m in its fourth week on release was enough to comfortably see off La La Land, which took $14.5m for second place in its sixth week. Hidden Figures’ box office sturdiness – perhaps fuelled by the Martin Luther King holiday weekend – was further underlined by the underwhelming performance of a number of high-profile expanding films, which added large numbers of screens but little in the way of receipts. After three weeks of limited play, Boston marathon thriller Patriots Day went nationwide, yet only managed $12m to land at No 6; Martin Scorsese’s religious drama Silence took $1.9m to stall at No 16; while Ben Affleck mob thriller Live By Night added more than 2,800 screens from its previous week, but failed to crack the Top 10, settling for $5.42m at No 11.

Monster Trucks’ failure to dent the box office was widely anticipated, after reports emerged that studio Paramount were expecting to lose $115m on the project.