Logo Plotly Interactive Guide

Plotly Interactive Guide

Cộng đồng
wentorai
plotly-interactive-guide

Hướng dẫn sử dụng Plotly.py để tạo hình ảnh trực quan khoa học tương tác trong Python

Tổng quan

Nhà phát hànhwentorai
Kho mãresearch-plugins
Tên kỹ năngplotly-interactive-guide
Sao
294
Bản fork
42
Tệp đi kèm
Chỉ có hướng dẫn
Giấy phépMIT
Liên kết
  • Hướng dẫn bằng Markdown

    Tệp SKILL.md được mô hình tải khi cần, nên chỉ tốn token khi có yêu cầu thực sự phù hợp.

  • Dùng được với mọi LLM

    Kỹ năng AI dùng hướng dẫn viết bằng Markdown thay vì mã dành riêng cho một nhà cung cấp, nên dùng được với GPT, Claude, Gemini, Grok hoặc mô hình cục bộ.

  • Hướng dẫn có đủ mọi thứ cần thiết

    Mọi thứ mô hình cần đều nằm trong hướng dẫn — không có tệp bổ sung cần đồng bộ.

  • Mã nguồn mở

    Được wentorai công bố trên GitHub. Hãy đọc các tệp nguồn trước khi cài đặt.

Cài đặt

Cài đặt kỹ năng AI Plotly Interactive Guide trong TypingMind để dùng với bất kỳ LLM nào, hoặc thêm vào một tác nhân AI khác có thể đọc SKILL.md.

1

Cài đặt trong TypingMind

TypingMind cài đặt kỹ năng trực tiếp từ thư mục GitHub — đọc SKILL.md, đóng gói các tệp tài nguyên và lưu kết quả trên máy.

  1. Mở ứng dụng và vào Plugin → Kỹ năng.
  2. Chọn "Cài đặt từ GitHub".
  3. Dán URL của thư mục kỹ năng được hiển thị bên dưới rồi xác nhận.
    https://github.com/wentorai/research-plugins/tree/main/skills/analysis/dataviz/plotly-interactive-guide
  4. Bật kỹ năng trong từng cuộc trò chuyện mà bạn muốn sử dụng kỹ năng đó.
Plugin → Kỹ năng → Thêm kỹ năng → Từ URL GitHub, sau đó dán URL thư mục và nhấn Tiếp tục.
2

Cài đặt trong tác nhân AI khác

Bất kỳ tác nhân AI nào đọc được định dạng Agent Skills đều có thể dùng kỹ năng này — hãy sao chép thư mục vào thư mục kỹ năng của tác nhân AI đó.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/wentorai/research-plugins.git /tmp/research-plugins
mkdir -p .claude/skills
cp -r /tmp/research-plugins/skills/analysis/dataviz/plotly-interactive-guide .claude/skills/plotly-interactive-guide
Khởi động lại Claude Code sau khi sao chép để ứng dụng nhận kỹ năng mới.

Sử dụng trong TypingMind

Bật Plotly Interactive Guide trong bất kỳ cuộc trò chuyện nào trên TypingMind, mô hình sẽ tự xử lý phần còn lại. Tên và mô tả của kỹ năng nằm trong prompt hệ thống. Ngay khi có yêu cầu phù hợp, mô hình tự tải toàn bộ hướng dẫn — bạn không cần gọi thủ công và kỹ năng không tốn token cho đến khi thực sự được dùng.

Mô hình tự nạp Plotly Interactive Guide ngay khi có yêu cầu phù hợp.

Dùng được với mọi mô hình AI

Kỹ năng AI là các hướng dẫn Markdown thuần túy, không phải mã dành riêng cho một nhà cung cấp, nên bạn có thể dùng Plotly Interactive Guide với cả những mô hình khác ngoài mô hình ban đầu. Chỉ cần cài đặt một lần trong TypingMind rồi dùng với GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama hoặc mô hình cục bộ do bạn tự chạy — tất cả đều dùng khóa API của riêng bạn.

  • Chỉ tải khi cần

    Prompt hệ thống chỉ chứa tên và mô tả. Hướng dẫn được tải khi có yêu cầu phù hợp đầu tiên, nên khi kỹ năng chưa được dùng, bạn không tốn token cho phần hướng dẫn.

  • Đổi mô hình ngay trong cuộc trò chuyện

    Vì kỹ năng là hướng dẫn chứ không phải mã, việc đổi mô hình không làm kỹ năng ngừng hoạt động — mô hình tiếp theo vẫn đọc cùng tệp SKILL.md.

Hướng dẫn của kỹ năng

Đây là nội dung SKILL.md mà mô hình tải. Hãy đọc trước khi cài đặt — kỹ năng là những hướng dẫn mà mô hình của bạn sẽ làm theo.

Plotly Interactive Visualization Guide

Overview

Plotly.py is a high-level, interactive graphing library for Python with over 18K stars on GitHub. Built on top of plotly.js (which itself uses D3.js and WebGL), Plotly enables researchers to create publication-quality interactive figures directly from Python code. The library integrates seamlessly with pandas DataFrames, NumPy arrays, and the broader scientific Python ecosystem.

