Data Visualization
0/6 sections
0%

Python: Plotly

Plotly is a powerful Python visualization library for creating interactive, publication-quality charts and dashboards.

1Interactive Visualizations

Plotly enables creation of interactive, web-based visualizations without requiring JavaScript knowledge.

    Features:
  • Interactive charts: hover tooltips, zoom, pan, selection
  • Web-based: works in Jupyter notebooks, web browsers
  • Responsive: automatically adapts to screen size
  • Export: save as PNG, SVG, or HTML
  • Real-time updates: animate data changes
  • Dash framework: build interactive web dashboards

2Chart Types

Plotly supports diverse chart types for different analytical needs.

    Available Charts:
  • Scatter, line, bar, histogram, box plots
  • 3D surface and scatter plots
  • Geographic maps (choropleth, scatter-geo)
  • Heatmaps and contour plots
  • Sunburst and treemap hierarchical charts
  • Financial charts: candlestick, OHLC
  • Animations and transitions

3Dash Dashboards

Dash is Plotly's framework for building production web dashboards with Python.

    Capabilities:
  • Interactive layouts and callbacks
  • Real-time data updates
  • Multi-page applications
  • Component library: buttons, sliders, dropdowns
  • Styling with CSS and Bootstrap
  • Deployment: Heroku, AWS, custom servers

4Use Cases

Plotly and Dash are used for business intelligence, analytics, and data exploration.

    Applications:
  • Business dashboards and KPI monitoring
  • Scientific research visualization
  • Financial analysis and reporting
  • Data exploration and discovery
  • Real-time monitoring systems
  • Interactive reports and presentations

5Plotly Express Charts

python
import plotly.express as px
import plotly.graph_objects as go
import pandas as pd

df = pd.read_csv('sales.csv', parse_dates=['date'])

# ── Scatter plot ────────────────────────────────────── fig = px.scatter(df, x='sessions', y='revenue', color='region', size='orders', hover_data=['product_category'], trendline='ols', title='Revenue vs. Traffic by Region') fig.show()

# ── Animated line chart ─────────────────────────────── monthly = df.groupby(['date', 'region'])['revenue'].sum().reset_index() fig = px.line(monthly, x='date', y='revenue', color='region', animation_frame=None, title='Monthly Revenue by Region') fig.update_layout(hovermode='x unified')

# ── Faceted charts ──────────────────────────────────── fig = px.bar(df, x='month', y='revenue', color='product_category', facet_col='region', title='Revenue by Month, Category and Region', labels={'revenue': 'Revenue ($)', 'month': 'Month'}) fig.for_each_annotation(lambda a: a.update(text=a.text.split("=")[-1]))

# ── 3D scatter ──────────────────────────────────────── fig = px.scatter_3d(df, x='sessions', y='conversion_rate', z='revenue', color='region', opacity=0.7, title='3D Revenue Analysis') fig.show() ```

6Dash Interactive Dashboard

python
from dash import Dash, html, dcc, Input, Output, callback
import plotly.express as px
import pandas as pd

df = pd.read_csv('sales.csv')

app = Dash(__name__)

app.layout = html.Div([ html.H1("Sales Dashboard", style={"fontFamily": "sans-serif"}),

html.Div([ dcc.Dropdown( id='region-filter', options=[{'label': r, 'value': r} for r in df['region'].unique()], value=None, placeholder='Filter by region...', clearable=True ), dcc.DatePickerRange( id='date-range', start_date=df['date'].min(), end_date=df['date'].max() ), ], style={'display': 'flex', 'gap': '16px', 'marginBottom': '24px'}),

dcc.Graph(id='revenue-chart'), dcc.Graph(id='category-pie'), ])

@callback( Output('revenue-chart', 'figure'), Output('category-pie', 'figure'), Input('region-filter', 'value'), Input('date-range', 'start_date'), Input('date-range', 'end_date') ) def update_charts(region, start, end): filtered = df.copy() if region: filtered = filtered[filtered['region'] == region] filtered = filtered[ (filtered['date'] >= start) & (filtered['date'] <= end) ]

line_fig = px.line( filtered.groupby('date')['revenue'].sum().reset_index(), x='date', y='revenue', title='Revenue Over Time' ) pie_fig = px.pie( filtered.groupby('category')['revenue'].sum().reset_index(), values='revenue', names='category', title='Revenue by Category' ) return line_fig, pie_fig

if __name__ == '__main__': app.run(debug=True) ```

Explore the Full Portfolio

This is the complete portfolio of Sufi Khan Sulaiman, a technology leader specialising in B2B commerce and digital automation. Start from the Home page for the overview, then move through two decades of career experience across FLIR Systems, Lorex Technology, and 1c Platform, and the full catalogue of project case studies spanning headless commerce migrations, AI recommendation engines, and multi-channel fulfilment systems.

The skills and certifications page maps the technical and leadership capabilities behind the work, while the articles and the knowledge base break down the thinking into actionable frameworks. For hands-on learning, the tutorials and applications sections cover practical builds from front-end fundamentals to full-stack web apps.

For consulting engagement, the expertise page outlines service offerings, the ecommerce hub covers platform architecture and automation strategy, and the ecommerce guide (PDF) is a downloadable 55-page field manual. When you are ready to talk, the contact page is the direct line.