100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Programming

Plotting with Plots.jl

How to create, customize, arrange, and export visualizations in Julia using Plots.jl's unified plotting interface and swappable backends.

Performance & PackagesBeginner8 min readJul 10, 2026
Analogies

Plots.jl and the Backend System

Plots.jl is not itself a rendering engine — it is a unified, consistent plotting API that delegates the actual drawing work to a swappable 'backend' package, most commonly GR (the fast default, good for large datasets and quick iteration), PyPlot (a wrapper around Python's matplotlib), or PlotlyJS (interactive, browser-based plots with zoom and hover tooltips). You select a backend by calling its activation function once, such as gr() or plotlyjs(), after which every subsequent plot() call in your session uses that backend, meaning the same plotting code can produce a fast static PNG one day and an interactive HTML chart the next simply by switching the active backend.

🏏

Cricket analogy: A commentary team that can broadcast the exact same match feed through either a fast radio call or a slower, richly produced television package uses different 'backends' for the same underlying event — Plots.jl's gr() versus plotlyjs() is that same choice of delivery mechanism for identical plotting code.

Basic Plotting Commands

The core function is plot(x, y; kwargs...), which creates a new figure, while plot!(x, y; kwargs...) — note the bang — mutates the current figure in place by adding a new series to it rather than starting a fresh plot, a convention Julia uses consistently for any function that modifies its argument. Related shorthand functions like scatter(), bar(), histogram(), and heatmap() call plot() internally with seriestype set appropriately, and any of them accepts common attributes as keyword arguments such as label, xlabel, ylabel, title, linewidth, and color, which apply uniformly across every backend even though the backends render them differently under the hood.

🏏

Cricket analogy: Starting a fresh scorecard for a new innings is like plot(), while adding another batter's partnership onto the same existing scorecard rather than starting over is exactly what plot!() does — the bang signals 'add to what's already there'.

julia
using Plots
gr()  # activate the GR backend (fast, static rendering)

x = 0:0.1:2π
y1 = sin.(x)
y2 = cos.(x)

plot(x, y1, label="sin(x)", xlabel="x", ylabel="y", title="Trig Functions", linewidth=2, color=:blue)
plot!(x, y2, label="cos(x)", linewidth=2, color=:red, linestyle=:dash)  # adds to the same figure

scatter(x[1:10:end], y1[1:10:end], label="sampled points", markersize=6)

Customizing Plots with Attributes

Plots.jl exposes a large, consistent attribute vocabulary — legend=:topright, xlims=(0, 10), yscale=:log10, seriestype=:bar, and dozens more — that works identically regardless of which backend renders the figure, so learning the attribute names once transfers across every backend you might switch to later. Attributes can be set globally for the whole session with default(fontfamily="Computer Modern", linewidth=2), per-plot by passing them to plot(), or per-series when using plot!() to layer multiple series with different styling onto the same axes, giving fine control without needing backend-specific code anywhere in your script.

🏏

Cricket analogy: A cricket board setting a standard pitch report format used identically at every stadium in the league, whether played in Mumbai or Chennai, mirrors Plots.jl's attribute vocabulary working identically no matter which backend renders the final chart.

Because plot!() mutates the currently active figure, calling it after switching contexts (e.g., inside a loop where you meant to create a new plot each iteration) can silently keep layering series onto an old figure. If you want a fresh figure each time, call plot() (no bang) explicitly, or store figure handles in variables — e.g., p = plot(x, y) then plot!(p, x2, y2) — to be unambiguous about which figure you're modifying.

Layouts and Subplots

Multiple subplots are arranged in a single figure using the layout keyword, either as a simple grid like layout=(2,2) for a 2-row, 2-column arrangement, or via the more expressive @layout macro for irregular grids, such as @layout [a{0.3h}; b c] which creates one wide panel on top and two narrower panels below with a specific height ratio. Each individual subplot in the grid can be targeted for further customization with plot!(p, subplot=i, ...), and this layout system composes naturally with the same plot()/plot!() and attribute vocabulary used for single-panel figures, so nothing new needs to be learned beyond the layout specification itself.

🏏

Cricket analogy: A stadium's giant screen split into a 2x2 grid showing the main match feed, a replay angle, the scorecard, and player stats simultaneously mirrors layout=(2,2) arranging four subplots in one figure, each independently customizable.

julia
using Plots
gr()

p1 = plot(sin, 0, 2π, title="sin")
p2 = plot(cos, 0, 2π, title="cos")
p3 = histogram(randn(1000), title="Normal samples")
p4 = scatter(rand(50), rand(50), title="Random scatter")

# Simple 2x2 grid
plot(p1, p2, p3, p4, layout=(2, 2), legend=false)

# Irregular layout: one wide panel on top, two below
l = @layout [a{0.3h}; b c]
plot(p1, p2, p3, layout=l)

savefig("my_dashboard.png")
savefig("my_dashboard.pdf")   # vector format, good for print/publication

Saving and Exporting Plots

Any figure can be written to disk with savefig("filename.ext"), and Plots.jl infers the output format entirely from the file extension — .png and .svg work with essentially every backend, .pdf gives a scalable vector format well suited for print or publication, and interactive backends like PlotlyJS can export standalone .html files that retain zoom and hover interactivity even when opened outside of Julia. For high-resolution raster output intended for print or presentation slides, passing dpi=300 to plot() (or setting it via the size and dpi keyword combination) avoids the blurry, pixelated look that a default-resolution PNG produces when scaled up.

🏏

Cricket analogy: A broadcaster exporting the day's highlights as a quick low-res clip for social media versus a full broadcast-quality master for the archive is choosing an export format the same way savefig()'s extension choice determines a plot's output quality and interactivity.

Interactive exploration tip: activate plotlyjs() while working in a Jupyter notebook or Pluto.jl to get zoomable, hoverable charts during analysis, then switch to gr() before generating final static figures for a paper or report — the exact same plotting code works unchanged with either backend.

  • Plots.jl is a unified plotting API; the actual rendering is delegated to a swappable backend like GR, PyPlot, or PlotlyJS, activated with gr(), pyplot(), or plotlyjs().
  • plot() creates a new figure; plot!() (with a bang) mutates the current figure by adding a new series — Julia's standard convention for in-place mutation.
  • scatter(), bar(), histogram(), and similar functions are shorthands that call plot() with an appropriate seriestype.
  • A consistent attribute vocabulary (label, xlabel, legend, yscale, linewidth, color, etc.) works identically across every backend.
  • layout=(rows, cols) or the @layout macro arranges multiple subplots in one figure, including irregular, proportionally-sized panels.
  • savefig("file.ext") infers the output format from the file extension; use dpi=300 for print-quality raster output.
  • PlotlyJS exports standalone interactive .html files that retain zoom and hover functionality outside of Julia.

Practice what you learned

Was this page helpful?

Topics covered

#Programming#JuliaStudyNotes#PlottingWithPlotsJl#Plotting#Plots#Backend#System#StudyNotes#SkillVeris#ExamPrep

Frequently Asked Questions

21 categories · pick one to explore

Where can I get free study notes for programming and tech subjects?
SkillVeris offers completely free study notes covering programming and tech subjects, with no signup fees or paywalls. The notes are structured by course and topic, written for quick understanding, and enriched with the Learn Through Hobbies analogy method, so you can revise concepts through cricket, music, gaming, cooking and more.
Are SkillVeris study notes good for exam revision?
Yes, the study notes are designed for efficient revision: each topic answers its heading immediately, keeps explanations concise, and links to related glossary terms and cheat sheets. Students preparing for university exams or certification tests use them as quick revision notes because they distil concepts without the padding of full textbooks.
What subjects do the free study notes cover?
The study notes span the platform's main domains, including AI and machine learning, Python and programming, web development, DevOps, cloud, security and databases. Coverage mirrors the 37 live courses, so notes exist for the topics you are actually studying, and new note sets are added as courses launch.
How are SkillVeris study notes different from regular textbooks?
The notes are answer-first, concise and free, whereas textbooks are long and often expensive. Each section explains one concept directly, then reinforces it through selectable hobby analogies like cricket or cooking. Notes also cross-link to the glossary, blog and cheat sheets, letting you jump to related material instantly instead of flipping pages.
Can I use the developer study material without creating an account?
The study notes are free to access, and SkillVeris does not charge anything for its developer study material at any point. Browsing notes is straightforward from the Study Notes section, and if you want progress tracking, certificates and AI Mentor conversations tied to your learning, a free account unlocks those extras.
Do the study notes explain concepts with analogies?
Yes, this is a signature SkillVeris feature. Study notes use the Learn Through Hobbies method, explaining technical concepts through analogies from twelve domains including cricket, music, gaming, photography, travel, movies, fitness, chess, cooking, finance, business and sports. You can switch the analogy domain instantly to whichever hobby makes the concept click.
Are the revision notes suitable for last-minute exam preparation?
Yes, revision notes on SkillVeris work well for last-minute preparation because every section states the answer in its first sentences, so skimming is genuinely effective. Pair them with the relevant cheat sheet for formulas and syntax, and use the glossary for any unfamiliar term you meet while cramming.
Is there free study material for AI and machine learning?
Yes, SkillVeris provides free study notes across its AI and ML catalogue, covering Python for AI, deep learning frameworks like PyTorch and TensorFlow, Hugging Face Transformers, Large Language Models, RAG, AI agents and MLOps. All of it is free, making it a strong resource for Indian students and global learners alike.
Can beginners understand the study notes, or are they for experts?
Beginners can absolutely use them. The notes are written in plain language, define terms as they appear, and lean on hobby analogies to make abstract ideas concrete. Difficulty scales with the underlying course level, so beginner-course notes stay gentle while advanced-course notes go deeper, and the glossary supports you throughout.
How do study notes connect with SkillVeris courses?
Study notes are organised by course and topic, so they map directly to the structured courses and their 24–40-lesson curriculum. Many learners study a lesson first, then use the matching notes for revision before module assessments and the final exam, where 80 percent is required to pass and earn the certificate.
Are there study notes for Python specifically?
Yes, Python is well covered through notes tied to the Python-focused courses, including Python for AI and ML. Topics span fundamentals through applied machine learning usage. You can reinforce the notes with Python practice in Code Lab, which runs code in your browser with no installation required.
Do the study notes include code examples?
Yes, study notes include code examples wherever a concept is best shown in code, alongside explanations, key points and analogies. Reading a snippet in the notes and then reproducing it yourself in Code Lab is an effective loop, since Code Lab lets you run code in the browser across six languages.
How often is new study material added to SkillVeris?
Study material grows alongside the course catalogue. Whenever new courses join the platform's 37 live courses, matching study notes, glossary entries and cheat sheets are added so the resources stay in sync. Existing notes are also refined over time, so it is worth revisiting topics you studied earlier.
Can I use SkillVeris notes to prepare for technical interviews?
Yes, the notes make excellent interview revision because they compress each concept into direct, answer-first explanations, which mirrors how you should answer interview questions. Combine them with the SkillVeris interview questions feature, which includes readiness scoring, to test whether your revision has actually made you interview-ready.
Are the study notes mobile-friendly for studying on the go?
Yes, the study notes are built to load fast and read comfortably on mobile devices, so you can revise during a commute or between classes. Sections are short and answer-first, which suits small screens, and analogy switching works on mobile too, letting you study anywhere without carrying books.
What is the difference between study notes and cheat sheets?
Study notes explain concepts in depth with context, examples and analogies, making them ideal for learning and revision. Cheat sheets are compact quick-reference summaries of syntax, commands and key facts, ideal once you already understand a topic. Most learners study the notes first, then keep the cheat sheet handy while coding.
Do study notes help if I am stuck on a course lesson?
Yes, reading the matching study notes often clarifies a lesson because the same concept is explained from a different angle, frequently with a different analogy. If you are still stuck, ask the AI Mentor, which answers 24/7 at Quick, Detailed or Deep-dive depth until the idea genuinely makes sense.
Is there free study material for DevOps and cloud topics?
Yes, SkillVeris carries free study notes for DevOps and cloud topics as part of its coverage across 37 live courses. The material suits learners following the DevOps Engineer or Cloud Engineer paths, and it links to related glossary terms and cheat sheets so you can revise the whole toolchain in one place.
Can school or college students in India use these notes for projects?
Yes, students across India and worldwide use SkillVeris notes for coursework, projects and exam preparation, and everything is free, which matters for student budgets. The notes explain concepts clearly enough to cite in project reports, and Code Lab lets you prototype the project code directly in your browser.
How should I combine study notes with other SkillVeris resources?
A proven loop: learn from a course lesson, revise with the matching study notes, look up unfamiliar terms in the glossary, keep the cheat sheet open while practising in Code Lab, and quiz yourself with interview questions. The AI Mentor fills any remaining gaps 24/7, at whatever depth you need.

What Learners Say

Real journeys from the SkillVeris community — swipe for more.

SkillVeris taught me Python through Cricket. Now I’m building real projects and feeling confident!
Arjun S. · B.Tech Student
The best platform for hobby-based learning. Concepts finally stick.
Priya R. · Data Analyst
I went from zero coding to a portfolio of projects — all by learning through my love for gaming. Landed my first internship!
Kabir M. · CS Undergraduate
Trending Topics50 popular tags — tap to explore
Trending CoursesAll 37 free courses — tap to browse