What sets Plotly apart for academic researchers is its Plotly Express module, which provides a concise, high-level API for creating complex visualizations in a single function call. Researchers can go from a pandas DataFrame to a fully interactive figure in one line of code, then customize it further as needed. Every Plotly figure is inherently interactive, supporting hover tooltips, zoom, pan, and selection out of the box.

Plotly also offers Dash, a framework for building analytical web applications entirely in Python. This allows researchers to create interactive dashboards for exploring experimental data, sharing results with collaborators, or building supplementary interactive materials for publications without needing front-end development skills.

Plotly Express for Quick Research Figures

Plotly Express provides the fastest path from data to visualization. It works directly with pandas DataFrames and supports faceting, color mapping, animation, and trendlines.

Scatter Plot with Regression

python
import plotly.express as px
import pandas as pd
import numpy as np

# Simulated experimental data
np.random.seed(42)
df = pd.DataFrame({
    'concentration': np.random.uniform(0.1, 10, 200),
    'response': np.random.normal(0, 1, 200),
    'treatment': np.random.choice(['Drug A', 'Drug B', 'Control'], 200),
    'cell_line': np.random.choice(['HeLa', 'MCF7', 'A549'], 200)
})
df['response'] = df['concentration'] * 0.8 + df['response']

fig = px.scatter(
    df,
    x='concentration',
    y='response',
    color='treatment',
    facet_col='cell_line',
    trendline='ols',
    title='Dose-Response Across Cell Lines',
    labels={'concentration': 'Concentration (uM)', 'response': 'Normalized Response'},
    template='plotly_white'
)
fig.update_layout(font=dict(family='Arial', size=12))
fig.show()

Box Plot with Individual Data Points

python
fig = px.box(
    df,
    x='treatment',
    y='response',
    color='treatment',
    points='all',
    title='Treatment Response Distribution',
    template='plotly_white'
)
fig.update_traces(quartilemethod='linear')
fig.update_layout(showlegend=False)
fig.show()

Violin Plot for Distribution Comparison

python
fig = px.violin(
    df,
    x='treatment',
    y='response',
    color='treatment',
    box=True,
    points='outliers',
    title='Response Distribution by Treatment Group',
    template='plotly_white'
)
fig.show()

Graph Objects for Fine-Grained Control

For more customized figures, Plotly's graph_objects module provides full control over every visual element.

Error Bar Plot for Experimental Results

python
import plotly.graph_objects as go

groups = ['Control', 'Low Dose', 'Medium Dose', 'High Dose']
means = [1.0, 1.8, 3.2, 4.5]
sems = [0.15, 0.22, 0.31, 0.28]

fig = go.Figure()

fig.add_trace(go.Bar(
    x=groups,
    y=means,
    error_y=dict(type='data', array=sems, visible=True),
    marker_color=['#6B7280', '#3B82F6', '#3B82F6', '#3B82F6'],
    text=[f'{m:.2f}' for m in means],
    textposition='outside'
))

fig.update_layout(
    title='Treatment Effect on Biomarker Levels',
    yaxis_title='Relative Expression',
    xaxis_title='Treatment Group',
    template='plotly_white',
    font=dict(family='Arial', size=13),
    bargap=0.3,
    yaxis=dict(range=[0, max(means) * 1.3])
)

# Add significance brackets
fig.add_annotation(
    x=0.5, y=max(means) * 1.15,
    text='*** p < 0.001',
    showarrow=False,
    font=dict(size=12)
)

fig.show()

Heatmap for Correlation Analysis

python
import plotly.figure_factory as ff

# Compute correlation matrix
corr_matrix = df[['concentration', 'response']].corr()
variables = corr_matrix.columns.tolist()

fig = ff.create_annotated_heatmap(
    z=corr_matrix.values,
    x=variables,
    y=variables,
    colorscale='RdBu_r',
    zmin=-1, zmax=1,
    showscale=True
)

fig.update_layout(
    title='Variable Correlation Matrix',
    template='plotly_white',
    width=600, height=500
)
fig.show()

3D and Specialized Scientific Plots

3D Surface Plot for Response Surfaces

python
import plotly.graph_objects as go
import numpy as np

x = np.linspace(-3, 3, 50)
y = np.linspace(-3, 3, 50)
X, Y = np.meshgrid(x, y)
Z = np.sin(np.sqrt(X**2 + Y**2)) * np.exp(-0.1 * (X**2 + Y**2))

fig = go.Figure(data=[go.Surface(
    x=X, y=Y, z=Z,
    colorscale='Viridis',
    contours=dict(
        z=dict(show=True, usecolormap=True, project_z=True)
    )
)])

fig.update_layout(
    title='Response Surface Analysis',
    scene=dict(
        xaxis_title='Factor A',
        yaxis_title='Factor B',
        zaxis_title='Response'
    ),
    width=700, height=600
)
fig.show()

Animated Time-Series for Temporal Data

