# Smart Plot

## :question:What It Can Do for You

&#x20; Smart Plot is the key feature of HEARTCOUNT where typical code-heavy visualization tasks can be executed easily and come in handy. To visualize data in a way you want to examine it, all you have to do is to simply select which variable goes x-axis and which goes to y-axis and choose the type of visualizations you wish to use.

<figure><img src="/files/C7KuJwsmT0lO1tAJJ1KX" alt=""><figcaption></figcaption></figure>

&#x20; Smart Plot provides a variety of visualizations of your data, which include such below.

<table><thead><tr><th width="333">Data Type</th><th>Available Visualization</th></tr></thead><tbody><tr><td>Between numeric and other numeric</td><td>Scatterplot</td></tr><tr><td></td><td>Trend Line(regression line)</td></tr><tr><td></td><td>Heat Scatter</td></tr><tr><td>Between categorical and numeric</td><td>Bar (average or sum)</td></tr><tr><td></td><td>Stacked Bar</td></tr><tr><td></td><td>Stacked Area</td></tr><tr><td></td><td>95% confidence interval</td></tr><tr><td></td><td>Boxplot</td></tr><tr><td>Between categorical and categorical</td><td>Ratio Bar Chart</td></tr><tr><td></td><td>Stacked Count Bar</td></tr><tr><td>Between time series and numeric</td><td>Time Series Line Chart</td></tr><tr><td></td><td>Stacked Area</td></tr><tr><td></td><td>Trend Line</td></tr><tr><td></td><td>Forecast</td></tr></tbody></table>

## :page\_with\_curl:How to Use

### - Basics&#x20;

&#x20; Smart Plot consists of four key sections. You can easily create a suitable visualization of your dataset using these sections without writing a single line of code.

<figure><img src="/files/SflQMsTEDNxxLLsiiUEl" alt=""><figcaption></figcaption></figure>

<table><thead><tr><th width="215">Area</th><th>What's It For</th></tr></thead><tbody><tr><td>1. Main Area</td><td>This is where a plot will be displayed. You will be able to interact with plot elements such as data points in a scatterplot to further investigate the dataset to find an answer to your analytic inquiries.</td></tr><tr><td>2. Side Menu</td><td>This is where you may configure Smart Plot's parameters, such as which variables to use to change the colors or sizes of data points, or to filter the data. Also, you could choose </td></tr><tr><td>3. Variable Selection</td><td>This is where you can choose which variable to create a plot suitable for your analytic purpose. As with creating a data visualization in a code-heavy setting(R/Python), you must choose which variables you would place in the x and y axes and which to use for subgrouping or faceting.</td></tr><tr><td>4. Visualization Type</td><td>This is where you can choose which type of visualization you would use to plot the data. Given the variables for the x and y axes, the Visualization Type tab will provide you several options you could choose from to correctly visualize your data.</td></tr></tbody></table>

### - Types of Visualizations

&#x20; This section will discuss the many sorts of visualizations possible in relation to the specified x and y axes variables.

{% tabs %}
{% tab title="Two Numeric Variables" %}
&#x20; When you put numeric variables on both axes, a simple scatterplot will be displayed on Smart Plot. Also, a Pearson correlation coefficient will be given as a basic information on these two variables.

<figure><img src="/files/6UJZnJfKos5FdoBBddhk" alt=""><figcaption></figcaption></figure>

<details>

<summary>See in Detail</summary>

