Skip to content

Commit 5e55bcb

Browse files
committedJul 18, 2019
fix error bars, add log
1 parent 244c22f commit 5e55bcb

File tree

3 files changed

+67
-108
lines changed

3 files changed

+67
-108
lines changed
 

‎python/error-bars.md

Lines changed: 6 additions & 17 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.1
9+
jupytext_version: 1.2.0
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.7
23+
version: 3.6.8
2424
plotly:
2525
description: How to add error-bars to charts in Python with Plotly.
2626
display_as: statistical
@@ -152,25 +152,14 @@ import plotly.graph_objects as go
152152

153153
fig = go.Figure()
154154
fig.add_trace(go.Bar(
155-
x=['Trial 1', 'Trial 2', 'Trial 3'],
156-
y=[3, 6, 4],
157155
name='Control',
158-
error_y=dict(
159-
type='data',
160-
array=[1, 0.5, 1.5],
161-
visible=True,
162-
color='white')
156+
x=['Trial 1', 'Trial 2', 'Trial 3'], y=[3, 6, 4],
157+
error_y=dict(type='data', array=[1, 0.5, 1.5])
163158
))
164159
fig.add_trace(go.Bar(
165-
x=['Trial 1', 'Trial 2', 'Trial 3'],
166-
y=[4, 7, 3],
167160
name='Experimental',
168-
error_y=dict(
169-
type='data',
170-
array=[0.5, 1, 2],
171-
visible=True,
172-
color='white'
173-
)
161+
x=['Trial 1', 'Trial 2', 'Trial 3'], y=[4, 7, 3],
162+
error_y=dict(type='data', array=[0.5, 1, 2])
174163
))
175164
fig.update_layout(barmode='group')
176165
fig.show()

‎python/log-plot.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
jupyter:
3+
jupytext:
4+
notebook_metadata_filter: all
5+
text_representation:
6+
extension: .md
7+
format_name: markdown
8+
format_version: '1.1'
9+
jupytext_version: 1.2.0
10+
kernelspec:
11+
display_name: Python 3
12+
language: python
13+
name: python3
14+
language_info:
15+
codemirror_mode:
16+
name: ipython
17+
version: 3
18+
file_extension: .py
19+
mimetype: text/x-python
20+
name: python
21+
nbconvert_exporter: python
22+
pygments_lexer: ipython3
23+
version: 3.6.8
24+
plotly:
25+
description: How to make Log plots in Python with Plotly.
26+
display_as: scientific
27+
has_thumbnail: true
28+
ipynb: ~notebook_demo/31
29+
language: python
30+
layout: user-guide
31+
name: Log Plots
32+
order: 1
33+
permalink: python/log-plot/
34+
thumbnail: thumbnail/log.jpg
35+
title: Python Log Plots | plotly
36+
---
37+
38+
### Logarithmic Axes ###
39+
40+
```python
41+
import plotly.graph_objects as go
42+
43+
fig = go.Figure()
44+
45+
fig.add_trace(go.Scatter(
46+
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
47+
y=[8, 7, 6, 5, 4, 3, 2, 1, 0]
48+
))
49+
50+
fig.add_trace(go.Scatter(
51+
x=[0, 1, 2, 3, 4, 5, 6, 7, 8],
52+
y=[0, 1, 2, 3, 4, 5, 6, 7, 8]
53+
))
54+
55+
fig.update_layout(xaxis_type="log", yaxis_type="log")
56+
fig.show()
57+
```
58+
59+
#### Reference
60+
See https://plot.ly/python/reference/#layout-xaxis-type for more information and chart attribute options!
61+

‎unconverted/python/log-plot.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)
Please sign in to comment.