Closed hanlulong closed 6 years ago
Yes, you did. There is an example in the Gadfly guide gallery.
Also read the section on Keyword arguments in the Julia docs. The Float64[]
is a default value, not a type assertion.
Thanks. When I use [0.7w, 0.2h] or [0.18w,-0.315h], it gives me an error "w not found..."
ERROR: LoadError: UndefVarError: w not defined
I am working with Julia 0.6.4 and Gadfly v"0.8.0"
As shown in the gallery example, you need to start with using Compose
, Compose is a graphics package.
It works now. Thank you.
I have two more questions: a) Is there an option to limit the number of rows of legend entries? I would like to restrict my legend labels into one row. I see there is an option to limit the number of columns. I wonder if there is a way to restrict the number of rows.
b) Would it be possible to adjust the legend outside the plotting region? I would like to have something like: "Set of legend 1 Set of Legend 2" " Graph "
Thank you again for your help!
In the manual, it states that pos in Guide.shapekey can be defined as relative values, e.g., [0.7w, 0.2h]. However, from the way the function is written, it will only take absolute values, e.g., [0.7,0.2].
Did I miss anything? I have multiple legends and am trying to control the relative position of the shape legend.
""" Guide.shapekey[(; title="Shape", labels=[""], pos=Float64[])] Guide.shapekey(title, labels, pos) Enable control of the auto-generated shapekey. Set the key
title
and the itemlabels
.pos
overrides [Theme(key_position=)](@ref Gadfly) and can be in either relative (e.g. [0.7w, 0.2h] is the lower right quadrant), absolute (e.g. [0mm, 0mm]), or plot scale (e.g. [0,0]) coordinates. """Many thanks, Lu