title: Legend not show in the graph
body: <p>I was trying to build the stock prices graph but I am facing difficulties. My legends are not shown in the graph although I have return in the code correctly. I am new to R so I couldn't find any error.</p>
  
  <h1>THIS IS MY CODE</h1>
  
  <pre><code>library(quantmod)
  library(dplyr)
  library(PerformanceAnalytics)
  
  tickers &lt;- c("AAPL", "AMZN" , "MSFT" ,"FB")
  
  portfolioPrices &lt;- NULL
    for (Ticker in tickers)
        portfolioPrices &lt;- cbind(portfolioPrices,
                         getSymbols.yahoo(Ticker, from="2017-01-01", 
     periodicity = "weekly", auto.assign=FALSE)[,4])
  
  
    portfolioPrices &lt;- portfolioPrices[apply(portfolioPrices,1,function(x) all(!is.na(x))),]
  
    colnames(portfolioPrices) &lt;- tickers
  
     plot(portfolioPrices, legend = tickers)
  
  
     scaledData &lt;- scale(portfolioPrices)
     plot(scaledData, legend = tickers)
  </code></pre>
  
  <h1>THIS IS MY GRAPH<a href="https://i.stack.imgur.com/FWUzd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FWUzd.png" alt="enter image description here"></a></h1>
  
  <p>I want the tickers to be as legends but it is not showing. Help would be appreciated.</p>