The position parameter in scale_x_(), scale_y_() functions controls position of the axis:
import pandas as pd
from lets_plot import *
LetsPlot.setup_html()
LetsPlot.set_theme(theme_grey())
df = pd.read_csv('https://raw.githubusercontent.com/JetBrains/lets-plot-docs/master/data/iris.csv')
df.head(3)
p = (ggplot(df) + geom_point(aes("sepal_width", "sepal_length", color="species"), size=5)
+ scale_color_brewer(palette="Set1")
)
p
position="right"¶p + scale_y_continuous("Sepal Length", position="right")
position="top"¶p + scale_x_continuous(position="top")
position="both"¶(p
+ scale_x_continuous("Sepal Width", position="both")
+ scale_y_continuous("Sepal Length", position="both")
)
(p
+ scale_x_continuous("Sepal Width", position="both")
+ scale_y_continuous("Sepal Length", position="both")
+ coord_fixed()
)