Merge pull request #855 from mkborregaard/submodule-measure

Add submodule PlotMeasures (fix #821)
This commit is contained in:
Michael Krabbe Borregaard 2017-10-02 15:20:41 +02:00 committed by GitHub
commit 6bbb26d2ea
2 changed files with 6 additions and 0 deletions

View File

@ -133,11 +133,16 @@ ignorenan_extrema(x) = Base.extrema(x)
# --------------------------------------------------------- # ---------------------------------------------------------
module PlotMeasures
import Measures import Measures
import Measures: Length, AbsoluteLength, Measure, BoundingBox, mm, cm, inch, pt, width, height, w, h import Measures: Length, AbsoluteLength, Measure, BoundingBox, mm, cm, inch, pt, width, height, w, h
const BBox = Measures.Absolute2DBox const BBox = Measures.Absolute2DBox
export BBox, BoundingBox, mm, cm, inch, pt, px, pct, w, h export BBox, BoundingBox, mm, cm, inch, pt, px, pct, w, h
end
using .PlotMeasures
import .PlotMeasures: Length, AbsoluteLength, Measure, width, height
export BBox, BoundingBox
# --------------------------------------------------------- # ---------------------------------------------------------
include("types.jl") include("types.jl")

View File

@ -288,6 +288,7 @@ PlotExample("Heatmap, categorical axes, and aspect_ratio",
PlotExample("Layouts, margins, label rotation, title location", PlotExample("Layouts, margins, label rotation, title location",
"", "",
[:(begin [:(begin
using Plots.PlotMeasures # for Measures, e.g. mm and px
plot(rand(100,6),layout=@layout([a b; c]),title=["A" "B" "C"], plot(rand(100,6),layout=@layout([a b; c]),title=["A" "B" "C"],
title_location=:left, left_margin=[20mm 0mm], title_location=:left, left_margin=[20mm 0mm],
bottom_margin=10px, xrotation=60) bottom_margin=10px, xrotation=60)