question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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!

Issue Analytics

  • State:open
  • Created 8 years ago
  • Reactions:24
  • Comments:11 (4 by maintainers)

github_iconTop GitHub Comments

19reactions
floriandierickxcommented, Oct 15, 2019

@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 <sub> tag:

'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:

Screenshot 2019-10-15 at 15 11 04
8reactions
cyberosacommented, Oct 30, 2017

In plot there is already this feature, you have “main” and “sub”
https://www.statmethods.net/advgraphs/axes.html

I sum my vote also to have this feature in plotly!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Giving graphs a subtitle in matplotlib - Stack Overflow
I want to give my graph a title in big 18pt font, then a subtitle below it in smaller 10pt font. How can...
Read more >
Add subtitle to plot - MATLAB subtitle - MathWorks
Create a plot. Add a title with the title function. Then, call the subtitle function, and specify the color using the 'Color' name-value...
Read more >
How to Add Titles to Matplotlib: Title, Subtitle, Axis Titles - Datagy
In this tutorial, you'll learn how to add titles to your Matplotlib plots. You'll learn how to add a title, a subtitle, and...
Read more >
Make Impactful Charts by Adding Subtitles with plt.suptitle
How to add titles and subtitles to your Matplotlib charts using plt. ... Functional titles tell the reader what the graph is plotting, ......
Read more >
Title and subtitle in R [Set and Adjust] - R CHARTS
Setting a title and a subtitle. Adding a title. Base R plotting functions come with an argument named main that allows adding a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found