Many articles and guides on data visualisation focus on when to use certain charts and how to get the best answers from your data. A histogram for understanding data distributions, a scatter plot (crossplot in petrophysics) for analysing relationships, a heatmap for matrices. There is nothing wrong with that advice, however many of those articles overlook the situations where those charts are not the best choice.
All data visualisations and chart types make trade-offs when it comes to showing data. Some charts compress your data down to bins or several key numbers. For example, boxplots compress a data distribution into five numbers so you can easily compare twenty groups at a glance. The trouble begins when the thing your data needs to say is exactly the thing the chart compresses away.
Here, we will look at nine common data plots and one aspect where each one starts to fail. The examples have a geological and petrophysical flavour, but the same issues apply across engineering, data science and any discipline where data needs to be visualised.
1. Scatter Plots and Overplotting
Scatter plots (also known as crossplots in geoscience) are one of the most common charts in science and data analysis. They allow us to easily compare two variables without needing to calculate a summary statistic first.
For small or moderately sized datasets, they work extremely well. We can identify trends, groups of data, data gaps, outliers and changes in variance.
However, the problem begins when the number of points being displayed on these plots increases.
Once points start landing on top of one another, the scatter plot no longer shows every observation clearly. Instead, it starts to turn into a structureless blob with points around the edges only being easily identifiable.
A region containing 50 points may look almost identical to one containing 5,000 points. Dense areas become solid blocks, while clusters and secondary trends can become indistinguishable due tooverlapping markers.
Two scatter plots showing synthetic porosity and permeability data. The first contains 800 points and shows the underlying structure clearly. The second contains 60,000 points and has collapsed into a dense cloud.
This can be particularly dangerous because the resulting chart still looks valid. It has labelled axes, sensible markers and maybe even a fitted trend line. There is nothing obvious to tell the reader that a large amount of information is hidden.
Transparency and reducing point size can help, especially when the overlap is moderate. However, there comes a point where adjusting marker properties is no longer enough.
At that stage, alternatives such as hexbin plots, two-dimensional histograms, density contours or careful sampling may give a more honest view of the data.
20,000 points as a hexbin plot, which allows a secondary group of points to show through.
The important question here is not simply whether all the observations have been plotted, but rather whether the reader can still see where those observations are concentrated.
The way this deteriorates at scale, and the alternatives worth reaching for, are covered in more detail here -> What Your Scatter Plot Stops Showing You Once It Gets Crowded
2. Histograms and Bin Sensitivity
A histogram divides a continuous variable into multiple bins and counts how many observations fall into each one. It may seem like a straightforward process, but the resulting shape of the histogram will heavily depend on how those bins are chosen.
If you use too few bins then genuine features may be smoothed away. This could lead to the loss of information. For example, a bimodal distribution, which may represent two different rock types or experimental populations may appear as one broad peak.
If you use too many bins, the random variation starts to look like meaningful structure and the distribution becomes a noisy group of peaks and gaps.
The same synthetic bimodal porosity dataset shown using 6, 20 and 80 bins. The first appears to contain one broad population, the second reveals two populations, and the third produces a noisy comb-like pattern.
There is no universally correct number of bins. However, there are rules such as Sturges, Scott and Freedman-Diaconis that can provide useful starting points to decide an appropriate number of bins. But, they don’t remove the need to inspect the result. Different rules are based on different assumptions and may produce very different charts.
This means that bin choice should not be treated as a minor plotting setting as it can influence the conclusion we draw from the data.
A useful habit that I have got into is to inspect the histogram using several different bin widths.
Kernel density estimates can provide another view of the data distribution, although they can introduce their own decisions around bandwidth and smoothing parameters. The example below shows a combination of a KDE, histogram bins and key statistics.
A step-by-step walkthrough of taking a matplotlib histogram from its defaults to something more informative is here: From Default to Publication-Ready: Transforming Matplotlib Histograms | by Andy McDonald | Data Science Collective | Medium
3. Boxplots and Hidden Distributions
Boxplots are excellent for comparing distributions across several groups. I have covered these and their alternatives several times recently, and some of the issues that may be encountered whilst using them.
Boxplots display the median, the upper and lower quartiles, whiskers and any values identified as potential outliers. This compact summary makes it possible to compare ten or twenty groups without filling the figure with individual observations.
However, the compression of that data into a succinct summary comes at a cost.
Very different distributions can produce similar boxplots. A normal distribution, a uniform distribution and a bimodal distribution can all share approximately the same median and interquartile range.
When shown as boxplots, they look very similar to each other.
Three similar boxplots shown beside their underlying observations. The raw data reveals normal, bimodal and uniform distributions.
This matters because the missing structure may be scientifically important.
A bimodal distribution often suggests that two populations have been combined. In a petrophysical dataset, this could mean that two facies or depositional settings are being treated as one group. In another discipline, it might indicate two experimental regimes or two different responses within a population.
The boxplot can’t show this because it wasn’t originally designed to describe the detailed shape of a distribution. This doesn’t mean that we should ignore them or drop them entirely from our toolkit. They remain useful when our primary goal is to compare medians, spreads and potential outliers across many groups.
The problem, and some practical alternatives, are covered in more detail here: Boxplots Are Hiding Your Data. Here’s a Simple Fix
However, problems can come up when we interpret them as complete descriptions of the underlying data.
There are a number of alternatives that can be used to reveal more about the data distribution including violin plots, strip plots and raincloud plots Another simple option is to overlay the individual data points on top of the boxplot, particularly when the sample size is manageable. However, my favourite recently is the raincloud plot that can be seen below.
You can find out how to create raincloud plots in several easy steps here: From Boxplot to Raincloud: Building a Better Distribution Plot in Python
4. Heatmaps and Information Overload
Heatmaps are often used to display a large number of values within a compact space and be visually appealing to look at. Essentially, they work well when the grid is reasonably small and the colour scale has a clear meaning. A correlation matrix containing eight variables, for example, can be easy to inspect, however, if that matrix were to grow to 100 variables, then readability breaks down.
A heatmap containing dozens of rows and columns may technically display every value, but that does not mean the information can be interpreted. Individual cells become too small, labels can become crowded and difficult to read, and subtle differences in colour can become difficult to distinguish.
A 40 by 28 annotated heatmap where the labels overlap and individual values are difficult to interpret.
At this point, the heatmap becomes a block of patchwork coloured boxes rather than a useful chart. The deeper problem is often that the heatmap has been created without a specific question in mind. Displaying every sample against every feature may feel like it is serving a purpose, but it is left to the reader to work out what they are supposed to notice.
Sorting or clustering the rows and columns can reveal structure and reducing the number of variables may also help. In some cases, a focused heatmap showing only the most important features communicates far more than the complete matrix.
The colour scale also matters. If we choose a poorly suited colourscale , the we could inadvertently exaggerate small differences or hide important ones. Diverging colour maps should normally be centred on a meaningful reference value, such as zero in a correlation matrix.
A heatmap should also help answer a question. In the example below, we are trying to answer the questions “What wells have complete logging sets and what curves are missing and where”. When the plot tries to display everything at once, it often answers nothing particularly well.

