Skip to content

Releases: mdolab/niceplots

v2.5.1

14 Feb 18:09
b23b4d8
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.5.0...v2.5.1

v2.5.0

16 Nov 19:35
2c7bc26
Compare
Choose a tag to compare

What's Changed

  • Improve default behaviour of label_line_ends by @A-CGray in #38

Full Changelog: v2.4.1...v2.5.0

v2.4.1

11 Jul 20:58
be76687
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.4.0...v2.4.1

v2.4.0

09 Jun 15:49
cb1957d
Compare
Choose a tag to compare

What's Changed

  • Add helper function for saving figure in multiple formats by @A-CGray in #36

Full Changelog: v2.3.0...v2.4.0

v2.3.0

09 May 17:28
6ceaaa3
Compare
Choose a tag to compare

What's Changed

  • Add ability to get colors from style that is not active by @eytanadler in #35

Full Changelog: v2.2.0...v2.3.0

v2.2.0

19 Apr 23:25
38a113e
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.1.0...v2.2.0

v2.1.0

31 Jan 16:14
96ac003
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.0.0...v2.1.0

v2.0.0

25 Jan 04:05
4b669c3
Compare
Choose a tag to compare

What's Changed

NicePlots 2.0 is still mostly the same, but there have been some small backwards incompatible changes to the API, checkout our updated examples documentation to see the new API in action:

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. 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:

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

Full Changelog: v1.3.0...v2.0.0

v1.3.0

15 Sep 15:58
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.2.1...v1.3.0

v1.2.1

09 Jun 14:21
fd4cc40
Compare
Choose a tag to compare

What's Changed

  • Use external links for readme images by @A-CGray in #26
  • Change links in readme from master to main by @eirikurj in #27

New Contributors

Full Changelog: v1.2.0...v1.2.1