Search code examples
matplotlibbar-chartvisualizationline-plot

Concisely plotting lines and averages using Matplotlib


I have line plots that show the variations of several dependent variables as function of an independent variable and bar plots that show the average value of each of the dependent variables (see figure below). Due to some editorial constraints, I want to present this information in a compact yet clear and visually appealing way (preferably in one plot instead of two). Any ideas how to achieve this using Matplotlib?

enter image description here


Solution

  • You may display the averages as horizontal line in the first plot.

    enter image description here