Beginners Guide to Data Visualisation
How to Make Your First Line Chart, Bar Chart, and Pie Chart in Minutes
Staring at a spreadsheet full of numbers can be boring. Your brain isn’t great at seeing patterns in a grid of digits.
But show it a chart? Suddenly, everything clicks. A trend leaps out. A comparison becomes obvious.
You know what? Creating these visual revelations isn’t just for data scientists. It’s a skill anyone can learn, and you can get started in just minutes.
This guide will walk you through creating five essential charts. We’ll use Python’s Pandas library because it’s powerful and versatile, but the principles are universal. Let’s turn those numbers into stories.
Getting Set Up: Your Quick-Start Toolkit
Before we draw our first chart, we need our tools. If you don’t have Python installed, no problem! Use a free, zero-setup platform like Google Colab (just search for it, it runs in your browser).
We’ll be using two main libraries:
- Pandas: For handling our data in a nice, table-like structure (called a DataFrame).
- Matplotlib: The foundational plotting library for Python.
Here’s the code to get everything ready. Just run this in your first cell:
# Importing our essential toolkits
import pandas as pd
import matplotlib.pyplot as plt
# This magic command makes our charts display nicely in notebooks like Colab
%matplotlib inline
That’s it for setup. Now, let’s create some simple sample data to play with. Imagine we’re tracking the monthly sales for a small coffee shop.
# Creating a simple DataFrame
data = {
'Month': ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'],
'Sales': [2400, 3000, 2700, 3500, 4000, 3800],
'Expenses': [2200, 2400, 2500, 2600, 2800, 2750],
'Coffee_Type': ['Espresso', 'Latte', 'Drip', 'Latte', 'Espresso', 'Drip']
}
df = pd.DataFrame(data)
print(df)
Now we have our data. Let’s start visualizing.
Tutorial 1: The Line Chart - Tracking Trends Over Time
When to use it: A line chart is your best friend for showing how something changes over a continuous period—like months, days, or years. It perfectly answers the question, “What’s the trend?”
How to make it: We’ll plot our sales over the first six months of the year.
# Create a figure and axis
plt.figure(figsize=(10, 6))
# Plot the 'Sales' column against the 'Month' column
plt.plot(df['Month'], df['Sales'], marker='o', linewidth=2, label='Sales')
# Add a title and labels
plt.title('Monthly Sales Trend', fontsize=14, fontweight='bold')
plt.xlabel('Month')
plt.ylabel('Sales ($)')
# Add a legend and a grid for easier reading
plt.legend()
plt.grid(True, linestyle='--', alpha=0.7)
# Display the chart
plt.show()
What you’ll see: A clean, upward-trending line with dots on each month, clearly showing that sales grew from January to June, with a slight dip in March.
Tutorial 2: The Bar Chart - Comparing Categories Side-by-Side
When to use it: Use a bar chart when you want to compare quantities across different categories. It’s perfect for questions like, “How do these items compare?”
How to make it: Let’s compare Sales and Expenses for each month.
plt.figure(figsize=(10, 6))
# Setting the position of the bars on the x-axis
x_pos = range(len(df['Month']))
# Creating the bars
plt.bar(x_pos, df['Sales'], width=0.4, label='Sales', align='center')
plt.bar([x + 0.4 for x in x_pos], df['Expenses'], width=0.4, label='Expenses', align='center')
# Setting the x-axis ticks and labels
plt.xticks([x + 0.2 for x in x_pos], df['Month'])
plt.title('Sales vs. Expenses by Month')
plt.xlabel('Month')
plt.ylabel('Amount ($)')
plt.legend()
plt.grid(True, linestyle='--', alpha=0.7, axis='y') # Grid only on y-axis
plt.show()
What you’ll see: Two sets of bars for each month, allowing you to instantly compare Sales (the taller bar) to Expenses (the shorter bar) for every single period.
Tutorial 3: The Pie Chart - Showing Proportions of a Whole
When to use it: A pie chart shows how a total amount is divided into parts. It answers, “What is the breakdown?” Use it sparingly, and only when you have a small number of categories (ideally less than 6).
How to make it: Let’s see the sales breakdown by coffee type.
# First, we need to group our data by coffee type
coffee_sales = df.groupby('Coffee_Type')['Sales'].sum()
plt.figure(figsize=(8, 8))
# Create the pie chart
plt.pie(coffee_sales, labels=coffee_sales.index, autopct='%1.1f%%', startangle=90)
plt.title('Sales Breakdown by Coffee Type')
plt.show()
What you’ll see: A classic pie chart showing that, for example, Lattes make up the largest slice of your sales, followed by Espresso and Drip coffee.
Tutorial 4: The Scatter Plot - Revealing Relationships Between Variables
When to use it: This is your go-to chart for investigating a relationship. Does one thing go up when another does? “Is there a correlation?”
How to make it: Let’s see if there’s a relationship between Sales and Expenses.
plt.figure(figsize=(8, 6))
# Create a scatter plot: x-axis is Sales, y-axis is Expenses
plt.scatter(df['Sales'], df['Expenses'], s=100, alpha=0.7) # s=size, alpha=transparency
plt.title('Relationship Between Sales and Expenses')
plt.xlabel('Sales ($)')
plt.ylabel('Expenses ($)')
plt.grid(True, linestyle='--', alpha=0.7)
# Adding a trendline to make the relationship clearer
import numpy as np
z = np.polyfit(df['Sales'], df['Expenses'], 1)
p = np.poly1d(z)
plt.plot(df['Sales'], p(df['Sales']), "r--", alpha=0.8)
plt.show()
What you’ll see: A set of dots and a dashed trendline. If the trendline slopes upward, it suggests that as Sales increase, Expenses also tend to increase—a positive correlation.
Tutorial 5: The Histogram - Understanding the Distribution of Data
When to use it: A histogram shows how your data is distributed. It answers, “What is the most common value?” or “What is the range of my data?” It’s fantastic for understanding things like customer age ranges or typical order values.
How to make it: Let’s look at the distribution of our Sales amounts.
plt.figure(figsize=(8, 6))
# Create the histogram
plt.hist(df['Sales'], bins=5, edgecolor='black', alpha=0.7)
plt.title('Distribution of Monthly Sales')
plt.xlabel('Sales Amount ($)')
plt.ylabel('Frequency (Number of Months)')
plt.grid(True, linestyle='--', alpha=0.7, axis='y')
plt.show()
What you’ll see: A bar chart-like visualization where the x-axis is divided into “bins” (ranges of sales figures), and the height of each bar shows how many months had sales in that range. You can instantly see what a “typical” sales month looks like.
What if You Could Create Charts Instantly? An Introduction to Livedocs
Now, you’ve learned the fundamentals. This knowledge is powerful because it gives you complete control. But let’s say you’re in a hurry, or you’re working with colleagues who aren’t comfortable writing code. This is where modern tools are changing the game.
I took a look at Livedocs, and its approach to visualization is fascinating. Instead of writing code, you use a visual, interactive interface.
How to Create Charts Automatically with Livedocs:
The process is built on the same principles we’ve used, but it’s entirely driven by a user-friendly dashboard.
- Connect Your Data: You upload your CSV file or connect directly to a data source, just like we created our Pandas DataFrame.
- Select Your Chart Type: You choose from a gallery of chart types, Line, Bar, Pie, Scatter, and more.
- Drag and Drop to Build: This is the core of it. You simply drag your data columns (like ‘Month’, ‘Sales’) into the “X-Axis” and “Y-Axis” fields in the Livedocs interface.
- Customize and Iterate Instantly: Want to change a Bar Chart to a Line Chart? One click. Want to see Expenses instead of Sales? Drag the ‘Expenses’ column into the Y-Axis field. The chart updates in real-time.
Why would you use a tool like this?
The biggest advantage is sheer speed and accessibility. It turns the process of chart creation from a programming task into a conversational one. You can explore your data visually, testing different charts in seconds to find the one that tells the best story. It’s incredibly powerful for quick reports, team meetings, and for anyone who needs to create clear visualizations without the learning curve of code.
Final Thoughts
You’ve just learned how to build five of the most essential charts in data visualization. You have the code to do it from scratch, which is a fantastic skill. And you’ve seen how tools like Livedocs can automate the process for speed and collaboration.
The real power isn’t just in making a chart; it’s in choosing the right chart for the story your data is trying to tell. So, open up your notebook, load a dataset—any dataset—and try recreating these five charts. In minutes, you’ll stop seeing spreadsheets and start seeing stories.
The best, fastest agentic notebook 2026? Livedocs.
- 8x speed response
- Ask agent to find datasets for you
- Set system rules for agent
- Collaborate
- And more
Get started with Livedocs and build your first live notebook in minutes.
- 💬 If you have questions or feedback, please email directly at a[at]livedocs[dot]com
- 📣 Take Livedocs for a spin over at livedocs.com/start. Livedocs has a great free plan, with $5 per month of LLM usage on every plan
- 🤝 Say hello to the team on X and LinkedIn
Stay tuned for the next tutorial!