Method: Charty::Backends::Pyplot#add_line_plot_legend

Defined in:
lib/charty/backends/pyplot.rb

#add_line_plot_legend(variables, color_mapper, size_mapper, style_mapper, legend) ⇒ Object



561
562
563
564
565
566
567
568
569
# File 'lib/charty/backends/pyplot.rb', line 561

def add_line_plot_legend(variables, color_mapper, size_mapper, style_mapper, legend)
  ax = @pyplot.gca
  add_relational_plot_legend(
    ax, variables, color_mapper, size_mapper, style_mapper,
    legend, [:color, :linewidth, :marker, :dashes]
  ) do |label, kwargs|
    ax.plot([], [], label: label, **kwargs)
  end
end