Plots.jl gives Julia one plotting syntax that can target several rendering backends. Install it with the package manager, start with the GR backend, and switch to PlotlyJS, PythonPlot, PGFPlotsX or UnicodePlots when your display, interactivity or publication workflow requires something different.
What Plots.jl is—and what it is not
Plots.jl is a high-level, backend-agnostic plotting API. Your Julia code describes data and plot attributes; a backend then renders the result for a window, notebook, terminal or file:
Julia data → Plots.jl command → backend → displayed or exported figure
The default installation uses GR, but the same plotting commands can target other renderers. This is syntax portability, not guaranteed visual or feature equivalence: an attribute supported by one backend may be ignored, approximated or unavailable in another. The backend documentation lists these differences.
#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
Plots.jl also has a recipe system. A package can define how a specialised data type should be plotted, so users can call the familiar API without learning a separate plotting language; the design is discussed in the Plots.jl recipe-system paper.
Install Plots.jl and make a first figure
In Julia’s REPL, VS Code, Pluto or Jupyter, run:
import Pkg
Pkg.add("Plots")
using Plots
GR is included and selected by default in a normal installation. The first plotting call can be slower than later calls while packages and backend resources initialise.
x = range(0, 10, length=100)
y = sin.(x)
plot(x, y)
The dot in sin.(x) broadcasts the function over every element. Calling sin(x) with an array or range instead is a common source of a method error. The current official tutorial is generated with Julia 1.12.6; avoid assuming that development-branch examples and stable documentation have identical configuration names.
Common chart types
Plots.jl provides concise functions for standard scientific and exploratory charts. The GR gallery demonstrates these and additional forms such as polar plots and annotations.
plot(x, y) # line (optionally with markers)
scatter(x, y) # points
bar(["A", "B", "C"], [12, 19, 7])
histogram(randn(1_000))
heatmap(rand(20, 20))
contour(x, x, [sin(a) * cos(b) for a in x, b in x])
surface(x, x, [sin(a) * cos(b) for a in x, b in x])
For a bar chart, categorical labels and values must have matching lengths. Heatmap, contour and surface inputs need dimensions that agree with the selected backend’s interpretation of the coordinate arrays. Dates, categorical values, missing and NaN are supported in many cases, but their handling can vary by backend.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
Build and customise a complete chart
using Plots
x = range(0, 2π, length=200)
y1 = sin.(x)
y2 = cos.(x)
plot(
x, y1;
label = "sin(x)",
linewidth = 2,
xlabel = "x",
ylabel = "value",
title = "Sine and cosine",
legend = :topright,
)
plot!(
x, y2;
label = "cos(x)",
linestyle = :dash,
)
labelsupplies a legend entry; uselabel=falseto suppress one.linewidth,linestyle, marker attributes and colours control appearance.xlabel,ylabelandtitleexplain the axes and subject.plot!modifies the current plot instead of creating a separate figure.
A semicolon before keyword arguments is idiomatic Julia syntax, not a Plots.jl requirement. Attributes are ultimately limited by the selected backend.
Add several data series
For equally sized series, a matrix is a compact option:
plot(x, [sin.(x) cos.(x)])
For explicit control over labels and the plot object, use:
Free tools Windows power users keep installed
One-click scans. No signup required.
p = plot(x, sin.(x), label="sin")
plot!(p, x, cos.(x), label="cos")
Check dimensions before plotting matrix data. A vector of vectors is not necessarily interpreted like a matrix, and automatic labels may not communicate which column is which. Supply labels whenever the chart will be shared or published.
Arrange subplots with a layout
p1 = plot(x, sin.(x), title="Sine", label=false)
p2 = plot(x, cos.(x), title="Cosine", label=false)
p3 = scatter(rand(25), title="Scatter", label=false)
p4 = histogram(randn(500), title="Distribution", label=false)
plot(p1, p2, p3, p4; layout=(2, 2), size=(900, 650))
layout=(2, 2) requests two rows and two columns. Titles and labels set while creating p1 through p4 belong to those subplots; attributes supplied in the final combination can apply globally, depending on the attribute and backend. Exact spacing and pixel composition are not identical across renderers.
Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Choose a rendering backend
| Backend | Use it for | Trade-off or requirement |
|---|---|---|
| GR (default) | General-purpose static scientific and exploratory plots | Less naturally interactive than browser-oriented backends |
| Plotly | Browser graphics with hover interaction | Different capability set from PlotlyJS |
| PlotlyJS | Richer interactive graphics, Jupyter and standalone HTML | Additional frontend resources and export considerations |
| PythonPlot | Matplotlib-oriented Python workflows from Julia | Introduces Python-side ecosystem considerations |
| PGFPlotsX | LaTeX-native publication figures | Requires a LaTeX installation |
| UnicodePlots | SSH, terminals and headless machines | Lower visual fidelity than graphical output |
Select a backend explicitly when reproducibility or environment support matters:
gr()
plotly()
plotlyjs()
import Pkg
Pkg.add("PythonPlot")
using Plots
pythonplot()
Pkg.add("PGFPlotsX")
pgfplotsx()
Pkg.add("UnicodePlots")
unicodeplots()
plotly() and plotlyjs() are separate choices. PlotlyJS’s Julia documentation covers interactive Jupyter output, standalone HTML and Dash.jl applications at plotly.com/julia/getting-started.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →Save PNG, SVG, PDF or HTML output
p = plot(x, sin.(x); size=(800, 500), dpi=150)
savefig(p, "figure.png")
savefig(p, "figure.svg")
savefig(p, "figure.pdf")
With a current plot, savefig("figure.png") is also supported. Formats are backend-dependent: GR commonly produces raster and vector files, while interactive Plotly workflows naturally deliver HTML. PlotlyJS documents PDF, HTML, JSON, PNG, SVG, JPEG and WebP extensions at its saving guide. Always open the actual exported file and check dimensions, fonts, clipping, transparency, annotations and whether output was rasterised.
Display in the REPL, VS Code, Jupyter or Pluto
- REPL: the configured display may open a window or show an inline representation.
- VS Code: a compatible backend can render in the plot pane; PythonPlot or Plotly may be useful when GR’s display is unsuitable.
- Jupyter/IJulia and Pluto: plots can render inline when the backend and frontend integration are available.
- Headless servers: export directly or use
unicodeplots()for terminal output.
If PlotlyJS installs but its graphics do not appear, rebuild its local resources:
import Pkg
Pkg.build("PlotlyJS")
This recovery step is documented by Plotly’s Julia guide.
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
Set defaults and themes
Prefer local attributes when a setting belongs to one figure:
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
plot(x, y;
size=(800, 500),
dpi=150,
legend=false,
framestyle=:box,
)
For persistent settings, the stable installation guide supports this in ~/.julia/config/startup.jl:
ENV["PLOTS_DEFAULT_BACKEND"] = "PlotlyJS"
PLOTS_DEFAULTS = Dict(
:markersize => 10,
:legend => false,
)
Development documentation at docs.juliaplots.org/dev/install contains newer PlotsBase-related examples; do not copy those names into a stable setup without checking the version you use.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Extensions for specialised data
Ordinary lines, scatter plots, bars and histograms do not require extensions. Add one when its recipes match your data:
import Pkg
Pkg.add("StatsPlots")
Pkg.add("GraphRecipes")
- StatsPlots.jl adds recipes aimed at statistical workflows.
- GraphRecipes.jl adds graph and network-oriented plotting recipes.
Troubleshoot common failures
No visible plot
- Confirm
using Plotscompleted without an error. - Select a known backend, for example
gr(). - Try exporting:
savefig("test.png"). A valid file separates rendering from frontend display problems. - On a terminal or headless host, try
unicodeplots(). - For PlotlyJS, run
Pkg.build("PlotlyJS").
A keyword has no effect
Enable warnings with warn_on_unsupported=true and consult the backend support table. A high-level keyword can be accepted while the renderer ignores or approximates it.
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
plot(x, y; warn_on_unsupported=true)
GR or LaTeX dependencies fail
Some Linux GR setups need system packages described through the official installation instructions. PGFPlotsX requires a working LaTeX installation; it is not a dependency-free route to PDF.
The export differs from the preview
Inspect the saved file rather than relying on the notebook image. Backend-specific fonts, margins, marker support, transparency and vector/raster decisions can change the result.
Plots.jl or Makie?
Plots.jl is a strong starting point when you want one concise API for common charts and the ability to change renderers. Makie is a separate, high-performance Julia visualisation ecosystem with packages such as GLMakie and CairoMakie. Consider Makie when you need complex layouts, reactive scenes or finer-grained composition and are willing to learn its different model. Neither package is universally faster or better; the choice depends on interactivity, layout control, output format and API preference.
Further reading and next steps
Begin with GR, make a complete plot, export it, then switch backends for the requirement that motivated the change. Keep the data dimensions explicit, label series deliberately and verify the exported artifact. The official tutorial is at docs.juliaplots.org/latest/tutorial, with backend details at docs.juliaplots.org/latest/backends.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

