Skip to content

Commit 5c17542

Browse files
author
“mahdis-z”
committed
change formatting for texttemplate
1 parent 252ec10 commit 5c17542

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

python/text-and-annotations.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.1'
9-
jupytext_version: 1.1.7
9+
jupytext_version: 1.2.1
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.6.5
23+
version: 3.7.3
2424
plotly:
2525
description: How to add text labels and annotations to plots in python.
2626
display_as: file_settings
@@ -522,9 +522,9 @@ This template string can include `variables` in %{variable} format, `numbers` in
522522
import plotly.graph_objects as go
523523

524524
fig = go.Figure(go.Pie(
525-
values = [2, 5, 3, 2.5],
526-
labels = ["R", "Python", "Java Script", "Matlab"],
527-
texttemplate = "%{label}: %{value} (%{percent})",
525+
values = [40000000, 20000000, 30000000, 10000000],
526+
labels = ["Sales", "Profit", "Income", "Expenses"],
527+
texttemplate = "%{label}: %{value:$,s} <br>(%{percent})",
528528
textposition = "inside"))
529529

530530
fig.show()
@@ -565,7 +565,7 @@ fig.add_trace(go.Funnel(
565565
y = ["2018-01-01", "2018-07-01", "2019-01-01", "2020-01-01"],
566566
x = [100, 60, 40, 20],
567567
textposition = "inside",
568-
texttemplate = "%{label}"))
568+
texttemplate = "%{y| %a. %_d %b %Y}"))
569569

570570
fig.add_trace(go.Funnel(
571571
name = 'Vancouver',

0 commit comments

Comments
 (0)