# Code Interpreter iframe ## Description The Code Interpreter tool lets mentorAI run Python code in‑chat and display the resulting graphs, charts, and other visualizations instantly. It’s perfect for math, data analysis, and any concept that benefits from seeing a plot—such as integrals, functions, or statistical summaries—right alongside the explanation. ## Target Audience **Student** ## Features #### In‑Chat Graphs & Visualizations Ask mentorAI to plot functions, integrals, histograms, scatterplots, and more. The image appears directly below the AI’s response. #### Python Sandbox Execution mentorAI safely runs Python code behind the scenes, allowing complex computations without leaving the chat. #### Automatic Task Restatement Before executing, mentorAI restates your request (e.g., “Plot the integral of x² from 1 to 100”) so you can confirm the task is correct. #### Immediate, Context‑Aware Explanations After showing the graph, mentorAI explains what the visualization means and how it relates to your original question. ## How to Use (step by step) #### Verify the Tool Is Enabled In the mentor sidebar, look for **Code Interpreter** and confirm it’s toggled **On**. #### Enter Your Request Type a prompt in the chat, such as: > Plot the integral of x² from 1 to 100. #### MentorAI Restates the Task The AI echoes your request to ensure it understood correctly (e.g., > “Sure—plotting ∫ x² dx from 1 to 100”) #### View the Generated Graph mentorAI runs the code and renders the graph directly in the chat. No extra clicks or downloads required. #### Review the Explanation Beneath the graph, mentorAI provides a **concise interpretation**—highlighting key points, intercepts, or areas under the curve. #### Iterate or Refine Need changes? Ask follow‑up prompts: - “Add gridlines.” - “Zoom into x = 1 to 10.” - “Overlay y = x³ for comparison.” The AI updates the visualization accordingly. ## Pedagogical Use Cases #### Calculus Visualization Plot definite or indefinite integrals, derivatives, and Riemann sums to see area under curves and slope behavior. #### Function Exploration Compare multiple functions (e.g., y = sin x vs. y = cos x) on the same axes to study amplitude, period, and phase shifts. #### Statistics & Data Analysis Upload small datasets (CSV or pasted values) and request histograms, box plots, or scatterplots to analyze distributions and correlations. #### Physics & Engineering Labs Graph experimental data (e.g., projectile motion) and fit trend lines or polynomials to validate theoretical models. #### Quick Concept Checks When a textbook shows a complex plot, replicate it in mentorAI to verify understanding or explore “what‑if” variations. With **Code Interpreter enabled**, you can transform abstract math and data questions into **clear, visual answers**—right inside mentorAI.