Python Charts
    • Matplotlib 63 The core library, with full control over every element
    • Plotly 27 Interactive charts for the web and notebooks
    • Seaborn 17 Statistical plots straight from DataFrames
    • Pandas 8 Quick charts with df.plot()
    • Altair 5 Declarative charts built on Vega-Lite
    • Plotnine 3 ggplot2's grammar of graphics in Python
    • Streamlit 1 Charts inside Streamlit data apps
    • A/B Testing 15 Sample size, analysis and sequential tests
    • Machine Learning 14 Evaluate and explain scikit-learn models
    • Causal Inference 10 Diff-in-diff, synthetic control, IV and more
    • AI 1 Use LLMs to build charts from your data
  • Python
  • All Posts
  • Partial Dependence and ICE Plots in Python with scikit-learn
    Machine Learning

    Partial Dependence and ICE Plots in Python with scikit-learn

    Draw partial dependence and ICE plots with scikit-learn's PartialDependenceDisplay to see how a model's prediction changes with one feature, and when the average hides different groups.

    Nov 25, 2026
    machine learning scikit-learn partial dependence ice plot model interpretation gradient boosting matplotlib
  • Learning Curve and Validation Curve in Python: Diagnose Overfitting and Underfitting
    Machine Learning

    Learning Curve and Validation Curve in Python: Diagnose Overfitting and Underfitting

    Use scikit-learn's LearningCurveDisplay and ValidationCurveDisplay to tell whether a model is overfitting, underfitting, or needs more data, and to pick a hyperparameter such as max_depth.

    Nov 25, 2026
    machine learning scikit-learn learning curve validation curve overfitting bias variance cross validation model evaluation
  • t-SNE vs UMAP in Python: How to Visualize High-Dimensional Data
    Machine Learning

    t-SNE vs UMAP in Python: How to Visualize High-Dimensional Data

    Embed high-dimensional data in 2D with t-SNE and UMAP, plot it with Matplotlib, tune perplexity and n_neighbors, and learn which parts of the picture you can trust.

    Nov 25, 2026
    machine learning scikit-learn tsne umap dimensionality reduction embeddings matplotlib
  • Machine Learning Charts in Python: A Guide to Evaluating and Exploring Models
    Machine Learning

    Machine Learning Charts in Python: A Guide to Evaluating and Exploring Models

    Which chart answers which machine learning question? A map of the ROC, precision-recall, calibration, SHAP, feature importance, K-means and PCA tutorials, with the order to read them in.

    Nov 25, 2026
    machine learning scikit-learn model evaluation classification clustering shap guide
  • PCA in Python: Explained Variance, Scree Plot, Loadings and Biplot
    Machine Learning

    PCA in Python: Explained Variance, Scree Plot, Loadings and Biplot

    Run PCA in scikit-learn, plot explained variance and a scree plot to choose how many components to keep, read the loadings, and draw a biplot.

    Nov 25, 2026
    machine learning scikit-learn pca dimensionality reduction explained variance scree plot biplot matplotlib
  • Residual Plot for Regression in Python with scikit-learn
    Machine Learning

    Residual Plot for Regression in Python with scikit-learn

    Draw residual plots for a regression model with scikit-learn's PredictionErrorDisplay, learn to read curves, fans and outliers, and fix them with a log-transformed target.

    Nov 25, 2026
    machine learning scikit-learn residual plot regression model diagnostics heteroscedasticity qq plot matplotlib
  • Decision Boundary Plot in Python with scikit-learn
    Machine Learning

    Decision Boundary Plot in Python with scikit-learn

    Plot a classifier's decision boundary with scikit-learn's DecisionBoundaryDisplay, compare six models on the same data, and see overfitting as a jagged boundary.

    Nov 25, 2026
    machine learning scikit-learn decision boundary classification knn random forest svm overfitting matplotlib
  • SHAP Plots in Python: Beeswarm, Bar, Waterfall, and Dependence
    Machine Learning

    SHAP Plots in Python: Beeswarm, Bar, Waterfall, and Dependence

    Explain a model with SHAP in Python: build the explainer, then read the beeswarm, bar, waterfall, and dependence plots, with runnable code for each.

    Nov 25, 2026
    machine learning shap scikit-learn feature importance model interpretability gradient boosting
  • Calibration Curve in Python: Check and Fix Predicted Probabilities
    Machine Learning

    Calibration Curve in Python: Check and Fix Predicted Probabilities

    Plot a calibration curve in Python with scikit-learn's CalibrationDisplay, see which models give trustworthy probabilities, and fix the ones that don't with CalibratedClassifierCV.

    Nov 25, 2026
    machine learning scikit-learn calibration curve probability calibration brier score classification model evaluation matplotlib
  • How to Plot a Decision Tree in Python with scikit-learn
    Machine Learning

    How to Plot a Decision Tree in Python with scikit-learn

    Plot a decision tree with scikit-learn's plot_tree, print its rules with export_text, and prune an overgrown tree with ccp_alpha so it stays readable and generalizes.

    Nov 25, 2026
    machine learning scikit-learn decision tree plot tree export text pruning classification matplotlib
  • K-Means Elbow Method and Silhouette Plot in Python
    Machine Learning

    K-Means Elbow Method and Silhouette Plot in Python

    Choose the number of clusters for K-means in Python with the elbow method and silhouette score, and read a silhouette plot to see which clusters are weak.

    Nov 25, 2026
    machine learning scikit-learn k-means clustering elbow method silhouette score unsupervised learning matplotlib
  • How to Plot a ROC Curve and Calculate AUC in Python
    Machine Learning

    How to Plot a ROC Curve and Calculate AUC in Python

    Plot a ROC curve in Python with scikit-learn's RocCurveDisplay, compare models by AUC, pick a threshold, and handle multiclass and cross-validated curves.

    Nov 25, 2026
    machine learning scikit-learn roc curve auc classification model evaluation matplotlib
  • How to Plot a Precision-Recall Curve in Python
    Machine Learning

    How to Plot a Precision-Recall Curve in Python

    Plot a precision-recall curve in Python with scikit-learn's PrecisionRecallDisplay, compare models by average precision, and pick a threshold on imbalanced data.

    Nov 25, 2026
    machine learning scikit-learn precision-recall curve average precision classification imbalanced data model evaluation matplotlib
  • Feature Importance in Python: Impurity vs Permutation Importance
    Machine Learning

    Feature Importance in Python: Impurity vs Permutation Importance

    Plot feature importance in Python with scikit-learn, compare impurity-based importances to permutation importance on a test set, and see why the two can disagree.

    Nov 25, 2026
    machine learning scikit-learn feature importance permutation importance random forest model interpretability matplotlib

Python plotting and visualization demystified

© 2026 PythonCharts.com. All rights reserved.
  • About
  • Credits
  • Privacy Policy