[Python] How to select the appropriate chart according to the variable dimension?

How to select the appropriate chart according to the number of data variables?

This article will share how to select charts and scientifically display data when the data contains 2, 3, 4, or greater than or equal to 5 variables!

Most of the graphic codes in this article have been shared before, if necessary, you can look them up, some of the pictures in this article are from network intrusion and deletion!

More than or equal to 5 variables

How to display data with more than or equal to 5 variables in one graph?

Option 1, custom graphics
Try to create a visual graph by yourself, for example, when studying the related factors of “life index”, customize the flower-shaped visual pattern, b83271dbabd7d60e9c508281700cc230.pngEach “petal” corresponds to an influencing factor variable (such as housing, income, employment, etc.), and the color will change proportionally according to the value in each variable.

Scheme 2, radar chart
Radar charts are often used to show which variables have similar values or if there are outliers in each variable. Each variable on this type of chart has an axis, and a polygon is drawn along all axes. Because radar charts use a polar grid, they are less intuitive for comparing values across variables than charts that use a Cartesian coordinate system. 5dc0857ae1c95ba4fd20ace7d4013eee.png

Scheme 3, parallel coordinate diagram
Parallel coordinates plots are great for comparing multiple variables at once and showing relationships between variables. In a parallel coordinates plot, each variable is assigned to an axis and its values are plotted as a series of lines connecting all axes. For example, you can compare the specifications of different computer or car models (compare specifications across a range of products). 03be22b0bad30cf56bbd3044af482802.png

Scheme 4, Facebook Map

The face graph presents multivariate data in the form of a face, which is very interesting. It uses the specific characteristics of the face (the shape, size, position, and orientation of the eyes, ears, mouth, and nose) to reflect the numerical value of the data. It is widely believed that humans can easily recognize faces and detect small changes easily. However, the validity of Facebooks is often questioned and criticized.

88b719ce20f6a7fe3ea2d2f8e807d33a.png

4 variables

How to display data of 4 variables in one graph?

Scheme 1, ternary bubble phase diagram

Create a ternary bubble plot of four variables by varying the size of the data point area. 2248f6bab95dc869ff1bf9037ed71039.png

Scheme 2, ternary contour phase diagram

Another way to add a fourth variable to a ternary phase diagram is to use a contour plot. 06a863baf363fb65d021179aa4e6bdd9.png

Scheme 3, color shadow bubble chart

Bubble charts can color the bubbles according to the scale of the values of the fourth variable. 831222ce99eefe4d96d03bb092436ce4.png

3 variables

How to display data of 3 variables in one graph?

Scheme 1, contour map

A contour plot is used to show a two-dimensional graph of the relationship between three numeric variables. Among them, the X-axis and Y-axis are used to draw two variables, and the third variable uses the Z-axis to draw contour lines. Contour levels are drawn as curved lines, and the area between them can be color-coded to indicate interpolated values. c57e4a50f603f9334262494b2cc9fa09.png

Scheme 2, Correlation Matrix

Show the third variable in the correlation matrix by coloring the circles proportionally.

22102461e2ff955914fb5bc962689371.png

Scheme 3, ternary phase diagram

A ternary phase diagram is a triangular diagram used to plot data with three variables where the sum of the three variables is held constant. This visualization is done by placing a point along the three axes (using barycentric coordinates) to represent the proportional relationship between these three variables. c6d840091c3968d74ab8a496bb235c9a.png

Scheme 4, bubble chart

The function is exactly the same as the scatter plot, but a third variable is added, that is, the size of the “bubble” is changed according to the proportion of the third variable. ef68a1805d166dacb07a098cd846c871.png

2 variables

How to display data of 3 variables in one graph?

Scheme 1, scatterplot and its 6 variants When a large number of data points are displayed in a scatterplot in a graph, a large number of scatterplots will overlap. Here are 6 solutions:

6 schemes to crack the overlap of big data scatter plots!

4adcc196dae39e40339217e806e36f0a.png

Scheme 2, connect scatter plot

A connected scatterplot shows the relationship between two variables over time. Like a scatterplot, each axis is a scale for a variable, but the points represent locations in time, and each point is connected by a line to show evolution. c30b40660229871b5a05ca8f283f4dc9.png

Scheme 3, Correlation Matrix

A matrix showing the correlation coefficients between a set of variables, wherethe strength of the correlation between two variables is indicated by the area size of the circles within the cells where they intersect. d464d74791a69a74bd1dbd429aace741.png

Scheme 4, heat map

Similar to a correlation matrix, a heatmap visualizes the correlation coefficients between a set of variables. Unlike a correlation matrix, a heatmap colors table cells according to the numerical strength between two variables. e0050bc5d223d45d08efffa38682a3bc.pngrefalog: https://datavizcat .com/blog/selecting-a-chart-based-on-the-number-of-variables/

-END-


7910bacea74678d5b665e68485d9aadc.jpeg





Excellent Review of Past Issues




Suitable for beginners to get started with artificial intelligence routes and data downloads (graphics + videos) machine learning introductory series download machine learning and deep learning notes and other materials print "Statistical Learning Methods" code reproduction album machine learning exchange qq group 955171419, join WeChat Group please scan code