
Data visualization should be the most essential part of your data project because it is like the cover of your book; everyone looks at it first.
You must focus on the most critical key insights to make it perfect.
In this article, we’ll discover these techniques together. To do that, we’ll use Uber’s ‘partner business modeling’ data project to see how our data visualization techniques will change and how you create graphs.
Partner Business Modeling
We’ll work with the dataset from a recruitment assignment at Uber grade driver performance on a busy Saturday. This includes trip completions, acceptance rates, online hours, and driver ratings. Here is the link to this project.
Tip 1: Filter the Large Dataset
When you have a large dataset, visualizations can quickly become cluttered and difficult to interpret. Filtering the dataset to a manageable size lets you focus on the key information, making your visualizations more transparent and impactful.
- Unfiltered bar plot: The chart shows all drivers in the dataset, which results in overcrowded and unreadable labels due to the large number of drivers.
- Filtered bar plot: This version filters the top five drivers by the number of trips completed, offering a much clearer view of the data with rotated labels for better readability.
Here is the graph.

Here is the code.
import matplotlib.pyplot as plt
filtered_data = data.nlargest(5, 'Trips Completed')
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
# Left Graph
ax1.bar(data['Name'], data['Trips Completed'], color='blue')
ax1.set_title('Unfiltered Bar Chart of All Drivers and Completed Trips')
ax1.set_xlabel('Driver Name')
ax1.set_ylabel('Completed Trips')
ax1.tick_params(axis='x', rotation=90) # Rotate x labels for better readability
# Right Graph
ax2.bar(filtered_data['Name'], filtered_data['Trips Completed'], color='green')
ax2.set_title('Filtered Bar Chart of Selected Drivers and Completed Trips')
ax2.set_xlabel('Driver Name')
ax2.set_ylabel('Completed Trips')
ax2.set_xticks(range(len(filtered_data['Name'])))
ax2.set_xticklabels(filtered_data['Name'], rotation=45, ha='right')
plt.tight_layout()
plt.show()
Tip 2: Optimize Color Usage
Color is critical in data visualization. The right palette highlights insights, while too many colors confuse.
Best Practices for Color Usage
- Limit Colors: Fewer than 10 for categories.
- Use Contrast: Highlight essential data.
- Be Consistent: Keep colors uniform across charts.
- Check Accessibility: Use colorblind-friendly palettes.
Let’s see our example.
- Left: Monochrome pie chart, which is hard to differentiate into categories.
- Right: Colorful pie chart with clear distinctions between data points.
Here is the graph.

Here is the code.
import matplotlib.pyplot as plt
filtered_data = data.nlargest(5, 'Trips Completed')
trip_counts = filtered_data['Trips Completed']
driver_names = filtered_data['Name']
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
# Left Graph
colors_black_gray = ['black', 'dimgray', 'gray', 'darkgray', 'lightgray']
ax1.pie(trip_counts, labels=driver_names, colors=colors_black_gray, autopct='%1.1f%%')
ax1.set_title('Black & Gray Pie Chart (Ineffective)')
# Right Graph
colors = ['blue', 'orange', 'green', 'red', 'purple']
ax2.pie(trip_counts, labels=driver_names, colors=colors, autopct='%1.1f%%')
ax2.set_title('Optimized Color Pie Chart (Effective)')
plt.tight_layout()
plt.show()
Tip 3: Focus on Clarity
Data visualization should, above all else, be simple to interpret. Removing clutter & showing essential things at a glance makes it easier for the viewer to pay attention to the right highlights.
Here is a bar chart comparing driver ratings using two different datasets.
- Left: Chart that is too busy with gridlines and unnecessary elements, but the driver names are not rotated for comparison.
- Right: A visually uncomplicated graph that labels the bars with values shows the drivers’ names and color codes for reference.

