Skip to content

Commit 68ce728

Browse files
fix some gremlins
1 parent b0be3b4 commit 68ce728

File tree

2 files changed

+47
-32
lines changed

2 files changed

+47
-32
lines changed

python/colorscales.md

Lines changed: 33 additions & 2 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.1.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.7.2
23+
version: 3.6.8
2424
plotly:
2525
description: How to set colorscales and heatmap colorscales in Python and Plotly.
2626
Divergent, sequential, and qualitative colorscales.
@@ -33,6 +33,7 @@ jupyter:
3333
order: 22
3434
permalink: python/colorscales/
3535
thumbnail: thumbnail/heatmap_colorscale.jpg
36+
redirect_from: python/logarithmic-color-scale/
3637
title: Colorscales in Python | Plotly
3738
v4upgrade: true
3839
---
@@ -251,6 +252,36 @@ fig.add_trace(go.Heatmap(
251252
fig.show()
252253
```
253254

255+
### Logarithmic Colorscale
256+
257+
```python
258+
import plotly.graph_objects as go
259+
260+
fig = go.Figure(go.Heatmap(
261+
z= [[10, 100.625, 1200.5, 150.625, 2000],
262+
[5000.625, 60.25, 8.125, 100000, 150.625],
263+
[2000.5, 300.125, 50., 8.125, 12.5],
264+
[10.625, 1.25, 3.125, 6000.25, 100.625],
265+
[0, 0.625, 2.5, 50000.625, 10]],
266+
colorscale= [
267+
[0, 'rgb(250, 250, 250)'], #0
268+
[1./10000, 'rgb(200, 200, 200)'], #10
269+
[1./1000, 'rgb(150, 150, 150)'], #100
270+
[1./100, 'rgb(100, 100, 100)'], #1000
271+
[1./10, 'rgb(50, 50, 50)'], #10000
272+
[1., 'rgb(0, 0, 0)'], #100000
273+
274+
],
275+
colorbar = dict(
276+
tick0= 0,
277+
tickmode= 'array',
278+
tickvals= [0, 1000, 10000, 100000]
279+
)
280+
))
281+
282+
fig.show()
283+
```
284+
254285
### Reference
255286

256287
See https://plot.ly/python/reference/ for more information and chart attribute options!

python/figure-labels.md

Lines changed: 14 additions & 30 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.6
9+
jupytext_version: 1.1.1
1010
kernelspec:
1111
display_name: Python 3
1212
language: python
@@ -20,26 +20,27 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.3
23+
version: 3.6.8
2424
plotly:
25-
description: How to set the title, legend-entries, and axis-titles in python.
25+
description: How to set the global font, title, legend-entries, and axis-titles
26+
in python.
2627
display_as: file_settings
2728
has_thumbnail: true
2829
ipynb: ~notebook_demo/271
2930
language: python
3031
layout: base
31-
name: Setting the Title, Legend Entries, and Axis Titles
32+
name: Setting the Font, Title, Legend Entries, and Axis Titles
3233
order: 11
3334
permalink: python/figure-labels/
35+
redirect_from: python/font/
3436
thumbnail: thumbnail/figure-labels.png
35-
title: Setting the Title, Legend Entries, and Axis Titles in Python
37+
title: Setting the Font, Title, Legend Entries, and Axis Titles in Python
3638
v4upgrade: true
3739
---
3840

3941
```python
4042
import plotly.graph_objects as go
4143

42-
4344
fig = go.Figure()
4445

4546
fig.add_trace(go.Scatter(
@@ -56,30 +57,13 @@ fig.add_trace(go.Scatter(
5657
))
5758

5859
fig.update_layout(
59-
title=go.layout.Title(
60-
text="Plot Title",
61-
xref="paper",
62-
x=0
63-
),
64-
xaxis=go.layout.XAxis(
65-
title=go.layout.xaxis.Title(
66-
text="x Axis",
67-
font=dict(
68-
family="Courier New, monospace",
69-
size=18,
70-
color="#7f7f7f"
71-
)
72-
)
73-
),
74-
yaxis=go.layout.YAxis(
75-
title=go.layout.yaxis.Title(
76-
text="y Axis",
77-
font=dict(
78-
family="Courier New, monospace",
79-
size=18,
80-
color="#7f7f7f"
81-
)
82-
)
60+
title="Plot Title",
61+
xaxis_title="x Axis Title",
62+
yaxis_title="y Axis Title",
63+
font=dict(
64+
family="Courier New, monospace",
65+
size=18,
66+
color="#7f7f7f"
8367
)
8468
)
8569

0 commit comments

Comments
 (0)