{ "cells": [ { "cell_type": "markdown", "id": "878315c8", "metadata": {}, "source": [ "# Plotting Tutorial\n", "\n", "This tutorial demonstrates how to use the plotting capabilities of the ``AFL.double_agent`` package to visualize compositional and scattering data.\n", "\n", "## Introduction\n", "\n", "The ``AFL.double_agent.plotting`` module provides a variety of plotting functions for visualizing materials data. It supports:\n", "\n", "- Compositional data visualization (scatter and surface plots)\n", "- Small-angle scattering data visualization\n", "- Both 2D and 3D plots\n", "- Ternary plots for three-component systems\n", "- Multiple backends (Matplotlib and Plotly)\n", "\n", "In this tutorial, we'll explore these capabilities using example datasets.\n" ] }, { "cell_type": "markdown", "id": "9ae6879c", "metadata": {}, "source": [ "## Google Colab Setup\n", "\n", "Only uncomment and run the next cell if you are running this notebook in Google Colab or if don't already have the AFL-agent package installed." ] }, { "cell_type": "code", "execution_count": null, "id": "5ca3e06a", "metadata": {}, "outputs": [], "source": [ "# !pip install git+https://github.com/usnistgov/AFL-agent.git" ] }, { "cell_type": "markdown", "id": "e0689893", "metadata": {}, "source": [ "General Setup\n", "-------------\n", "\n", "First, let's import the necessary modules and load our example dataset:" ] }, { "cell_type": "code", "execution_count": 1, "id": "0763571f", "metadata": {}, "outputs": [ { "data": { "text/html": [ "
<xarray.Dataset> Size: 164kB\n", "Dimensions: (sample: 100, component: 2, x: 150, grid: 2500)\n", "Coordinates:\n", " * component (component) <U1 8B 'A' 'B'\n", " * x (x) float64 1kB 0.001 0.001047 0.001097 ... 0.9547 1.0\n", "Dimensions without coordinates: sample, grid\n", "Data variables:\n", " composition (sample, component) float64 2kB ...\n", " ground_truth_labels (sample) int64 800B ...\n", " measurement (sample, x) float64 120kB ...\n", " composition_grid (grid, component) float64 40kB ...