Ratio
A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient.
Math for Web Design
A ratio is a mathematical comparison between quantities that expresses their relative sizes or how many times one contains another.
- How it is used
- Keeps media, layout, and typography proportional while translating pointer position into control values.
- How deep it goes
- Defines the comparison, demonstrates CSS ratios, and details slider normalization; defers Flexbox proportions.
- Examples
- Uses 16:9 video thumbnails, 3:2:1 grid columns, a 1.5 type scale, and photo-editor sliders.
- What you can do after
- Apply it via CSS aspect-ratio, Grid fractions, and custom properties to maintain media proportions and derive type sizes.
Starting Data Analytics with Generative AI and Python
A ratio is a quantitative comparison of two values expressed through their quotient or relative size.
- How it is used
- Uses normalized review shares to identify product groups with comparatively strong or weak customer satisfaction.
- How deep it goes
- Calculates group-level shares and visualizes them, but stops short of establishing causal explanations for the differences.
- Examples
- Uses positive and negative review counts, product groups, pandas aggregation, and a bar chart with a negative-ratio line.
- What you can do after
- Apply it via pandas to calculate review shares and compare them with raw counts in a visualization.
Read how Starting Data Analytics with Generative AI and Python explains ratio →
Data Storytelling with Altair and AI
A ratio is a quantitative comparison between two quantities obtained by division.
- How it is used
- Uses division-based comparisons to add context, normalize counts, and answer audience questions more accurately.
- How deep it goes
- Works through denominator choice, manual calculations, dataset joins, and chart encoding, without developing abstract ratio theory.
- Examples
- Compares cats’ and dogs’ participants-per-website rates and normalizes regional homelessness by population.
- What you can do after
- Apply it via pandas and Altair to calculate normalized rates and communicate comparisons through charts.
Read how Data Storytelling with Altair and AI explains ratio →
Also covered in
- Build Python Web Apps with Streamlit
- Grokking AI Algorithms, Second Edition
- Everyday Data Visualization
- Get Programming: Learn to code with Python
- Investing for Programmers
What to know first
- proportionA ratio expressing a quantity relative to a whole or reference quantity, commonly represented as a fraction, decimal, or percentage.
Related concepts
- Sharpe ratioincludes · The Sharpe ratio measures risk-adjusted investment return as excess return over the risk-free rate per unit of return volatility.
- aspect ratioincludes · An aspect ratio is the proportional relationship between the width and height of an object, image, or rectangular area.
- grouped bar chartcontrasts with · A grouped bar chart displays multiple bars together for each category, enabling comparisons across subcategories or related groups.
- modular scaleconfigures · A modular scale is a sequence of related sizes generated by applying a consistent ratio to establish typographic hierarchy.
- proportional layoutused by · A proportional layout assigns element dimensions or positions according to relative shares of available space.
Questions about ratio
What is ratio?
A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient.
Which Manning books explain ratio?
Math for Web Design, Starting Data Analytics with Generative AI and Python and Data Storytelling with Altair and AI.
What should I know before learning ratio?
Manning books that teach ratio usually introduce formula and proportion first.
What is the difference between ratio and grouped bar chart?
A ratio is a quantitative comparison of two quantities expressed through their relative sizes or quotient. A grouped bar chart displays multiple bars together for each category, enabling comparisons across subcategories or related groups.
What kinds of ratio are there?
Kinds of ratio include administrator-to-server ratio, Sharpe ratio and aspect ratio.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.


