Skip to main content
Public

Share visualization

Loading preview…

D3 Scatter Plot - Baseball

vizhub.com

Shared links may look like this on X, LinkedIn, Slack, and Discord.

Before sharing, review the publishing checklist.

Choose how to deliver this visualization

LinkedIn caption

LinkedIn may not keep text supplied by the share sheet. Copy the caption and paste it into the post if needed. You can tag the VizHub company page when posting.

More options

Embed on a websiteCopy iframe embed code
Download & exportPNG, HTML, source ZIP

D3 Scatter Plot - Baseball

1
PPatrick-Houlihan
Last edited Sep 16, 2021
Created on Sep 15, 2021
Forked from D3 Scatter Plot

This D3 scatter plot visualizes the relationship between pitches faced (PA) and hit-by-pitches (HBP) for MLB players from the 2017 Standard Hitting Dataset, aiming to identify players frequently hit despite limited at-bats. The SVG rendering uses d3.csv to load remote data, d3.scaleLinear for axes, and d3.axisLeft/axisBottom for ticks, with circle marks positioned by mapping PA and HBP values to pixel coordinates. The plot filters out players with fewer than 100 at-bats and covers the full browser window, using window.innerWidth and window.innerHeight for sizing.

AI-generated description

A vanilla HTML implementation of a D3 scatter plot. Shows the 2017 Standard Hitting Dataset.

This scatterplot shows the HBP stats and Pitches against of players. Identifying players that get hit more in fewer at bats is fun because I hypothesize they will see some benefit to OBP since a HBP is on base. It also shows controversial players or players teams just do not like by looking at leaders in HBP.

Comments

Sign in to join the discussion.

MIT Licensed