import $ivy.`org.plotly-scala::plotly-almond:0.5.2+2-3e447cc6-SNAPSHOT`
import plotly._, plotly.element._, plotly.layout._, plotly.Almond._
repl.pprinter() = repl.pprinter().copy(defaultHeight = 2)
import $ivy.$ import plotly._, plotly.element._, plotly.layout._, plotly.Almond._
val data = Seq(
Bar(
Seq("Apples", "Oranges", "Watermelon", "Pears"),
Seq(3, 2, 1, 4)
)
)
val layout = Layout(
autosize = false,
width = 500,
height = 500,
yaxis = Axis(
title = "Y-axis Title",
ticktext = Seq("long label","Very long label","3","label"),
tickvals = Seq(1, 2, 3, 4),
tickmode = TickMode.Array,
titlefont = Font(size = 30 ),
),
paper_bgcolor = Color.RGB(0x7f, 0x7f, 0x7f),
plot_bgcolor = Color.RGB(0xc7, 0xc7, 0xc7)
)
plot(data, layout)
data: Seq[Bar] = List( ... layout: Layout = Layout( ... res1_2: String = "plot-1784205064"
import $ivy.`com.softwaremill.quicklens::quicklens:1.4.11`
import com.softwaremill.quicklens._
val layoutWithAutomargin = layout.modify(_.yaxis.each.automargin).setTo(Some(true))
plot(data, layoutWithAutomargin)
import $ivy.$ import com.softwaremill.quicklens._ layoutWithAutomargin: Layout = Layout( ... res2_3: String = "plot-1617850768"