Gadfly - Positioning the legend and entry alignments

gadfly

#1

Hi,

I’m using Gadfly to plot some results. I want to put the legend on top of the figure, but when I use the following code

results = Dict{String,Array{Float64,1}}()

# Run the experiments and put the observations into 'results' 
# ...
# ...

# Start plotting
penColors   = distinguishable_colors( length(testAlgs)+1 )
xPoints     = 1:noOfTimeSteps

algStr  = [ Algorithms.info_str(_alg) for _alg ∈ testAlgs ]
fig_reward  = Gadfly.plot(
                [ layer( x = xPoints,
                         y = results[algStr[i]],
                         Geom.line,
                         Theme(default_color=penColors[i+1]) ) for i = 1:length(algStr) ]...,
                Guide.xlabel( "Time Step" ),
                Guide.xticks( ticks=collect(0:20:100) ),
                Guide.ylabel( "Average Reward" ),
                Guide.yticks( ticks=collect(0.0:0.1:1.0) ),
                Guide.title( "ϵ-Greedy performance" ),
                Guide.manual_color_key( "", algStr, penColors[2:end] ),
                style(key_position=:top)
            )

i get the following figure:

My problem is, here all the entries are crowded towards left.
Is there any way to nicely spread them evenly along the horizontal space?

Thanks,
vish