saving your plots automatically if you want your program to automatically save the plot to fileyou can replace the call to plt show(with call to plt savefig()plt savefig('squares_plot png'bbox_inches='tight'the first argument is filename for the plot imagewhich will be saved in the same directory as scatter_squares py the second argument trims extra whitespace from the plot if you want the extra whitespace around the plotyou can omit this argument try it yourse lf - cubesa number raised to the third power is cube plot the first five cubic numbersand then plot the first cubic numbers - colored cubesapply colormap to your cubes plot random walks in this section we'll use python to generate data for random walk and then use matplotlib to create visually appealing representation of the generated data random walk is path that has no clear direction but is generating data