Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
tsupinie authored Nov 10, 2023
1 parent 00d39cf commit 251c0aa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ map.on('load', () => {

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.

### Filled contours
### Filled contours or raster plots

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.

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

Normally, when you have color-filled contours, you have a color bar on the plot. To create an SVG color bar:
Making a raster plot is very similar (the two classes support the same options):

```javascript
const raster = new Raster(height, {cmap: colormap});
```

Normally, when you have a color fill, you have a color bar on the plot. To create an SVG color bar:

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

0 comments on commit 251c0aa

Please sign in to comment.