Skip to content

Commit

Permalink
docs improved
Browse files Browse the repository at this point in the history
  • Loading branch information
franz-benjamin committed Jul 7, 2024
1 parent 6fe3910 commit 80e55be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ We can now easily generate a plot from the result:
data.plot(city=ALL, filename='example4.png')
```

![data.plot(city=ALL, filename='example4.png')](./examples/example4.png)
![data.plot(city=ALL, filename='example4.png')](/examples/example4.png)

Alternatively, we can generate a table from the result
```python
Expand Down
8 changes: 4 additions & 4 deletions docs/data.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,28 @@ Instead of computing table representations, the data can also be plotted by usin
data.plot(city='manhattan', typeOfRoad=ALL)
```

![data.plot(city='manhattan', typeOfRoad=ALL)](./examples/plot-manhattan.png)
![data.plot(city='manhattan', typeOfRoad=ALL)](/examples/plot-manhattan.png)

Also the primary roads from different cities can be compared:
```python
data.plot(city=ALL, typeOfRoad='primary')
```

![data.plot(city=ALL, typeOfRoad='primary')](./examples/plot-primary.png)
![data.plot(city=ALL, typeOfRoad='primary')](/examples/plot-primary.png)

The rows correspond to the x axis, and the columns to the y axis. It is thus important to restrict the number of row dimensions until only one row dimension is left. The rows should only contain numerical values, when being plotted. If the values are not numerical, a bar plot can be used:
```python
data.plotBar(city='manhattan', year=ALL)
```

![data.plotBar(city='manhattan', year=ALL)](./examples/plotbar-manhattan.png)
![data.plotBar(city='manhattan', year=ALL)](/examples/plotbar-manhattan.png)

When two values shall be compared, a scatter plot can be used. The following plot compares the number of primary roads in Vienna (x axis) to the number of primary roads in Manhattan (y axis):
```python
data.plotScatter('vienna', 'manhattan', city=['vienna', 'manhattan'], typeOfRoad='primary')
```

![data.plotScatter('vienna', 'manhattan', city=['vienna', 'manhattan'], typeOfRoad='primary')](./examples/plotscatter-primary.png)
![data.plotScatter('vienna', 'manhattan', city=['vienna', 'manhattan'], typeOfRoad='primary')](/examples/plotscatter-primary.png)

When the plots (`plot`, `plotBar`, and `plotScatter`) are generated, they are (on most systems) shown in a graphical user interface. If the parameter `filename` is added, the data is instead saved to the corresponding file:
```python
Expand Down

0 comments on commit 80e55be

Please sign in to comment.