From 54aaf5869d5b7925fc55a7df192ed31cf8d5d07f Mon Sep 17 00:00:00 2001 From: Simon Christ Date: Wed, 4 Mar 2020 15:20:00 +0100 Subject: [PATCH] add lens example --- src/examples.jl | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/examples.jl b/src/examples.jl index 9cf91a05..91dbf42d 100644 --- a/src/examples.jl +++ b/src/examples.jl @@ -311,6 +311,21 @@ const _examples = PlotExample[ ], ), PlotExample( + "Lens", + "A lens lets you easyli 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.", + [ + quote + begin + plot([(0, 0), (0, 0.9), (1, 0.9), (2, 1), (3, 0.9), (80, 0)]) + 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))) + end + end + ], + ), + * PlotExample( "Adding to subplots", """ Note here the automatic grid layout, as well as the order in which new series are added