Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- titanic.plot(subplots = True, figsize = (15,12), sharex = False, sharey = False)
- plt.show()
- ##################################################
- xticks = [x for x in range(0,901, 50)]
- xticks
- yticks = [y for y in range(0, 81, 5)]
- yticks
- plt.style.available
- plt.style.use("seaborn-v0_8")
- titanic.age.plot(figsize = (12,8), fontsize= 13, c = "r", linestyle = "-",
- xlim = (0,900), ylim = (0,80), xticks = xticks, yticks = yticks, rot = 45)
- plt.title("Titanic - Ages", fontsize = 15)
- plt.legend(loc = 3, fontsize = 15)
- plt.xlabel("Passenger No", fontsize = 13)
- plt.ylabel("Age", fontsize = 13)
- plt.grid()
- plt.show()
- ######################################################
- # Histogram
- titanic.age.plot(kind = "hist", figsize = (12,8), fontsize = 15, bins = 80, density = True)
- plt.show()
- ######################################################
- # Bar chart
- summer_2012.Medal.plot(kind = "bar", figsize = (12,8), fontsize = 12)
- plt.show() # all countries with their medals
- summer_2012.Medal.plot(kind = "barh", figsize = (12,8), fontsize = 12)
- plt.show()
- ######################################################
- # Pie chart
- summer_2012.Medal.plot(kind = "pie", figsize = (12,8), fontsize = 12)
- plt.show()
- ######################################################
- # Scatter plot
- cars.plot(kind = 'scatter', x = 'horsepower', y = 'mpg', figsize = (12,8), s = 30, c = 'cylinders', marker = 'x', colormap = "viridis")
- plt.title('Scatterplot with horsepower and mpg', fontsize = 18)
- plt.xlabel("horsepower", fontsize = 15)
- plt.ylabel("mpg", fontsize = 15)
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement