-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add subtitle to plots #7012
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
Add subtitle to plots #7012
Changes from 45 commits
24ed9c9
7469d8e
3afc2e7
13f8b2a
cf5eb51
4a55ff2
625ea53
972836e
f6e9781
35a6599
60a6287
7eb9e52
7e9fcf9
3190382
608740f
183518c
2452a48
8bce81b
2aca950
ade53d3
13af030
b2a26e0
2790ec7
03638ee
8210b58
496ccc7
15754fa
f2cbc23
f3842e0
e3813f2
e70e521
e9e8adb
0d154bb
2aa2b8f
527ff8d
28d30ee
aa7b0a6
db5de4d
154f481
6701eee
313301c
423dfd3
cef06c8
7cc019d
b7cda0b
ec166a3
8e44892
e189245
de628de
47a5b82
b8942ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add `subtitle` attribute to `layout.title` to enable adding subtitles to plots [[#7012](https://github.com/plotly/plotly.js/pull/7012)] |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -14,6 +14,8 @@ var interactConstants = require('../../constants/interactions'); | |||
|
||||
var OPPOSITE_SIDE = require('../../constants/alignment').OPPOSITE_SIDE; | ||||
var numStripRE = / [XY][0-9]* /; | ||||
var MATHJAX_PADDING_MULTIPLIER = 0.85; | ||||
var EXTRA_SPACING_BETWEEN_TITLE_AND_SUBTITLE = 0; | ||||
|
LINE_SPACING: 1.3, |
This is why:
If I call
Plotly.newPlot(gd, [{y: [1, 2]}], {title: {text: 'title', subtitle: {text: 'subtittle'}}});
the subtitle render closer compared to when I call
Plotly.newPlot(gd, [{y: [1, 2]}], {title: {text: 'title<br><sub>subtittle</sub>'}});
So perhaps you could try using (LINE_SPACING - 1) * title.font.size
in your calculations?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@archmoj Do you think the subtitle looks better with additional spacing?
I'd prefer not to change the spacing just to match the appearance of <sub>
, since that spacing is arbitrary.
I prefer the more compact look.
Uh oh!
There was an error while loading. Please reload this page.