Introduction: Adding Visual Feedback to Your Workflow

In the previous lesson, you discovered Claude's agentic capabilities—how it autonomously creates files, executes code, and verifies results. You watched Claude generate complete data visualizations by writing Python scripts, running them, and confirming the output files were created successfully.

Creating a plot is just the beginning. The real challenge in data visualization is evaluating whether your plot effectively communicates your data. Does the color scheme work? Are the axes labeled clearly? Is the data pattern visible? These questions require visual judgment—you need to actually look at the plot and assess its quality.

This is where Claude's visual analysis capabilities become essential. Claude doesn't just create visualizations blindly—it can examine the images it produces, describe what it sees, identify potential issues, and suggest specific improvements. In this lesson, you'll learn how Claude can analyze visualizations using the Read tool with image files in your project directory.

Using the Read Tool with Image Files

The Read tool works identically with image files as it does with code files—Claude can examine PNG, JPG, and other image formats just as easily as it reads Python scripts. Let's see this in action with the first_plot.png file you created in the previous lesson:

Ask Claude to describe this image:

> Describe the image in first_plot.png

Claude uses the Read tool to examine the image:

● I'll read the image file to describe it for you.

● Read(first_plot.png)
  ⎿  Read image (20.1KB)

● This image shows a simple line plot with the following characteristics:

  Title: "Numbers 1 through 10"

  Axes:
  - X-axis: "Index" (ranging from 0 to 10)
  - Y-axis: "Value" (ranging from 0 to 10)

  Plot Content: A single blue line displaying a linear relationship, starting at approximately (0, 1) and rising steadily to
  (10, 10). The line shows a perfectly linear progression with a slope of 1, representing the numbers 1 through 10.

  Style: The plot includes a light gray grid for easier reading of values and appears to be generated using matplotlib, a common
  Python plotting library. The visualization is clean and straightforward, effectively showing a simple linear sequence.

Notice the level of detail in Claude's analysis. Claude identifies the title, describes both axes with their ranges, explains the data pattern (linear relationship with a slope of 1), notes the styling elements (blue line, gray grid), and even recognizes the library used to create it. The Read tool shows you exactly what it's doing—you see Read(first_plot.png) followed by confirmation that it read a 20.1KB image file.

Creating a Visualization for Analysis

The real power of Claude's visual analysis emerges when you combine it with Claude's code generation capabilities. You can create a visualization, have Claude examine it, discuss what could be improved, and then have Claude modify the code based on what it observed. Start by asking Claude to create a basic histogram:

> Create a histogram showing a normal distribution with 1000 samples

Claude generates the code and creates the visualization:

● Write(histogram_plot.py)
  ⎿  Wrote 18 lines to histogram_plot.py

● Bash(python histogram_plot.py)
  ⎿  (No content)

● Bash(ls -lh normal_histogram.png)
  ⎿  -rw-r--r--. 1 runner runner 28K Dec  8 18:15 normal_histogram.png

● Created normal_histogram.png! The histogram shows 1000 samples from a normal distribution with mean=0 and standard deviation=1.

Here's what Claude created:

Having Claude Analyze Its Own Work

With the histogram created, you can now ask Claude to critically evaluate its own work. This is where Claude's visual analysis becomes particularly valuable—it can identify areas for improvement that might not be obvious from the code alone:

> Analyze the histogram you just created

Claude reads and evaluates the image:

● Read(normal_histogram.png)
  ⎿  Read image (28.3KB)

● The histogram looks good overall, but I notice a few areas we could improve:

  Current State:
  - Shows a clear bell curve shape with 1000 samples
  - 30 bins (default) which provides reasonable detail
  - Basic blue bars with black edges
  - Standard axis labels and title

  Potential Improvements:
  1. The number of bins could be optimized - 30 might be too many for this sample size
  2. We could add a fitted normal distribution curve overlay to show the theoretical distribution
  3. The color scheme is basic - we could use a more visually appealing color
  4. Adding transparency would help if we overlay the curve
  5. We could include statistical information (mean, std) in the title or as text

  Would you like me to implement any of these improvements?

Claude doesn't just describe what exists—it identifies specific opportunities for improvement based on data visualization best practices.

Implementing Improvements Based on Visual Feedback

Now ask Claude to implement these improvements:

> Yes, implement all of those improvements

Claude modifies the code based on its visual analysis:

● Read(histogram_plot.py)
  ⎿  Read 18 lines

● Update(histogram_plot.py)
  ⎿  Updated histogram_plot.py with 15 additions and 5 removals

● Bash(python histogram_plot.py)
  ⎿  (No content)

● Read(normal_histogram.png)
  ⎿  Read image (31.2KB)

● Perfect! I've updated the histogram with all the improvements:

  Changes Made:
  1. Reduced bins from 30 to 20 for clearer visualization
  2. Added a red curve showing the theoretical normal distribution
  3. Changed bars to teal color with transparency (alpha=0.7)
  4. Added mean and std deviation to the title
  5. Included a legend distinguishing the histogram from the fitted curve

  The visualization now clearly shows how well the random samples match the theoretical normal distribution, and the statistical
  information is immediately visible in the title.

Here's the improved histogram with all enhancements applied:

Notice the complete workflow Claude executed autonomously. Claude read the existing code, made surgical modifications to implement all five improvements, ran the updated script, and then read the new image to verify the changes were successful. You can continue this process for as many iterations as needed, describing what you observe or what you'd like changed, and Claude modifies the code accordingly.

Summary: Your Visual Analysis Partner

You've just learned that Claude can do more than create visualizations—it can analyze them. The Read tool allows Claude to examine image files in your project directory with comprehensive visual analysis, where Claude describes titles, axes, data patterns, colors, styling, and identifies specific opportunities for improvement.

This capability enables an iterative refinement workflow. You can ask Claude to create a visualization, have Claude examine what it produced, discuss potential improvements, and then have Claude modify the code based on its visual observations. As you move into the practice exercises, you'll experience this workflow firsthand. Pay attention to how Claude's observations translate into specific code modifications.

Sign up
Join the 1M+ learners on CodeSignal
Be a part of our community of 1M+ users who develop and demonstrate their skills on CodeSignal