Niceplots

Latest version: v2.5.1

Safety actively analyzes 638437 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 3

2.1.0

What's Changed
* Add `label_line_ends` and example by A-CGray in https://github.com/mdolab/niceplots/pull/32


**Full Changelog**: https://github.com/mdolab/niceplots/compare/v2.0.0...v2.1.0

2.0

`setRCParams` is now `plt.style.use`

**TL;DR:** replace `niceplots.setRCParams()` with `plt.style.use(niceplots.get_style())` and replace `niceplots.setRCParams(dark_mode=True, set_dark_background=True)` with `plt.style.use(niceplots.get_style("doumont-dark"))`

We replaced the `setRCParams` function that set the niceplots style with a series of matplotlib [stylesheets](https://matplotlib.org/stable/tutorials/introductory/customizing.html#customizing-with-style-sheets). There are now 4 available NicePlots styles:

- `doumont-light`
- `doumont-dark`
- `james-light`
- `james-dark`

The two Doumont styles are mostly equivalent to the styles that used to be set by `setRCParams()` although we have tweaked them a little, so we can't guarantee your plots will look *exactly* like they used to with NicePlots v1.

We don't store the niceplots stylesheets in a place matplotlib can normally find them, so to use them you will need to call `niceplots.get_style(<style name>)`, whose output can be passed to `plt.style.use` or `plt.style.context`. To enable you to easily switch between NicePlots and matplotlib styles, `get_style` also accepts the name of any matplotlib style.

If you just want a drop-in replacement for `niceplots.setRCParams()`, use `plt.style.use(niceplots.get_style())`, since the `doumont-light` theme is returned by default.

By switching to style sheets, you can now compose NicePlots' styles with your own. For example, if you wanted to start off with the `james-dark` theme and then make a few adjustments, put your adjustments in your own style sheet and then call:

python
plt.style.use([niceplots.get_style("james-dark"), <path to your stylesheet>])


`get_niceColors` is now `get_colors`/`get_colors_list`

`get_colors_list()` returns the currently set color cycle as a list, it is identical to calling `plt.rcParams["axes.prop_cycle"].by_key()["color"]`. `get_colors()` returns the current style's colors as a dictionary, it includes some additional colors that aren't in the color cycle but are used by the style, for example, the `"Axis"` and `"Background"` colors. Unfortunately, `get_colors()` only works while you're using a NicePlots style, but why would you ever not be?

We picked a naming convention

Previously the method names in NicePlots were all over the place, we had `setRCParams()`, `parula_map` and even `get_niceColors()`. Everything has now been converted to `snake_case`, which means you might need to make the following changes to your old scripts:

- `plotOptProb` -> `plot_opt_prob`
- `plotColoredLine` -> `plot_colored_line`
- `plotNestedPie` -> `plot_nested_pie`

PRs

All of the above changes were implemented in the PR below
* Switch to using stylesheets by eytanadler in https://github.com/mdolab/niceplots/pull/30


**Full Changelog**: https://github.com/mdolab/niceplots/compare/v1.3.0...v2.0.0

2.0.0

What's Changed

1.3.0

What's Changed
* Updated draggable legend kwargs by marcomangano in https://github.com/mdolab/niceplots/pull/28

New Contributors
* marcomangano made their first contribution in https://github.com/mdolab/niceplots/pull/28 :tada:

**Full Changelog**: https://github.com/mdolab/niceplots/compare/v1.2.1...v1.3.0

1.2.1

What's Changed
* Use external links for readme images by A-CGray in https://github.com/mdolab/niceplots/pull/26
* Change links in readme from master to main by eirikurj in https://github.com/mdolab/niceplots/pull/27

New Contributors
* eirikurj made their first contribution in https://github.com/mdolab/niceplots/pull/27

**Full Changelog**: https://github.com/mdolab/niceplots/compare/v1.2.0...v1.2.1

1.2.0

API changes to `niceplots.utils.horiz_bar`:
- Removed `ts` spacing keyword argument
- Bolded heading font as opposed to line underneath

What's Changed
* Maintenance cleanup by nwu63 in https://github.com/mdolab/niceplots/pull/25
* Fix bar chart by A-CGray in https://github.com/mdolab/niceplots/pull/24


**Full Changelog**: https://github.com/mdolab/niceplots/compare/v1.1.0...v1.2.0

Page 2 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.