Interested in creating your own interactive heatmap with Plotly? If so, check out How to Visualise Missing Data with an Interactive Plotly Heatmap
5. Pie Charts and Too Many Categories
Pie charts show how a total is divided between categories. With three or four clearly different categories, they can provide a quick impression of the overall composition. Problems begin when the number of categories increases or when several slices are similar in size.
They are are a love it or hate it type of plot. If you search up pie chart problems on Google, you will find hundreds of articles pointing to the same problems. Some with very strong views on when not to use the plot.
Humans are not particularly good at comparing angles or areas, and it becomes harder when trying to compare multiple copies of the pie chart to see what has changed. It is easy to identify the largest slice in a simple pie chart, but becomes much harder to decide whether one category represents 11 per cent and another represents 13 per cent.
Twelve similarly sized lithology categories shown as a pie chart and as a sorted horizontal bar chart.
The reader is then forced to move repeatedly between the chart and its legend, and similar colours become difficult to distinguish. If the pie slices are not ordered by size, then ranking the categories requires more effort than it should.
A sorted bar chart can be a better way to communicate the same values more clearly. The categories share a common baseline, making small differences much easier to compare. These can be further enhanced by including data labels to make it easier for the reader.
The pie chart does have one useful property in that it makes it visually clear that the categories form parts of a whole. However, that advantage is quickly lost when there are too many slices or when precise comparison between slices or multiple charts matters.
For a small number of distinct categories, a pie chart may be suitable. For most scientific or technical comparisons, particularly those involving several categories, a bar chart is usually easier to read.
6. Line Charts and Spaghetti Plots
A line chart is one of the clearest ways to show how a value changes across time, depth or another ordered axis.
One line is easy to follow and five lines may still be manageable. However, by the time eighteen lines are shown on the same axes, the chart has usually become a spaghetti plot.
Eighteen synthetic well production decline curves overlaid on the same axes, with a large legend and several intersecting lines.
The problem isn’t simply that the figure looks messy, but rather that the chart can no longer support many of the tasks we expect it to perform.
We may still be able to see the overall range of values or identify a major outlier. However, following an individual series becomes difficult. Lines cross, colours repeat and the legend becomes detached from the data.
Increasing the number of colours rarely solves the problem. It often produces a more colourful version of the same confusion.
The appropriate alternative to the mess of spaghetti depends on the question being asked of the data.
We can use small multiples to show each series in a separate panel while retaining a common scale. This makes it easier to inspect individual behaviour without losing comparability.
Another option is to highlight one or two important lines and display the remaining series in the background. This works well when the aim is to compare a selected well, experiment or model against the wider population. It is often used when comparing yearly temperatures to previous years.
Grouping and summarising the series may also help. A median line with an uncertainty band can communicate the overall behaviour when individual identities are not important.
A line chart containing many series is not always wrong and it may still be useful for showing an envelope or identifying extreme cases. It begins to fail when we expect the reader to follow every line individually.
7. Correlation Matrices and Non-Linear Relationships
Correlation matrices provide a neat and compact summary of the relationships between several variables.
In most cases, the values shown on the correlation matrix are Pearson correlation coefficients. Pearson’s correlation measures the strength of a linear relationship between two variables and ranges between -1.0 and +1.0, with a value close to 0 indicating no linear relationship.
Two variables can have a strong and predictable non-linear relationship while producing a Pearson correlation close to zero.
A correlation matrix showing a correlation near zero between X and Y, shown beside a scatter plot that reveals a clear quadratic relationship.
Looking at the matrix above alone, we might conclude that some of the variables are unrelated. The scatter plot on the other hand shows that Y is strongly determined by X, but the relationship is curved rather than linear.
This can cause problems during exploratory analysis and feature selection. A variable may be removed because its correlation with the target is weak, even though a non-linear model could make good use of it.
Spearman correlation can detect monotonic relationships, including some curved relationships, because it works with ranks rather than raw values. However, neither Pearson nor Spearman reliably captures a relationship such as a parabola.
Other approaches, including mutual information and distance-based measures, can identify broader forms of dependence. These methods also come with assumptions and limitations, so they should not be treated as automatic replacements.
The correlation matrix is useful for screening a set of variables, however it should be supported by other plots such as scatter plots.
8. PCA Plots and Interpretation
Principal Component Analysis (PCA) is often used to reduce a dataset containing many variables into two or three dimensions.
The resulting scatter plot of the Principal Components can reveal broad clusters, outliers and changes in structure, however, these plots are also easy to over-interpret.
The first issue that you may encounter is scaling. PCA identifies directions that explain the largest amount of variance within a given set of features. If the input features use very different numerical scales, the result may be dominated by the variables with the greatest variance.
For example, a gamma ray curve measured over a range of hundreds of API units may dominate a density curve varying between approximately 2 and 3 g/cc.
The same four synthetic well log curves projected using PCA before and after standardisation. The unscaled version is dominated by one feature, while the standardised version produces a different structure.
Applying standardisation to the features gives each variable a more comparable influence, but this is also a modelling decision. In some cases, the original scale may contain meaningful information, whereas in others, it simply reflects the units used for measurement.
The second issue is interpretation.
Principal Components are essentially weighted combinations of the original variables. They don’t have an inherent physical meaning, even when the resulting axes appear to separate familiar groups.
It may be tempting to assign a label of “Lithology” to PC1 and “Porosity influence” to PC2, unless it is supported by evidence and domain knowledge
Variance is also not the same as importance. A PC can explain a large proportion of the variation in the dataset whilst being unrelated to the prediction or scientific question we care about.
Finally, if we only look t a two-dimensional PCA plot we are only displaying part of the original feature space. Which may mean what appear to be nice data clusters or data overlaps may change when additional PCs are considered.
PCA plots are useful for orientation and gaining insight into the overall structure, as well as help identify unusual observations. They can become unreliable when we start treating the projected axes as measured physical properties.
9. Violin Plots and Sample Size
Violin plots combine a summary of the distribution with a kernel density estimate. Unlike boxplots, they show an estimated shape, which can reveal skewness, multiple peaks and differences in spread that would otherwise remain hidden.
However, the smooth shape of a violin plot can create a false sense of confidence in the data.
A Kernel Density Estimate (KDE) will produce a continuous curve even when it is based on only a small number of observations. A group containing nine samples can therefore produce a violin that looks just as smooth and complete as one containing five hundred.
Two violin plots with similar smooth shapes. One is based on 9 observations and the other on 500. Strip plots beside them reveal the difference in sample size.
With a small sample size much of the apparent structure is controlled by the bandwidth used by the density estimator. A narrow bandwidth may create several peaks, whilst a wider bandwidth may merge them into one broad shape.
The reader may also have no way to tell how much data sits behind the violin unless sample sizes are reported. Much in a similar way to boxplots.
This is where raw points become particularly useful. By overlying a strip plot or by using a raincloud plot the reader can see both the estimated distribution and the observations that produced it.
For large samples, showing every point may create overplotting, so a sampling strategy or alternative density representation may be needed. For small groups, however, there is usually little reason to hide the individual observations.
The Pattern Underneath
These nine plots fail in different ways, but the underlying problem is similar.
Each chart relies on assumptions about what matters.
A scatter plot assumes the points remain individually visible. A histogram assumes the selected bins provide a useful representation of the distribution. A correlation matrix assumes that a coefficient can describe the relationship we care about. A PCA plot assumes that variance is a useful direction in which to view the data.
The data plot continues to render even when those assumptions are broken.
That is what makes these failures easy to miss. A crowded scatter plot and an overfilled heatmap can all look clean and publication-ready. Nothing in the plotting library warns us that the chart is hiding an important part of the story. It is down to us, as the interpreter, to understand what each chart compresses in the data and how we can get the best from them.
Knowing what each chart compresses is the starting point. Getting the figure itself right before those trade-offs start to matter is the next step. Over on Substack I’ve covered six specific matplotlib changes that take a figure from functional defaults to something you’d put in a report: spine cleanup, intentional colour choices, appropriate axis scaling, gridlines that support rather than clutter, annotation, and export settings that don’t clip your labels.
Six Matplotlib Changes That Improve Your Figures for Reporting and Publication














