A line plot uses Seaborn to show how two numeric columns relate by drawing line segments between plotted values. It is useful when the x-axis has an ordered meaning, such as days, dates, or temperatures. The `relplot` function selects this form with `kind='line'`. Categorical variables supplied through `hue` can produce separate colored lines, while `row` can separate crowded categories into individual plots. section 11.16 section 11.18
When creating a line plot, work through the data shape before interpreting the picture:
- Check that the DataFrame index is unique; reset it with `df.reset_index(drop=True)` when duplicate index values prevent Seaborn from plotting. section 11.16
- Choose x and y columns that answer the analytical question, such as day versus average trip distance or date versus minimum temperature. section 11.17 section 11.8
- Use `hue` to compare categories on shared axes, and use `row` when multiple lines make the combined chart difficult to read. section 11.16
- Decide whether confidence intervals help; pass `ci=None` when the display should show the lines without the surrounding intervals. section 11.18
Compare taxi distance by day and month
After extracting `year`, `month`, and `day` from pickup timestamps and retaining January and July 2020, plot daily trip distance with one line per month: `sns.relplot(x='day', y='trip_distance', kind='line', data=df, hue='month', ci=None)`. To plot daily trip counts instead, group by `month` and `day`, count a column, reset the index, and use the resulting count column as y. The same pattern extends to weather data: put dates on x, minimum temperatures on y, and cities in `hue`. section 11.18 section 11.8
sns.relplot(x='max_temp',
y='min_temp',
data=df,
hue='state', kind='line')
Inspect the compact Seaborn call that turns a relationship plot into a line plot and colors lines by state. section 11.16