Here is the code.
import matplotlib.pyplot as plt
filtered_data = data.nlargest(5, 'Trips Completed')
driver_names = filtered_data['Name']
ratings = filtered_data['Rating']
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
# Left Graph
ax1.bar(driver_names, ratings, color='blue')
ax1.set_title('Cluttered Bar Chart', fontsize=14)
ax1.set_xlabel('Driver Name')
ax1.set_ylabel('Rating')
ax1.grid(True) # Add gridlines
ax1.tick_params(axis='x', rotation=0)
# Right Graph
colors = ['blue', 'orange', 'green', 'red', 'purple']
bars = ax2.bar(driver_names, ratings, color=colors)
ax2.set_title('Clean Bar Chart with Values', fontsize=14)
ax2.set_xlabel('Driver Name')
ax2.set_ylabel('Rating')
ax2.grid(False)
ax2.tick_params(axis='x', rotation=45)
for bar in bars:
yval = bar.get_height()
ax2.text(bar.get_x() + bar.get_width()/2, yval + 0.02, round(yval, 2), ha='center', fontsize=12)
# Display both charts
plt.tight_layout()
plt.show()
Tip 4: Make the Scale Consistent
When showing data with large differences in value ranges, it is important to pick a scale that allows for fair and meaningful comparisons.
Using the raw vote counts on a chart can make it hard to see important information about the smaller values.
Best Practices for Consistent Scaling
- Use Relative Measures
- Ensure Consistency
- Avoid Obscuring Data
The example below compares the mock-up of the 2024 U.S. Presidential Election vote totals in the USA.
- Left (Raw Vote Counts): This helps compare big groups of people, but it doesn’t clearly show candidates with fewer votes, like Jill Stein and Chase Oliver.
- Right (Percentage of Total Vote): We can better see how much support each candidate got overall by turning the vote counts into percentages and sorting the chart in ascending order. This way, even candidates with fewer votes are shown.
Here is the graph.

Here is the code.
colors = ['orange', 'blue', 'purple', 'red']
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
# Left Graph
ax1.bar(candidates, votes, color='blue')
ax1.set_title('Raw Vote Counts (Ineffective)', fontsize=14)
ax1.set_xlabel('Candidates')
ax1.set_ylabel('Votes (in millions)')
ax1.yaxis.set_major_formatter(plt.FuncFormatter(lambda x, _: f'{int(x / 1e6)}M')) # Format y-axis to show millions
ax1.grid(True)
# Right Graph
bars = ax2.barh(sorted_candidates, sorted_percentages, color=colors)
ax2.set_title('Percentage of Total Vote (Effective)', fontsize=14)
ax2.set_xlabel('Percentage of Total Vote (%)')
ax2.set_ylabel('Candidates')
ax2.grid(True)
for bar,in bars:
width = bar.get_width()
ax2.text(width + 0.5, bar.get_y() + bar.get_height()/2, f'{width:.2f}%', va='center', fontsize=12)
plt.tight_layout()
plt.show()
Tip 5: Choose the Right Visualization Type
Picking the correct type of visualization is essential for showing your data correctly. Each chart type shows a different part of the data and can help you understand it better or make it more complicated.
Best Practices for Choosing the Right Chart
- Bar Charts: Bar charts are excellent for comparing groups.
- Line Charts: Line charts are the best way to show trends over time.
- Pie Charts: Pie charts help show parts of a whole.
- Scatter Plots: Spread plots are a great way to show how two numerical variables are related or correlated.
- Histograms: Histograms are great for showing how numbers are spread out.
Left(Scatter Plot): This graph shows how two variables are related, like the number of trips a driver has taken and the number of times they are accepted.
Right(Bar Chart): A bar chart is better for comparing performance across different categories, such as which drivers finished the most trips.

Here is the graph.
acceptance_rates = data['Accept Rate'].str.rstrip('%').astype(float)
trips_completed = data['Trips Completed']
top_5_drivers = data.nlargest(5, 'Trips Completed')
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(14, 6))
# Scatter Plot
ax1.scatter(trips_completed, acceptance_rates, color='purple')
ax1.set_title('Scatter Plot: Trips Completed vs Acceptance Rate', fontsize=14)
ax1.set_xlabel('Trips Completed')
ax1.set_ylabel('Acceptance Rate (%)')
ax1.grid(True)
# Bar Chart
ax2.bar(top_5_drivers['Name'], top_5_drivers['Trips Completed'], color='green')
ax2.set_title('Bar Chart: Top 5 Drivers by Trips Completed', fontsize=14)
ax2.set_xlabel('Driver')
ax2.set_ylabel('Trips Completed')
ax2.grid(False)
plt.tight_layout()
plt.show()
Conclusion
In this one, we have discovered five Data Visualization techniques to help you stand out with your data projects or findings.
To showcase what you have learned and create your portfolio projects, use real-life data projects companies like Uber have asked for, as we did in this article.
