PlotSet LogoPlotSet

How to Create a Box Plot

A step by step walkthrough for turning a spreadsheet of raw observations into a published box plot in PlotSet, from shaping the rows to exporting or embedding the finished chart.

Cerca de 8 minutos

Raw rows in, ranked boxes out: that is how to create a box plot in PlotSet, ending with a published, interactive chart with outliers labelled on purpose and a caption that states what the whiskers mean. Not a demo with placeholder numbers: your own groups and your own observations, run through the same click path a real PlotSet chart takes from upload to publish.

If your spreadsheet already has one row per observation, a group label and a number, this takes about eight minutes. Add ten more if your source is a report someone already summarized into averages or quartiles: you will need to go back for the underlying rows, because a box plot built from a summary is not a box plot, it is a shape drawn to look like one.

Os dados que você precisa

One row per observation, not per group: a group label in the first column, a single number in the second. No pre-calculated quartiles, medians or five-number summaries. PlotSet computes those from the raw rows, so feeding it a summary skips the part that makes the chart honest.

CSV de exemplo
WarehouseDeliveryDays
Chicago2
Chicago3
Chicago2
Chicago4
Chicago3
Chicago9
Denver4
Denver5
Denver4
Denver6
Denver5
Denver4
Atlanta3
Atlanta3
Atlanta4
Atlanta3
Atlanta11
Atlanta4
Anotações

Do not upload a table of quartiles or medians as if it were your data. PlotSet needs the individual observations to compute the five-number summary itself; handing it a summary of a summary produces a median that is wrong more often than it is right.

Keep group labels spelled and capitalized the same way across every row. "Chicago" and "chicago " with a trailing space read as two different groups and split into two boxes.

Give each group enough rows to mean something. A box built from three or four values implies a precision the data does not have; aim for at least ten observations per group where you can.

Extra columns beyond the group and value pair are ignored, so it is fine to keep a date or an ID column in the sheet for your own reference.

Os passos

O caminho exato no PlotSet, de um modelo em branco até o gráfico finalizado.

  1. 01

    Open the box plot template

    From the PlotSet dashboard, start a new project and choose the Box Plot template (vertical by default, with a horizontal version available for long group names). It loads with sample data already in place, so you can see the raw, one-row-per-observation shape PlotSet expects before you touch your own file.

    O seletor de modelos do PlotSet: as categorias de gráficos listadas à esquerda, a grade Bar Charts aberta e o card do modelo Bar Chart mostrando o botão Select.
    Todo guia começa aqui. Escolha a categoria e depois o modelo: a grade é a mesma, seja qual for o tipo de gráfico que você quer.
  2. 02

    Shape your sheet into raw rows

    Put the group label in the first column and one numeric value in the second, one row per observation. If your source is a pivot table that already shows averages or quartiles per group, go back to the underlying data: that is the input this chart needs, not the summary someone else built from it.

  3. 03

    Import your file or connect a sheet

    Use the data panel to import a CSV or .xlsx file, paste rows directly from a spreadsheet, or connect a Google Sheet if you want the chart to refresh when new observations come in. PlotSet reads the first row as headers automatically.

    A visualização de dados do editor do PlotSet: uma planilha com as colunas Name, Value e Region preenchidas com números de províncias canadenses, ao lado do painel Data, que oferece envio de CSV, Magic Import e sincronização com o Google Sheet.
    A visualização de dados, aqui em um projeto de gráfico de barras. Envie um CSV, extraia os números de uma imagem com o Magic Import ou sincronize um Google Sheet. O painel é idêntico para todos os tipos de gráfico.
  4. 04

    Map the group and value columns

    Confirm which column feeds the group axis and which one holds the numeric value PlotSet will summarize into quartiles. This is usually correct on its own when your headers are clear, so check it manually only if your sheet carries extra columns that could confuse the guess.

    O painel Data do PlotSet com os vínculos de colunas em destaque: Label/time apontando para a coluna A, Values para a coluna B e Filter/color para a coluna C, com o botão Auto Binding logo abaixo.
    Os vínculos definem qual coluna vira o rótulo, qual fornece os valores e qual comanda a cor. O Auto Binding tenta adivinhá-los a partir dos seus cabeçalhos, então confira o resultado em vez de dar como certo.
  5. 05

    Sort the boxes by median

    Switch the default sort away from alphabetical and order the groups by median instead, ascending or descending depending on the story. Once the boxes are ordered by median, the comparison you built the chart for is visible without the reader having to scan for it.

  6. 06

    Decide what to do with the outliers

    Leave the individual points beyond the whiskers turned on and label the ones worth naming. If a group is carrying more outliers than the rest, that is usually a finding, not noise to switch off before anyone notices it.

    O editor do PlotSet na aba Preview: um gráfico do tipo Box Plot já finalizado na área de edição e, na lateral direita, o painel de configurações contornado em vermelho.
    A aba Preview de um gráfico do tipo Box Plot. Todos os controles de estilo ficam no painel contornado em vermelho: aparência, cabeçalho, rodapé e as opções específicas desse tipo de gráfico. Cada grupo fica em sua própria aba.
  7. 07

    Set the whisker rule and note it in a caption

    PlotSet's default draws whiskers to 1.5 times the interquartile range, which covers most cases. If you switch it to min and max instead, say so in a caption: the two conventions look the same on the chart and mean different things.

  8. 08

    Publish it, embed it, or export a file

    Publish for a live, interactive chart whose tooltip shows the full five-number summary on hover, grab the embed code to drop it into a page, or export a PNG, SVG or PDF if you need a static image for a deck or a report.

