Skip to content

Commit 251c0aa

Browse files
authored
Update README.md
1 parent 00d39cf commit 251c0aa

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ map.on('load', () => {
8181

8282
The wind barbs are automatically rotated based on the grid projection. Also, the density of the wind barbs is automatically varied based on the map zoom level. The `'thin_fac': 16` option means to plot every 16th wind barb in the i and j directions, and this is defined at zoom level 1. So at zoom level 2, it will plot every 8th wind barb, and at zoom level 3 every 4th wind barb, and so on. Because it divides in 2 for every deeper zoom level, `'thin_fac'` should be a power of 2.
8383

84-
### Filled contours
84+
### Filled contours or raster plots
8585

8686
Plotting filled contours is also similar to plotting regular contours, but there's some additional steps for the color map. A couple color maps are available by default (see [here](#built-in-color-maps) for more details), but if you have the colors you want, creating your own is (relatively) painless (hopefully). First, set up the colormap. Here, we'll just use the bluered colormap included by default.
8787

@@ -96,7 +96,13 @@ map.on('load', () => {
9696
});
9797
```
9898

99-
Normally, when you have color-filled contours, you have a color bar on the plot. To create an SVG color bar:
99+
Making a raster plot is very similar (the two classes support the same options):
100+
101+
```javascript
102+
const raster = new Raster(height, {cmap: colormap});
103+
```
104+
105+
Normally, when you have a color fill, you have a color bar on the plot. To create an SVG color bar:
100106

101107
```javascript
102108
const colorbar_svg = makeColorBar(colormap, {label: "Height Perturbation (m)",

0 commit comments

Comments
 (0)