XDL Graphics Quick Start ๐
โ Ready to Use NOW
Your graphics system is fully functional with GUI support!
๐ฏ Run Your First Plot (30 seconds)
Step 1: Launch the GUI
cd /Users/ravindraboddipalli/sources/gdl/xdl
./target/release/xdl-gui
Step 2: Load Demo Script
In the GUI menu:
- File โ Open
- Navigate to:
examples/plot_demo.xdl - Click Open
Step 3: Execute
Click the Execute button
Step 4: Watch Magic! โจ
An interactive plot window will appear with a sine wave!
๐จ What You Get
โ 44 Graphics Procedures - All working โ Interactive FLTK Windows - Resizable, beautiful โ Color Tables - 5 predefined (grayscale, rainbow, etc.) โ PNG Fallback - Works in CLI mode too โ Multiple Windows - Create as many plots as you need
๐ Simple Examples
Example 1: Basic Plot
x = FINDGEN(100) / 10.0
y = SIN(x)
PLOT, y, x
Example 2: Histogram
seed = 42
data = RANDOMU(seed, 1000)
HISTOGRAM, data
Example 3: Bar Chart
values = [10, 25, 15, 30, 20]
BAR_PLOT, values
Example 4: With Colors
LOADCT, 13 ; Rainbow colors
x = FINDGEN(50)
y = SIN(x / 5.0)
PLOT, y, x
๐ ๏ธ Available Commands
Plotting
PLOT- Line plotsOPLOT- OverplotCONTOUR- Contour plotsSURFACE- 3D surfacesHISTOGRAM- HistogramsBAR_PLOT- Bar chartsPLOT3D- 3D line plots
Window Management
WINDOW, n- Create window nWSET, n- Switch to window nWDELETE, n- Delete window nERASE- Clear current window
Colors
LOADCT, table_num- Load color table- 0 = Grayscale
- 1 = Blue-Red
- 2 = Blue-White
- 3 = Green-Red-Blue-White
- 13 = Rainbow
Image Display
TV, image- Display imageTVSCL, image- Display with scaling
๐ฎ GUI Features
In the main GUI window:
- File โ Open - Load .xdl scripts
- File โ Save - Save your code
- Execute Button - Run current script
- Clear Button - Reset editor
- Variable Browser - View all variables
In plot windows:
- Resizable - Drag corners to resize
- Plot Info Button - View statistics
- Close - Continue script execution
๐ก Pro Tips
- Use the GUI for interactive work
- Use CLI (
./target/release/xdl script.xdl) for batch jobs - Close plot windows to continue script execution
- Multiple plots? Each PLOT command creates a new window
- Save plots? Take screenshots or export to PNG
๐ Troubleshooting
Q: Plot window doesnโt appear A: Make sure youโre using xdl-gui, not xdl CLI
Q: Get PNG files instead A: Thatโs the CLI fallback - use GUI for interactive plots
Q: GUI wonโt start A: Make sure FLTK dependencies are installed (they should be if it compiled)
๐ More Information
- Full Documentation:
docs/GRAPHICS_IMPLEMENTATION.md - Examples:
examples/plot_demo.xdl - Test Scripts:
tests/test_graphics.xdl
๐ Youโre Ready
Try it now:
./target/release/xdl-gui
Load examples/plot_demo.xdl and click Execute!
Enjoy your new graphics system! ๐จ๐โจ