Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 29 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ for a practical example of how to use the client.
### Installation

```bash
# Choose the version you want to install
VERSION=0.18.0
pip install frequenz-client-reporting==$VERSION
pip install frequenz-client-reporting
```


Expand Down Expand Up @@ -202,6 +200,34 @@ df = pd.DataFrame(data)
print(df)
```

## Plotting data with matplotlib
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe append it directly to the other python sections, i.e. before the CLI tool section.


```bash
pip install matplotlib
```

Using the `data` variable from any of the examples above:

```python
import matplotlib.pyplot as plt
import matplotlib.dates as mdates

timestamps = [s.timestamp for s in data]
values = [s.value for s in data]

fig, ax = plt.subplots(figsize=(14, 5))
ax.plot(timestamps, values)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add a comment here that all of the following customization instructions are optional.


# Optional: customize the plot
ax.set_title("AC Active Power")
ax.set_ylabel("Power (W)")
ax.xaxis.set_major_formatter(mdates.DateFormatter("%H:%M"))
ax.grid(True)
fig.tight_layout()

plt.show()
```

## Command line client tool

The package contains a command-line tool that can be used to request
Expand Down