plt.gcf() to get current figure
plt.gca() to get current axis
from math import ceil n = x.shape iqr = np.subtract(*np.percentile(x, [75, 25])) bin_width = 2 * iqr * n ** (-1/3) num_bins = ceil(bins=(max-min) / h)
First parameter informs the command about the number of ticks that have to be placed on the axis, and the second one explicates the labels that have to be put on the ticks.
Selected graphical examples with pandas
Density Plots (Distribution)
Scatterplots can be turned into hexagonal binning plots. In addition, they help you effectively visualize the point densities, where the points naturally aggregate together more, thus revealing clusters hidden in your data. For achieving such results, you may use some of the variables originally present in the dataset, or the dimensions obtained by a PCA or by another dimensionality reduction algorithm:
By plotting all the observations as parallel lines with respect to all the possible variables (arbitrarily aligned on the abscissa), parallel coordinates will help you spot whether there are streams of observations grouped as your classes, and understand the variables that best separate the streams (the most useful predictor variables). Naturally, in order for the chart to be meaningful, the features in the plot should have the same scale (otherwise, normalize them) as in the Iris dataset