Explain scatter plots in plotly with various functions in it.
Scatter plot are also known as Scatter graph, which uses cartesian coordinates to display the values for typically two variables for a dataset
import plotly.express as px
Sample_data = px.data.carshare()
fig = px.scatter(Sample_data, x="centroid_lat", y="car_hours", color="peak_hour", marginal_y="violin", marginal_x="box", trendline="ols", template="simple_white", )
Here the above figure shows the scatter plot with various function:
x, and y shows the data should be presented on that particular axis.
marginal_x - visualizing the x distribution, horizontal subplot is drawn above the main plot.
marginal_y - visualizing the y distribution, vertical subplot is drawn to the right of the main plot.
trendline - these added the ordinal least squares (OLS) regression trendlines or non-linear Locally Weighted Scatterplot Smoothing (LOEWSS) trendlines to scatterplots.
template - themes acn be implemented usin templates, these are slightly more general than traditional themes because in addition to defining default styles, templates can pre-populate a figure with visual elements like annotations, shapes, images, and more.