begin
using Plots
import Plots: mm
default(dpi=500)
end
plt_axes = plot()
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)
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
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))]
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 )
0.0:0.25:1.0
x_values = 0:0.25:1
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)))
0.95
0.08
"plot area"
:right
10
0.9
0.71
"color bar tick and label"
:right
10
0.55
0.93
"legend"
:left
10
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))]
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 )
subplot_a = plot(title = "Subplot title")
subplot_b = plot(0:0.01:1, x -> x ^2,
title = "Subplot title",
legend_position = :none)
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]))
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)))
0.15
0.9
"bounding box"
:bottom
10
0.5
0.85
"inset subplot"
:left
10
plot_annotations = [
(0.15, 0.9, ("bounding box", :bottom, 10)),
(0.5, 0.85, ("inset subplot", :left, 10))]
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 )