March 18, 2025

Introduction

  • This presentation demonstrates the use of Plotly for creating interactive data visualizations in R
  • Plotly allows for creation of publication-quality charts with interactive features
  • Features include tooltips, zooming, and panning
  • Created on March 18, 2025

Interactive Data Visualization

Code Behind the Visualization

# Create the Plotly figure
p <- plot_ly(climate_data, x = ~Year, y = ~TempAnomaly, 
             type = 'scatter', mode = 'lines+markers',
             marker = list(size = 5, color = colors[color_indices]),
             line = list(color = 'rgba(100, 100, 100, 0.5)'),
             hoverinfo = 'text',
             text = ~paste("Year:", Year, 
                          "<br>Temperature Anomaly:", 
                          round(TempAnomaly, 2), "°C")) %>%
  layout(title = "Global Temperature Anomalies (1880-2024)",
         xaxis = list(title = "Year"),
         yaxis = list(title = "Temperature Anomaly (°C)"),
         hovermode = "closest")

Analysis

Key observations:

  • Clear upward trend in temperature anomalies
  • Rate of increase appears to accelerate in recent decades
  • Year-to-year variability is significant
  • Long-term warming trend is unmistakable

Interactive Features

This Plotly visualization includes:

  • Hover tooltips: Move your cursor over data points
  • Zooming: Click and drag to zoom
  • Panning: After zooming, click and drag to move
  • Download: Use camera icon to download the plot
  • Reset: Double-click to reset the view

Alternative Visualization: 3D Surface Plot

Conclusion

  • Plotly provides powerful tools for interactive data visualization
  • Enhances data exploration and communication
  • Interactive elements improve audience engagement
  • R + Plotly + R Markdown makes presentation creation smooth

Thank You!

Created on: March 18, 2025