
Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!

Graphs in Python: ● Matplotlib - graphing and data visualization library ○ Main functions: ■ We have to write down all points (x, y) into array ■ Use .plot() to plot the points on canvas ■ .xlabel() and .ylabel() - gives a name to x-axis and y-axis ■ .title() - title the graph ■ .legend() - more information about the graph ■ .show() - view the plot ○ Customization: ■ .plot(color=, linestyle=’dashed’, linewidthmarker=’o’, markerfacecolor=, markersize=) ○ Bar chart: ■ Write down height and left sides of bars ■ plt.bar() ○ Histogram: ■ Write down frequencies and set intervals ■ plt.hist() ○ Scatter plot: ■ X and Y values ■ plt.scatter() ○ Pie-chart: ■ Define labels and portions for each slice ■ plt.pie()