Comece pelo modelo de Box Plot com dados de exemplo já carregados, depois substitua-os pelos seus.

Abrir o modelo

Publique, incorpore ou exporte

A reta final é igual para todo tipo de gráfico: o Share transforma o gráfico em um link público interativo e em um código de incorporação; o Export gera um arquivo estático.

Share: link público e código de incorporação

Ativar o código de incorporação e o link público é o que publica o gráfico. O link pode ser enviado com segurança para qualquer pessoa, e o código de incorporação entra em qualquer página como um iframe que mantém a interatividade e os tooltips ao passar o mouse. Edite o gráfico depois e clique em Recreate para levar essas mudanças aos dois.

A barra de ferramentas do editor do PlotSet com o botão Share em destaque, ao lado do botão Export.
É pelo Share que um gráfico finalizado vira um link público e um código de incorporação.
A janela Share do PlotSet: a chave que ativa o código de incorporação e o link público, os botões Link, Embed, Facebook, Reddit, Twitter, LinkedIn e Email, e o link público do gráfico com um botão Copy.
Ative o código de incorporação e o link público, depois copie o link ou pegue o iframe. O Recreate leva as edições seguintes a todo mundo que já tem o link.

Export: SVG, PNG ou JPG

O Export grava uma cópia estática no tamanho que você precisar. O SVG continua nítido em qualquer escala e ainda pode ser editado em uma ferramenta de design; PNG e JPG são as escolhas seguras para slides e documentos. É o multiplicador de escala que garante uma imagem nítida em uma tela retina.

A barra de ferramentas do editor do PlotSet com o botão Export em destaque.
O Export é o caminho para gerar um arquivo estático para um slide ou um relatório.
A janela Export chart do PlotSet: um seletor de escala em 2x, campos de largura e altura definidos como 1000 por 600 e o menu de formatos aberto com SVG, PNG e JPG.
O SVG continua nítido em qualquer tamanho e editável em uma ferramenta de design; PNG e JPG são as escolhas seguras para uma apresentação. Defina a escala antes de exportar para que a imagem fique nítida em uma tela retina.

Dicas de estilo para um Box Plot

State the whisker rule in the caption

A box drawn to 1.5 times the IQR and one drawn to the minimum and maximum look identical but tell different stories about how extreme the outliers are. One sentence in the caption settles it for the reader instead of leaving them to guess.

Do not force the value axis to start at zero

Unlike a bar chart, a box plot is not encoding a length from a baseline, it is showing where a distribution sits. Forcing the axis to zero on a chart of, say, delivery days in the single digits just compresses every box into a sliver near the top.

Cap it around fifteen boxes on one axis

A handful of distributions read easily side by side; past roughly fifteen, the boxes get thin and the comparison stops working. Filter to the groups the story actually needs and mention in the caption that it is a subset.

Label outliers instead of deleting them

An outlier is usually the most informative point on the chart, not an error. Name the specific one that matters (a date, a location, an ID) rather than hiding it to make the chart look tidier.

Erros comuns ao fazer um Box Plot

Every box looks like a thin line instead of a box

This is what happens when the sheet holds pre-calculated quartiles or averages instead of raw observations. PlotSet needs the individual values to compute a five-number summary; go back to the source data and upload the actual rows, one per observation.

One box has a whisker stretched far past the others

Check the raw values for that group for a data entry slip, a value in the wrong unit, or simply too few rows. A group with four or five observations produces a box that reacts wildly to a single unusual value.

The boxes sit in alphabetical order, not ranked by median

This means the sort setting is still on its default. Open the sort control in the chart settings and switch it from group name to the median of the value column.

Saiba mais sobre o Box Plot

Não tem certeza se o Box Plot é a escolha certa? Veja o que é, quando usar e quando evitar.

Sobre o Box Plot

Box Plot: perguntas frequentes

Raw observations, not a summary: one row per data point, a group label in the first column and a single number in the second. PlotSet calculates the quartiles, median and outliers itself from those rows, so a table of pre-computed statistics will not work as the input.

Crie seu Box Plot agora

Grátis para começar com mais de 300 modelos. Sem cartão de crédito.