Lens

Source code Author Update time

using Plots
gaston()

A lens lets you easily magnify a region of a plot. x and y coordinates refer to the to be magnified region and the via the inset keyword the subplot index and the bounding box (in relative coordinates) of the inset plot with the magnified plot can be specified. Additional attributes count for the inset plot.

plot([(0, 0), (0, 0.9), (1, 0.9), (2, 1), (3, 0.9), (80, 0)], legend = :outertopright, minorgrid = true, minorticks = 2)
plot!([(0, 0), (0, 0.9), (2, 0.9), (3, 1), (4, 0.9), (80, 0)])
plot!([(0, 0), (0, 0.9), (3, 0.9), (4, 1), (5, 0.9), (80, 0)])
plot!([(0, 0), (0, 0.9), (4, 0.9), (5, 1), (6, 0.9), (80, 0)])
lens!([1, 6], [0.9, 1.1], inset = (1, bbox(0.5, 0.0, 0.4, 0.4)))
Gnuplot Produced by GNUPLOT 5.4 patchlevel 2 0.90 0.95 1.00 1.05 1 2 3 4 5 6 gnuplot_plot_1a gnuplot_plot_2a gnuplot_plot_3a gnuplot_plot_4a 0.00 0.25 0.50 0.75 1.00 0 20 40 60 80 y1 y2 y3 y4 gnuplot_plot_5b gnuplot_plot_6b y1 y1 y2 y2 y3 y3 y4 y4 gnuplot_plot_5b gnuplot_plot_6b

This page was generated using DemoCards.jl and Literate.jl.