Correlated ETF funds
In this coding exercise, you will explore the relationship between two popular ETF funds, the SPDR S&P 500 (SPY) and Invesco QQQ, by creating a scatter plot that displays the correlation between their traded volumes. So, let's begin!
Two DataFrames named spy and qqq, which hold the historical prices of said funds, have been loaded for you. The DataFrames and Plots packages have been imported and are available for use.
本练习是课程的一部分
Introduction to Data Visualization with Julia
练习说明
- Generate a scatter plot representing the trading
volumeof SPY on the x-axis and that of QQQ on the y-axis, using ablackregression line withlinewidthset to2.5andmarkercolorset topink; hide the legend. - Add the title
"Correlation Between SPY & QQQ Traded Volumes"to the scatter plot. - Label the x-axis as
"SPY Daily Traded Volume"and the y-axis as"QQQ Daily Traded Volume".
交互式实操练习
通过完成这段示例代码来试试这个练习。
# Make a scatter plot
____(
____.____,
____.____,
smooth=____,
linewidth=____,
linecolor=:____,
label=____,
markercolor=:____
)
# Add a title to the figure
____(____)
# Label the x and y axes
____(____)
____(____)