python
# Create animated scatter showing progression over experimental phases
fig = px.scatter(
    temporal_df,
    x='metric_a',
    y='metric_b',
    animation_frame='time_point',
    animation_group='sample_id',
    size='magnitude',
    color='cluster',
    hover_name='sample_id',
    title='Sample Trajectories Over Time',
    template='plotly_white',
    range_x=[0, 10],
    range_y=[0, 10]
)
fig.layout.updatemenus[0].buttons[0].args[1]['frame']['duration'] = 800
fig.show()

Exporting for Publications

Plotly provides multiple export options for journal-ready figures.

python
# Static export (requires kaleido)
fig.write_image('figure_1.pdf', width=800, height=500, scale=3)
fig.write_image('figure_1.svg', width=800, height=500)
fig.write_image('figure_1.png', width=800, height=500, scale=3)

# Interactive HTML for supplementary materials
fig.write_html('interactive_figure.html', include_plotlyjs='cdn')

# Save as JSON for reproducibility
fig.write_json('figure_data.json')

Dash for Interactive Research Dashboards

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

app = Dash(__name__)

app.layout = html.Div([
    html.H1('Experiment Data Explorer'),
    dcc.Dropdown(
        id='variable-select',
        options=[{'label': v, 'value': v} for v in variables],
        value=variables[0]
    ),
    dcc.Graph(id='main-plot')
])

@app.callback(Output('main-plot', 'figure'), Input('variable-select', 'value'))
def update_plot(selected_var):
    return px.histogram(df, x=selected_var, nbins=30, template='plotly_white')

if __name__ == '__main__':
    app.run(debug=True, port=8050)

References

Câu hỏi thường gặp

Kỹ năng AI Plotly Interactive Guide làm được gì?

Hướng dẫn sử dụng Plotly.py để tạo hình ảnh trực quan khoa học tương tác trong Python

Vì sao nên dùng Plotly Interactive Guide trên TypingMind?

Vì bạn chỉ cần cài một lần rồi dùng với bất kỳ mô hình nào. Plotly Interactive Guide là nội dung Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên cùng một kỹ năng có thể chạy trên GPT-5, Claude, Gemini, Grok hoặc mô hình trên thiết bị — và bạn có thể đổi mô hình ngay trong cuộc trò chuyện mà kỹ năng vẫn hoạt động. TypingMind dùng khóa API riêng của bạn, nên bạn thanh toán trực tiếp cho nhà cung cấp thay vì trả phí thuê bao theo suất người dùng, đồng thời kỹ năng và các cuộc trò chuyện vẫn nằm trong bộ lưu trữ của bạn.

Làm thế nào để cài Plotly Interactive Guide trong TypingMind?

Mở Plugin → Kỹ năng → Cài đặt từ GitHub trong TypingMind rồi dán https://github.com/wentorai/research-plugins/tree/main/skills/analysis/dataviz/plotly-interactive-guide. TypingMind đọc tệp SKILL.md rồi cài đặt kỹ năng để bạn có thể bật cho từng cuộc trò chuyện.

Những mô hình AI nào có thể dùng Plotly Interactive Guide?

Bất kỳ mô hình nào bạn kết nối trong TypingMind. Kỹ năng AI là các hướng dẫn bằng Markdown chứ không phải mã dành riêng cho từng nhà cung cấp, nên GPT, Claude, Gemini, Grok và các mô hình chạy trên thiết bị đều có thể tải kỹ năng này khi có yêu cầu phù hợp.

Có thể dùng Plotly Interactive Guide với bao nhiêu mô hình AI?

Bao nhiêu cũng được. Miễn là mô hình hỗ trợ kỹ năng, bạn có thể dùng Plotly Interactive Guide với mô hình đó — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama và nhiều mô hình khác — tất cả đều trên TypingMind với khóa API riêng của bạn.

Kỹ năng AI Plotly Interactive Guide có miễn phí không?

Có. Kỹ năng này được wentorai phát hành trên GitHub theo giấy phép MIT. Bạn chỉ trả tiền cho nhà cung cấp AI của mình theo số token đã dùng.

Kỹ năng AI là gì?

Kỹ năng AI là một gói hướng dẫn có thể tái sử dụng, chỉ cho mô hình AI cách thực hiện một tác vụ cụ thể. Kỹ năng tuân theo định dạng mở Agent Skills: một tệp SKILL.md chứa tên và mô tả, cùng các tập lệnh, mẫu hoặc tệp tham khảo mà mô hình có thể cần. Mô hình chỉ đọc hướng dẫn khi yêu cầu của bạn phù hợp với kỹ năng, nên kỹ năng đã cài đặt không phát sinh chi phí cho đến khi được sử dụng.

Kỹ năng AI khác gì với plugin hoặc máy chủ MCP?

Plugin hoặc máy chủ MCP cung cấp các công cụ mới mà mô hình có thể gọi. Khi mô hình gọi một công cụ, mã của công cụ đó chạy ở đâu đó và trả về kết quả. Còn kỹ năng AI cung cấp kiến thức và quy trình: cách tiếp cận tác vụ, các bước cần thực hiện và những tiêu chí mà kết quả cần đáp ứng. Kỹ năng chỉ là nội dung Markdown, nên không cần máy chủ, khóa API hay môi trường thực thi và hoạt động với mọi mô hình.

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