begin
using Plots
import Plots: mm
default(dpi=500)
end
5.4 s
plt_axes
plt_axes = plot()
1.1 s
plot!(plt_axes,
xguide = "x axis guide (label)",
yguide = "y axis guide (label)",
lims = (0, 1),
ticks = 0:0.2:1,
minorticks = 2,
minorgrid = true)
243 ms
axis_annotations
axis_annotations = [
(0.2, 0.2, ("tick and tick label", :bottom, 10)),
(0.5, 0.1, ("minor tick", :bottom, 10)),
(0.75, 0.3, ("x axis border (spine)",
:bottom, 10)),
(0.15, 0.75, ("grid", :right, :bottom, 10)),
(0.55, 0.65, ("minor grid", :left, :bottom, 10))]
44.3 μs
plot!(plt_axes,
[0.2, 0.2, NaN, 0.5, 0.5, NaN, 0.75, 0.75, NaN,
0.15, 0.2, NaN, 0.55, 0.5],
[0.2, 0.02, NaN, 0.1, 0.02, NaN, 0.3, 0.02, NaN,
0.75, 0.6, NaN, 0.65, 0.5],
arrow = arrow(:closed),
color = :black,
legend = false,
annotations = axis_annotations)
1.8 s
x_values
0.0:0.25:1.0
x_values = 0:0.25:1
18.8 μs
plt_subplot
plt_subplot = scatter(x_values, x_values.^2,
zcolor = x_values, seriescolor = :grays,
title = "Title",
legendposition = (:topleft),
legend_title = "Legend title",
label = "label",
colorbar_title = "Color bar title",
leftmargin = 15mm,
annotation = (0.51, 0.26,
("annotation text", :bottom, :left, 10)))
1.4 s
subplot_annotations
subplot_annotations = [
(0.95, 0.08, ("plot area", :right, 10)),
(0.90, 0.71, ("color bar tick and label",
:right, 10)),
(0.55, 0.93, ("legend", :left, 10))]
24.7 μs
plot!(plt_subplot,
[0.9, 1.0, NaN, 0.55, 0.40],
[0.71, 0.71, NaN, 0.93, 0.93],
label = nothing,
arrow = arrow(:closed),
color = :black,
background_color_inside = :gray95,
annotations = subplot_annotations)
111 ms
subplot_a
subplot_a = plot(title = "Subplot title")
28.9 ms
subplot_b
subplot_b = plot(0:0.01:1, x -> x^2,
title = "Subplot title",
legend_position = :none)
316 ms
plt
plt = plot(subplot_a, subplot_b,
plot_title = "Plot title",
plot_titlevspan = 0.1,
background_color_inside = :gray95,
background_color = :gray85,
layout = grid(1, 2, widths=[0.3, 0.7]))
660 ms
lens!(plt, [0.0, 0.2], [0.0, 0.1],
background_color_inside = :gray95,
inset_subplots = (2,
bbox(0.25, 0.25, 0.35, 0.2)))
646 ms
plot_annotations
plot_annotations = [
(0.15, 0.9, ("bounding box", :bottom, 10)),
(0.5, 0.85, ("inset subplot", :left, 10))]
26.2 μs
plot!(plt[2],
[0.15, 0.23, NaN, 0.5, 0.4],
[0.90, 0.77, NaN, 0.85, 0.77],
label = nothing,
arrow = arrow(:closed),
color = :black,
annotations = plot_annotations)
313 ms