* There are two available types of additional visualizations for the scatterplot.&#x20;

  * You may choose to display a **trend line** <img src="/files/ovQu3Pjk4VlC9kaifBaY" alt="" data-size="line">, which is basically a regression line. It displays how the x and y variables are linearly correlated.

    <figure><img src="/files/F1rG09t6MWlr2DJBUNyE" alt=""><figcaption></figcaption></figure>

    * On the left of the trend line icon lies a number. It is a Pearson correlation coefficient that  shows how much those variables are linearly correlated.&#x20;
      * Pearson correlation coefficients are on or between −1 and +1.
        * If it equals to zero, it means they are not linearly correlated at all.
        * If it equals to plus one, it means they are strongly positively correlated.
        * If it equals to minus one, it means they are strongly negatively correlated.
    * If you drag to select some data points of interest, it will show you the linear relationship of only **the selected data**.

    <figure><img src="/files/rVZvDhlTceGJpVqos5Pv" alt=""><figcaption></figcaption></figure>

  * The other available option is **heatmap**<img src="/files/DZuUmQ0TIgaDWr4JuLKG" alt="" data-size="line"> (often known as heatscatter).

    * This visualizes around which area data points cluster together the most.

    <figure><img src="/files/fnpVm7hT4NME48h1DUVI" alt=""><figcaption></figcaption></figure>

    * The gradient color scale will change in accordance with the color settings on right top of HEARTCOUNT.\ <img src="/files/qitCmc1IJBcZFOZZxDM4" alt="" data-size="original">

</details>
{% endtab %}

{% tab title="Category on X & Numeric on Y" %}
&#x20; There are two major ways to visualize the data when you put a categorical variable on x-axis and a numeric variable on y-axis. One is to visualize individual data points and the other is to create subgroups based on the categorical variable on the x-axis.<br>

<figure><img src="/files/hzmI18NmkdkmpOLzfp9k" alt=""><figcaption></figcaption></figure>

<details>

<summary>Individual Data Point Visualization</summary>

* **Scatterplot**\
  : This is equivalent to a scatterplot for the scatterplot with two numeric variables, but data points are aligned in accordance with the given x-axis.<br>

  <figure><img src="/files/8HLqIPImkHtzZcubZCOG" alt=""><figcaption></figcaption></figure>

* <img src="/files/1TKgBS2374kjJZcFluPz" alt="" data-size="line">**95% Confidence Interval**\
  : This shows 95% confidence interval for each group of a category variable on x-axis. A box placed upon the data points of a group represents the confidence interval of a sample mean for the group. When you click the box, you will be shown another box that is long and horizontal that you can use to compare with other groups' confidence interval boxes. You can imagine conducting an eye-level two-sample t-test.

  <figure><img src="/files/lfMCTAs0AUbjCYt6KfAl" alt=""><figcaption></figcaption></figure>

* <img src="/files/r2ZgLP46tHiaa8oPBJTw" alt="" data-size="line">**Distribution**\
  : This is one of the two ways to visualize how data points are distributed across y-axis by each group of a categorical variable on x-axis. Length of a line represents the number of data points lying upon the line.

  <figure><img src="/files/ORapvVTDVgsGPnPzcCSm" alt=""><figcaption></figcaption></figure>

* <img src="/files/G8GVbXZHjRj9SWXrY0li" alt="" data-size="line">**Heatmap**\
  : Heatmap, just as <img src="/files/r2ZgLP46tHiaa8oPBJTw" alt="" data-size="line">Distribution does, represents the distribution of data points but with gradient colors. Note that you can change the color scale with the color scale icon <img src="/files/4gqKS5jPGokIxRVZywNJ" alt="" data-size="line"> on top right of HEARTCOUNT.

  <figure><img src="/files/VZFInmvzmIxH8Max4AlA" alt=""><figcaption></figcaption></figure>

<br>

</details>

<details>

<summary>Grouped Data Point Visualization</summary>

* You may create subgroups based on the categorical variable on the x-axis by using subgroup tab. After so, Smart Plot will provide a set of available options for grouped data point visualization.

  <figure><img src="/files/W2BugtrBMCPQbmsV3u0f" alt=""><figcaption></figcaption></figure>

* There are five metrics you may choose to put on a y-axis.
  * Average of a numeric variable
  * Sum of a numeric variable
  * Record count: how many records are in each group
  * Global ratio: how much proportion each group takes within the given dataset
  * Local ratio: how much proportion each subgroup takes within the each group. This is useful when you divide each group into another subgroup.

