> For the complete documentation index, see [llms.txt](https://yunaeecy.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yunaeecy.gitbook.io/wiki/datavisualization/how-to-choose-plot-type.md).

# How to choose plot type

<figure><img src="https://206398537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fGxYFvZDLzWe4Z2ZOfR%2Fuploads%2FOJM4UKLG5P0MQZn54LCv%2FScreenshot%202023-10-21%20at%205.34.28%E2%80%AFpm.png?alt=media&amp;token=ed4e7fee-7728-4bdd-be05-1747b165e150" alt=""><figcaption></figcaption></figure>

<figure><img src="https://206398537-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F7fGxYFvZDLzWe4Z2ZOfR%2Fuploads%2FhUImHyqGpb8GL9whP4L8%2FYuna%20Sheng%20-%20Data%20Visualization.png?alt=media&amp;token=7b98dabe-24a6-46b2-9d00-a9f6d5f07273" alt=""><figcaption></figcaption></figure>

* **Trends** - A trend is defined as a pattern of change.
  * `sns.lineplot` - **Line charts** are best to show trends over a period of time, and multiple lines can be used to show trends in more than one group.
* **Relationship** - There are many different chart types that you can use to understand relationships between variables in your data.
  * `sns.barplot` - **Bar charts** are useful for comparing quantities corresponding to different groups.
  * `sns.heatmap` - **Heatmaps** can be used to find color-coded patterns in tables of numbers.
  * `sns.scatterplot` - **Scatter plots** show the relationship between two continuous variables; if color-coded, we can also show the relationship with a third [categorical variable](https://en.wikipedia.org/wiki/Categorical_variable).
  * `sns.regplot` - Including a **regression line** in the scatter plot makes it easier to see any linear relationship between two variables.
  * `sns.lmplot` - This command is useful for drawing multiple regression lines, if the scatter plot contains multiple, color-coded groups.
  * `sns.swarmplot` - **Categorical scatter plots** show the relationship between a continuous variable and a categorical variable.
* **Distribution** - We visualize distributions to show the possible values that we can expect to see in a variable, along with how likely they are.
  * `sns.histplot` - **Histograms** show the distribution of a single numerical variable.
  * `sns.kdeplot` - **KDE plots** (or **2D KDE plots**) show an estimated, smooth distribution of a single numerical variable (or two numerical variables).
  * `sns.jointplot` - This command is useful for simultaneously displaying a 2D KDE plot with the corresponding KDE plots for each individual variable.

credit:<https://www.kaggle.com/code/alexisbcook/choosing-plot-types-and-custom-styles>\ <br>
