A network diagram with connected nodes, representing automated plot grading methods in CodeGrade.
June 25, 2025

Smarter Plot Grading: Two Automated Approaches for Faster Feedback

In 30 seconds...

Tired of spending hours manually grading student plots? Discover two automated methods in CodeGrade – Image Comparison and Object Inspection – that provide fast, consistent feedback, freeing you up for more impactful teaching. Learn which approach is best for your data-heavy course.

Grading plots manually is one of the most time-consuming and inconsistent parts of teaching data-heavy courses. Whether students are visualizing model outputs, PCA projections, or the impact of changing parameters, you want to give meaningful feedback, without spending hours opening screenshots.

With CodeGrade, you can automatically grade student plots, giving them fast feedback and freeing yourself up for more impactful teaching.

In this post, we’ll walk through two flexible, fully automated ways to grade plots using CodeGrade’s Autotest system, and help you decide which fits your course best.

Method 1: Image Comparison

"Do the plots look the same?"

This setup allows you to automatically validate plots based on how closely they match the correct output in appearance, with no need to interpret data structures or inspect plot objects.

How it works:

A grading script compares the student’s plot with a reference image using the Structural Similarity Index (SSIM) — a perceptual image quality metric provided by the scikit-image library.

Here’s what the script does:

  • Loads both the student’s and reference images using Pillow

  • Converts the images to grayscale and NumPy arrays for consistency

  • Calculates an SSIM score to measure visual similarity

  • Passes the test if the score is high enough (typically above 0.80)

This is a great fit for assignments where visual output matters most — such as scatter plots, PCA projections, or clustering visualizations — and you're looking for quick confirmation that the student produced a similar-looking plot.

Best for: fast visual checks, cosmetic layout validation, quick setup
Keep in mind: it’s sensitive to small changes like font size or resolution, and it doesn’t check if the right data was plotted — only how it looks. It also requires managing external plot files in the fixture folder.

Start grading your plots today!

Continue reading

The Terminal Is Here: CodeGrade's Editor Grew Up

The Terminal is here in beta: a real Ubuntu command line in CodeGrade's redesigned browser editor. Email support for access and a guided setup session.

You Can Now Limit Copy-Pasting in the CodeGrade Code Editor

Prevent copy-pasting in coding assignments. CodeGrade lets you cap or block pasting in the code editor, per assignment. You set the limit. Start free.

Everything CodeGrade Shipped in Q2 2026

See all 14 CodeGrade releases from Q2 2026: simpler login and enrollment, faster AutoTest setup, a context-aware AI assistant, and exam fixes. Start free.

Sign up to our newsletter