Skip to content

Commit 1d06fb8

Browse files
authored
Update plotting doc (#2169)
1 parent d3b7ba7 commit 1d06fb8

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

docs/guide/plotting.rst

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,28 @@ Plotting
55
========
66

77

8-
Stable Baselines3 provides utilities for plotting training results to monitor and visualize your agent's learning progress.
8+
Stable Baselines3 provides utilities for plotting training results, allowing you to monitor and visualize your agent's learning progress.
99
The plotting functionality is provided by the ``results_plotter`` module, which can load monitor files created during training and generate various plots.
1010

1111
.. note::
1212

13-
For plotting, we recommend using the
13+
We recommend using the
1414
`RL Baselines3 Zoo plotting scripts <https://rl-baselines3-zoo.readthedocs.io/en/master/guide/plot.html>`_
1515
which provide plotting capabilities with confidence intervals, and publication-ready visualizations.
1616

1717

1818
Recommended Approach: RL Baselines3 Zoo Plotting
1919
================================================
2020

21-
To have good plotting capabilities, including:
21+
The `RL Zoo <https://github.com/DLR-RM/rl-baselines3-zoo>`_ provides scripts that allows to compare results across different environments and have publication-ready plots with confidence intervals.
2222

23-
- Comparing results across different environments
24-
- Publication-ready plots with confidence intervals
25-
- Evaluation plots with error bars
26-
27-
We recommend using the plotting scripts from `RL Baselines3 Zoo <https://github.com/DLR-RM/rl-baselines3-zoo>`_:
23+
The three main plotting scripts are:
2824

2925
- `plot_train.py <https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/rl_zoo3/plots/plot_train.py>`_: For training plots
3026
- `all_plots.py <https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/rl_zoo3/plots/all_plots.py>`_: For evaluation plots, to post-process the result
3127
- `plot_from_file.py <https://github.com/DLR-RM/rl-baselines3-zoo/blob/master/rl_zoo3/plots/plot_from_file.py>`_: For more advanced plotting from post-processed results
3228

33-
These scripts provide additional features not available in the basic SB3 plotting utilities.
29+
These scripts offer features that are not included in the basic SB3 plotting utilities.
3430

3531

3632
Installation
@@ -40,7 +36,7 @@ First, install RL Baselines3 Zoo:
4036

4137
.. code-block:: bash
4238
43-
pip install rl_zoo3[plots]
39+
pip install 'rl_zoo3[plots]'
4440
4541
Basic Training Plot Examples
4642
----------------------------
@@ -83,17 +79,17 @@ Monitor File Format
8379

8480
The ``Monitor`` wrapper saves training data in CSV format with the following columns:
8581

86-
- ``r``: Episode reward
82+
- ``r``: Episode return (sum of rewards for one episode)
8783
- ``l``: Episode length (number of steps)
8884
- ``t``: Timestamp (wall-clock time when episode ended)
8985

90-
Additional columns may be present if you log custom metrics in the environment"s info dict.
86+
Additional columns may be present if you log custom metrics in the environment's info dict and pass their names via the ``info_keywords`` parameter.
9187

9288
.. note::
9389

94-
The plotting functions automatically handle multiple monitor files from the same directory,
95-
which occurs when using vectorized environments. The episodes are loaded and sorted by timestamp
96-
to maintain proper chronological order.
90+
The plotting functions automatically handle multiple monitor files from the same directory.
91+
This occurs when using vectorized environments. Episodes are loaded and sorted by timestamp
92+
to ensure they are in the correct chronological order.
9793

9894
Basic SB3 Plotting (Simple Use Cases)
9995
======================================
@@ -102,7 +98,7 @@ Basic Plotting: Single Training Run
10298
-----------------------------------
10399

104100
The simplest way to plot training results is to use the ``plot_results`` function after training an agent.
105-
This function reads monitor files created by the ``Monitor`` wrapper and plots the episode rewards over time.
101+
This function reads the monitor files created by the ``Monitor`` wrapper and plots the episode rewards over time.
106102

107103
.. code-block:: python
108104

0 commit comments

Comments
 (0)