Quadratic Docs
Ask or search…
K
Comment on page

Visualize data

Glean insights from your data, visually.

Visualize your data

Create beautiful visualizations using our in-app Plotly support. Plotly support works just as you're used to in Python, displaying your chart straight to the spreadsheet.

Getting started

Building charts in Quadratic is centered around Python charting libraries, starting with Plotly. Building charts in Plotly is broken down into 3 simple steps:
  1. 1.
    Create your chart
  2. 2.
    Style your chart
  3. 3.
    Display the chart to the sheet
  4. 4.
    Resize & adjust
Quadratic does not support .show() When displaying your chart use fig, not fig.show(). Outlined in examples below.

Line charts

# import library
import plotly.express as px
# create figure
fig = px.line(df, x='col1', y='col2', title="Power generation")
# display figure to the spreadsheet
fig
Sample chart with some extra styling.

Bar charts

# bar chart using plotly express, can create with plotly graph objects as well
import plotly.express as px
# create figure with specified data, assumes DataFrame df with column names col1 and col2
fig = px.bar(df, x=df['col1'], y=df['col2'])
# display figure to spreadsheet
fig

Histograms

# import Plotly
import plotly.express as px
# create figure
fig = px.histogram(df, x = 'output')
# display to sheet
fig

Scatter plots

import plotly.express as px
fig = px.scatter(df, y="col1", x="col2", color="col3")
fig.update_traces(marker_size=10)
fig.update_layout(scattermode="group")
fig

Heatmaps

# import library
import plotly.express as px
# assumes 2d array Z
fig = px.imshow(Z, text_auto=True)
# display chart
fig

More chart types

For more chart types, explore the Plotly docs: https://plotly.com/python/

Styling

For more styling for Plotly charts: https://plotly.com/python/styling-plotly-express/
# some chart styling options to assist getting started
fig.update_layout(
xaxis=dict(
showline=True,
showgrid=False,
showticklabels=True,
linecolor='rgb(204, 204, 204)',
linewidth=2,
ticks='outside',
tickfont=dict(
family='Arial',
size=12,
color='rgb(82, 82, 82)',
),
),
yaxis=dict(
showgrid=False,
zeroline=False,
showline=False,
showticklabels=True,
),
autosize=False,
showlegend=False,
plot_bgcolor='white',
title='Historical power usage by month (1985-2018)'
)

Chart controls

Use Plotly chart controls to pan, zoom, download your plot as a PNG, and reset axes.
Use chart controls
Additionally, you can resize by dragging the edges of the chart.