Skip to content
This repository has been archived by the owner on Mar 11, 2024. It is now read-only.

Commit

Permalink
Add legend and title description
Browse files Browse the repository at this point in the history
  • Loading branch information
a-maliarov committed Apr 26, 2022
1 parent d25e511 commit 1c58f81
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,24 @@ fig.plot(times, values, color='red', linewidth=7)
fig.save('graph.png')
```

Show legend and add title:
```python
from simpleplots import Figure

# Create a figure
fig = Figure()

# Plot data
fig.plot([2, 3, 4], [1, 4.3, 6], color='red', label='line1')
fig.plot([1, 3.5, 7], [2, 3, 5], color='blue', label='line2')

# Show legend
fig.title('Some data')
fig.legend()

# Save the image (automatically closes the figure)
fig.save('graph.png')
```

## Additional
+ *simpleplots* is a demand-driven library. In case you want to use *simpleplots*, but can't find a locator, formatter or functionality you need - leave a message by creating an issue.

0 comments on commit 1c58f81

Please sign in to comment.