Skip to content

Commit

Permalink
final tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
cliffckerr committed Jan 17, 2022
1 parent 2c87be6 commit d9019ea
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ Version 3.1.2 (2021-01-16)
Highlights
^^^^^^^^^^
- **New styles**: Plots have gotten a complete revamp.
- **More options**: There is now many more options to control plot styles, warnings, etc.
- **More options**: There are now many more options to control plot styles, warnings, etc.
- **Populations**: It is now easier to work with pre-generated populations and contacts.

Plotting
^^^^^^^^
- Default plotting styles have been updated. Run e.g. ``cv.Sim(n_days=365).run().plot()`` to see most of the changes. Major changes include: a new date formatter, grid lines à la Seaborn, new bundled fonts (`Mulish <https://fonts.google.com/specimen/Mulish>`_) and `Rosario <https://fonts.google.com/specimen/Rosario>`_), finer control of style options, and better defaults for Jupyter.
- Default plotting styles have been updated. Run e.g. ``cv.Sim(n_days=365).run().plot()`` to see most of the changes. Major changes include: a new date formatter, grid lines à la Seaborn, new bundled fonts (`Mulish <https://fonts.google.com/specimen/Mulish>`_ and `Rosario <https://fonts.google.com/specimen/Rosario>`_), finer control of style options, and better defaults for Jupyter.
- Changing styles is now much easier, e.g. ``sim.plot(style='seaborn-whitegrid')`` will use the named Matplotlib style. See ``cv.options.help()`` for more information.
- Covasim now uses Sciris' default date formatter, which is similar to Plotly's. You can change this using the ``dateformat`` argument, e.g. ``sim.plot(dateformat='sciris')`` vs. ``sim.plot(dateformat='concise')``.
- ``cv.savefig()`` can now save multiple figures simultaneously via the (new) ``fig`` argument.
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tut_immunity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
"sim_booster.run()\n",
"\n",
"# Plot the sims with and without boosters together\n",
"cv.MultiSim([sim, sim_booster]).plot(to_plot=['cum_infections', 'cum_severe', 'cum_deaths','pop_nabs'])\n",
"cv.MultiSim([sim, sim_booster]).plot(['cum_infections', 'cum_severe', 'cum_deaths','pop_nabs'])\n",
"\n",
"# Plot doses again\n",
"pl.figure()\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tut_interventions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
"\n",
"# Run and plot results\n",
"msim = cv.parallel(sim1, sim2, sim3)\n",
"msim.plot(to_plot=['new_infections', 'new_tests', 'new_diagnoses', 'cum_diagnoses'])"
"msim.plot(['new_infections', 'new_tests', 'new_diagnoses', 'cum_diagnoses'])"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tut_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"s2 = cv.Sim(pars, interventions=protect_elderly, label='Protect the elderly')\n",
"msim = cv.MultiSim([s1, s2])\n",
"msim.run()\n",
"fig = msim.plot(to_plot=['cum_deaths', 'cum_infections'])"
"fig = msim.plot(['cum_deaths', 'cum_infections'])"
]
}
],
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tut_people.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
")\n",
"sim = cv.Sim(pars=pars, datafile='example_data.csv', interventions=cv.test_num(daily_tests='data'))\n",
"sim.run()\n",
"sim.plot(to_plot=['cum_tests', 'cum_diagnoses', 'cum_deaths'])"
"sim.plot(['cum_tests', 'cum_diagnoses', 'cum_deaths'])"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/tut_plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also select one or more quantities to plot with the `to_plot` argument, e.g."
"You can also select one or more quantities to plot with the first (`to_plot`) argument, e.g."
]
},
{
Expand All @@ -159,7 +159,7 @@
"metadata": {},
"outputs": [],
"source": [
"sim.plot(to_plot='overview', n_cols=5, figsize=(20,20), dateformat='concise', dpi=50) # NB: dateformat='concise' is already the default for >2 columns"
"sim.plot('overview', n_cols=5, figsize=(20,20), dateformat='concise', dpi=50) # NB: dateformat='concise' is already the default for >2 columns"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/tutorials/tut_running.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
"pars = {'start_day':'2021-03-01', 'n_days':120}\n",
"s1 = cv.Sim(pars, label='Default')\n",
"s2 = cv.Sim(pars, label='Protect the elderly', interventions=protect_elderly)\n",
"cv.parallel(s1, s2).plot(to_plot=['cum_deaths', 'cum_infections'])"
"cv.parallel(s1, s2).plot(['cum_deaths', 'cum_infections'])"
]
},
{
Expand Down

0 comments on commit d9019ea

Please sign in to comment.