-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Plot Subtitle #233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
This is a good candidate for using annotations. We are trying to keep plotly.js as lean as possible now, so it is unlikely we will add this feature unless many more users request it. That being said, we are always open to pull requests! |
Alternatively, break a line with a |
Thank you very much!
I think that combining |
In plot there is already this feature, you have "main" and "sub" I sum my vote also to have this feature in plotly! |
https://help.plot.ly/how-to-add-annotations/ https://plot.ly/create/?fid=plotly2_demo:128 Simple Annotations Example for a SubTitle
Or in the plot.ly tool set, go to Note, that as the legend gets turned on or off, the annotations anchored to the paper, don't remain centered with the title. If you have a long, multiline subtitle, consider using |
... or add a 'title.text': 'Plot title<br><small>Plot subtitle</small>' |
layout['title'] += "<br>" + subTitle; // work fine |
@leonardotrp, I had the same issue. The small tag does not seem to work. I created a small subtitle by rendering with a break and using the allowed 'layout': {
'title': 'Historical Emissions and Future Emission Budget for {} <br><sub>Source: @FlorianDRX</sub>'.format(selected_country) ,
'xaxis': {
'title': 'Year'
},
'yaxis': {
'title': 'National Emissions (Megatons CO2)'
},
}, Which renders the title as: |
4 years since this issue was created, yet no solution? 😞 In my case all of the title manipulations (adding The problem is that different title plots a new graph. |
The current recommendation is to use This issue is currently not on our roadmap in the coming months but we would happily accept a pull request if someone wants to implement it, or we would accept sponsorship to accelerate its development. |
I experimented with altering the value of y. then found the meaning of the xref setting. careful use of y values and font sizes should be able to generate multiple lines of annotation.
y>=1 positioned the annotation just above the plot area. trap for the unwary : annotation color matching plot color will make the annotation invisible. https://plotly.com/javascript/reference/layout/#layout-title-xref "Sets the container I'm not clear if values other than 'paper' as possible for xref
|
Closing in favor of #6856 which is in development. |
I was wondering if there is a way to add a plot subtitle in plotly. Sometimes it would be very important to be able to add extra information regarding the plot in a line below the main title. It would also be great if it would be possible to add this subtitle within a "subtitle" tag on the layout description of the plot. Something such as:
var layout = {
-----title: 'Plot Title',
-----subtitle: 'Plot Subtitle',
-----xaxis: {
----------title: 'x Axis',
----------titlefont: {
----------family: 'Courier New, monospace',
----------size: 18,
----------color: '#7f7f7f'
----------}
-----},
-----yaxis: {
----------title: 'y Axis',
----------titlefont: {
---------------family: 'Courier New, monospace',
---------------size: 18,
---------------color: '#7f7f7f'
---------------}
-----}
};
I have searched on internet and I couldn't find any way to implement this subtitle on plotly. Even though I couldn't find anything I could edit the source code loaded on my browser to insert a subtitle within the
<text class="gtitle" ...> ... </text>
by adding a<tspan style="..."> </span>
. Even though this worked for the plot display then the "download plot as a png" option from the "modebar" of the plot was not capable to save this change in a picture.I know this might be an enhancement, hopefully it is not hardcoding and it is easy to implement.
Thank you very much!
The text was updated successfully, but these errors were encountered: