@@ -28,7 +28,7 @@ Use with TypeScript/JavaScript:
28
28
29
29
``` typescript
30
30
import { plot , Plot } from ' nodeplotlib' ;
31
- const data: Plot [] = [{x: [1 , 3 , 4 , 5 ], y: [3 , 12 , 1 , 4 ], type: ' scatter' }];
31
+ const data: Plot [] = [{ x: [1 , 3 , 4 , 5 ], y: [3 , 12 , 1 , 4 ], type: ' scatter' }];
32
32
plot (data );
33
33
```
34
34
@@ -50,11 +50,13 @@ With the stack function the user is able to print multiple charts on one page.
50
50
``` typescript
51
51
import { plot , stack , clear , Plot } from ' nodeplotlib' ;
52
52
53
- const data: Plot [] = [{
54
- x: [ 1 , 3 , 4 , 6 , 7 ],
55
- y: [ 2 , 4 , 6 , 8 , 9 ],
56
- type: ' scatter'
57
- }];
53
+ const data: Plot [] = [
54
+ {
55
+ x: [1 , 3 , 4 , 6 , 7 ],
56
+ y: [2 , 4 , 6 , 8 , 9 ],
57
+ type: ' scatter' ,
58
+ },
59
+ ];
58
60
59
61
stack (data );
60
62
stack (data );
@@ -84,29 +86,40 @@ In this section there are some examples to getting started. See the full plotly
84
86
#### Line Plots
85
87
86
88
``` typescript
87
- const trace1: Plot = {x: [1 , 2 ], y: [1 , 2 ], type: ' scatter' };
88
- const trace2: Plot = {x: [3 , 4 ], y: [9 , 16 ], type: ' scatter' };
89
+ const trace1: Plot = { x: [1 , 2 ], y: [1 , 2 ], type: ' scatter' };
90
+ const trace2: Plot = { x: [3 , 4 ], y: [9 , 16 ], type: ' scatter' };
89
91
plot ([trace1 , trace2 ]);
90
92
```
91
93
92
94
#### Bar Charts
93
95
94
96
``` typescript
95
- const trace: Plot = {x: [1 , 2 ], y: [1 , 2 ], type: ' bar' };
97
+ const trace: Plot = { x: [1 , 2 ], y: [1 , 2 ], type: ' bar' };
96
98
plot ([trace ]);
97
99
```
98
100
99
101
#### 3D Line Plots
100
102
101
103
``` typescript
102
- const trace: Plot = {x: [9 , 8 , 5 , 1 ], y: [1 , 2 , 4 , 8 ], z: [11 , 8 , 15 , 3 ], type: ' scatter3d' };
104
+ const trace: Plot = {
105
+ x: [9 , 8 , 5 , 1 ],
106
+ y: [1 , 2 , 4 , 8 ],
107
+ z: [11 , 8 , 15 , 3 ],
108
+ type: ' scatter3d' ,
109
+ };
103
110
plot ([trace ]);
104
111
```
105
112
106
113
#### 3D Surface Plots
107
114
108
115
``` typescript
109
- const trace: Plot = {colorscale: ' Viridis' , z: [[3 , 5 , 7 , 9 ], [21 , 13 , 8 , 5 ]]};
116
+ const trace: Plot = {
117
+ colorscale: ' Viridis' ,
118
+ z: [
119
+ [3 , 5 , 7 , 9 ],
120
+ [21 , 13 , 8 , 5 ],
121
+ ],
122
+ };
110
123
plot ([trace ]);
111
124
```
112
125
@@ -116,40 +129,42 @@ In order to style the plot, one is able to pass in the `layout` parameter, which
116
129
is typeof ` Partial<Layout> ` from plotly's ` Layout ` . See the full layout documentation
117
130
[ here] ( https://plot.ly/javascript/#layout-options ) .
118
131
119
- With this parameter one is able to define styles like * title * , * axis labels * ,
120
- * subplots * and many more.
132
+ With this parameter one is able to define styles like _ title _ , _ axis labels _ ,
133
+ _ subplots _ and many more.
121
134
122
135
``` typescript
123
- const data: Plot [] = [{
124
- type: ' scatterpolar' ,
125
- r: [1.5 , 10 , 39 , 31 , 15 , 1.5 ],
126
- theta: [' A' ,' B' ,' C' , ' D' , ' E' , ' A' ],
127
- fill: ' toself' ,
128
- name: ' Group B'
129
- }];
136
+ const data: Plot [] = [
137
+ {
138
+ type: ' scatterpolar' ,
139
+ r: [1.5 , 10 , 39 , 31 , 15 , 1.5 ],
140
+ theta: [' A' , ' B' , ' C' , ' D' , ' E' , ' A' ],
141
+ fill: ' toself' ,
142
+ name: ' Group B' ,
143
+ },
144
+ ];
130
145
131
146
const layout: Layout = {
132
147
polar: {
133
148
radialaxis: {
134
149
visible: true ,
135
- range: [0 , 50 ]
136
- }
137
- }
150
+ range: [0 , 50 ],
151
+ },
152
+ },
138
153
};
139
154
140
155
plot (data , layout );
141
156
```
142
157
143
158
## Plot types
144
159
145
- | Simple charts | Advanced charts | 3D Plots |
146
- | -------------------------- | --------------------------- | ---------- -------- |
147
- | Scatter | 2d density plots | Scatter |
148
- | Line | Histograms | Surface |
149
- | Bar | Box-plots | Lines |
150
- | Pie charts | Contour plots | |
151
- | Sankey diagrams | Heatmaps | |
152
- | Tables | Radar charts | |
160
+ | Simple charts | Advanced charts | 3D Plots |
161
+ | --------------- | ---------------- | -------- |
162
+ | Scatter | 2d density plots | Scatter |
163
+ | Line | Histograms | Surface |
164
+ | Bar | Box-plots | Lines |
165
+ | Pie charts | Contour plots | |
166
+ | Sankey diagrams | Heatmaps | |
167
+ | Tables | Radar charts | |
153
168
154
169
## Behind the scenes
155
170
0 commit comments