title: Plotly ggplot Survival Curve how to alter legend text
body: <p>I am using plotly to make my survival curves interactive. All is working well except the legend is displaying the name of each strata in the following fashion (item_name,1).</p>
  <p>I want to get rid of the brackets and the &quot;,1&quot;. Normally when I plot the figures in ggplot it shows just: item_name</p>
  <p>My code is:</p>
  <pre><code>km_curve &lt;- ggsurvplot(fit, 
                     data = dataset, 
                     censor = FALSE,
                     conf.int = TRUE, 
                     risk.table = TRUE,
                     xlab = &quot;Time since Hospital Discharge (years)&quot;,  
                     ylab = &quot;Proportion of patients alive&quot;, 
                     palette = c(&quot;red&quot;,&quot;orange&quot;,&quot;yellow&quot;,&quot;green&quot;,&quot;blue&quot;,&quot;brown&quot;,&quot;pink&quot;,&quot;black&quot;),
                     legend.title = &quot;Diagnosis&quot;,
                     legend.labs = c(&quot;Cardiac (Non-surgical)&quot;,&quot;Cardiac (Surgical)&quot;,&quot;Gastrointestinal&quot;,&quot;Neurological&quot;,&quot;Other&quot;,&quot;Respiratory&quot;,&quot;Sepsis&quot;,&quot;Trauma&quot;))
  
  curve &lt;- km_curve$plot + scale_y_continuous(breaks = seq(0, 1, .25), labels = scales::percent) + 
  scale_x_continuous( breaks = seq(0,10,1), expand = c(0, 0))
  p &lt;- curve + theme(legend.title = element_text(size = 8), legend.text = element_text(size = 
  8),legend.position = &quot;bottom&quot;) + coord_cartesian(xlim = c(0,10))
  g &lt;- ggplotly(p)
  g
  </code></pre>
  <p>Does anyone know how to manually tell plotly what you want the legend text to say?</p>