* Here are the list of available visualization options.<br>
  * <img src="/files/8EozOFoKs1AA7jJNBEyQ" alt="" data-size="line">**Bar chart**\
    : This is a simple bar chart where heights are proportional to the given metric on a Y-axis.<br>

    <figure><img src="/files/8GksHEAumMOxqpmhwCJS" alt=""><figcaption></figcaption></figure>

    * You may use other variable to create subgroups within each group instead of grouping the entire group. Each bar on the x-axis will be divided into multiple subgroup bars.<br>

      <figure><img src="/files/hzmI18NmkdkmpOLzfp9k" alt=""><figcaption></figcaption></figure>

      <br>
  * <img src="/files/V3nUJUGob4XpJizqlRJn" alt="" data-size="line">**Stacked Bar Chart**\
    : Another way to use the subgroup feature is with a stacked bar chart. Each bar on the x-axis will be divided into multiple subgroup bars, and the subgroup bars will be stacked so that the original bar can be better understood.

    <figure><img src="/files/YE7Xq4DMf1wV5yJZ6rYD" alt=""><figcaption></figcaption></figure>

    <br>
  * <img src="/files/uNMVCYggVFbxByt7GXFM" alt="" data-size="line">**Stacked Area Chart**\
    : A stacked area chart is similar to the stacked bar chart, except that subgroup bars are connected together so that the levels/values of each subgroup vary over the given x-axis variable can be better understood. Below is displayed how easily local ratio of subgroups within each category can be calculated.

    <figure><img src="/files/HbDRj071yKZ2jAaSDUb9" alt=""><figcaption></figcaption></figure>

    <br>
  * <img src="/files/8p7fjoY0CINUKjJWDwYf" alt="" data-size="line">**Line Chart**\
    **:** This is a traditional line chart where seasonal patterns and trends can be explored if your dataset contains a temporal(time, date, etc) variable.

    <figure><img src="/files/Th0lSmWf9OpcX3dW0tGQ" alt=""><figcaption></figcaption></figure>

</details>
{% endtab %}

{% tab title="Time Series on X & Numeric on Y" %}
&#x20; You also can put a time-series variable on x-axis. <br>

<figure><img src="/files/vDgXRmdgpFtBi9V3olXU" alt=""><figcaption></figcaption></figure>

<details>

<summary>See in Detail</summary>

* If your dataset contains a time series variable, you can map it on the x-axis. Smart Plot will then display a line chart.<br>

  <figure><img src="/files/g7SygmBEN8JzDA4Lt6ui" alt=""><figcaption></figcaption></figure>

* Smart Plot will generate a monthly time interval for you. To switch to a different time interval, such as weekly or yearly, use the small clock-like icon<img src="/files/z0Oqfc4YNjpUMaoS9XEX" alt="" data-size="line">next to the x-axis tab.<br>

  <figure><img src="/files/vDgXRmdgpFtBi9V3olXU" alt=""><figcaption></figcaption></figure>

* You can use automatically derived time series variables such as days of week, day type(weekdays or weekend), or so to create a plot. This will enhance your understanding of the relationship between the time series variable and others.

  <figure><img src="/files/YMRRnKQ0eX48TlN6we03" alt=""><figcaption></figcaption></figure>

* You can check how the variable on the y-axis has evolved over the x-axis by using the trend line feature<img src="/files/CIyQXKNvGDaVUtB2C1fw" alt="" data-size="line">.<br>

  <figure><img src="/files/MblKDUC9tl5474o96qWA" alt=""><figcaption></figcaption></figure>

* Smart Plot also supports two simple forecasting models<img src="/files/OZ2HMauvw5wqMwiwYVnZ" alt="" data-size="line">, namely the max entropy model and the least square method.

  <figure><img src="/files/IjmvBsPMOVyfhGS177Sa" alt=""><figcaption></figcaption></figure>

</details>
{% endtab %}
{% endtabs %}

### - Additional Features

#### **Facetting**

&#x20; Smart Plot offers a facet feature. It allows you to divide a single plot into multiple charts based on a facet variable in order to better understand the relationship between the x and y variables. You can also use every other feature in Smart Plot within each facet plot.&#x20;

<figure><img src="/files/v1ub7Xbma8gJ3KZWnwl5" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Categorical variables with fewer than 11 groups can currently be used as a facet variable.
{% endhint %}

{% hint style="info" %}
To get free access to HEARTCOUNT Public, [Click Here](https://www.heartcount.io/login?lang=en)
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://public.heartcount.io/visual-discovery/smart-plot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
