How to plot/visualize clusters in scikit-learn (sklearn)?
When I run the code you posted, I get three points on my plot:



The "point" at (0, 4) corresponds to X[1] and the "point" at (0, 5) is actually three points, corresponding to X[0], X[2], and X[3]. The point at (5, 5) is the last point in your X array. The data at (0, 4) and (0, 5) belong to one cluster, and the point at (5, 5) is considered noise (plotted in black).

The issue here seems to be that you're trying to run the DBSCAN algorithm on a dataset containing 5 points, with at least 4 points required per cluster (the second argument to the DBSCAN constructor). In the sklearn example, the clustering algorithm is run on a dataset containing 750 points with three distinct centers. Try creating a larger X dataset and running this code again.

You might also want to remove the plt.ylim([0,10]) and plt.xlim([0,10]) lines from the code; they're making it a bit difficult to see the points on the edge of the plot! If you omit the ylim and xlim then matplotlib will automatically determine the plot limits.