domitry / nyaplot

interactive plots generator for Ruby
MIT License
219 stars 27 forks source link

changing datalabels on boxplots #56

Closed tansaku closed 9 years ago

tansaku commented 9 years ago

As far as I can see the x data labels for a boxplot default to 'data0', 'data1' etc. does anyone know how to change that?

domitry commented 9 years ago
box = plot4.add(:box, arr, arr2, arr3, arr4)
box.values[:label_arr, :arr2, :arr3, :arr4]
plot4.show

or

df = Nayplot::DataFrame.new({arr1: arr1, arr2: arr2})
plot4.add_with_df(df, :arr1, :arr2)
plot4.show
tansaku commented 9 years ago

awesome thanks @domitry !

tansaku commented 9 years ago

can't quite get that first one to work:

undefined methodvalues' for #`

but the second one (add_with_df) worked - woot!