style
Set-up matplotlib environment.
Style
¶
Bases: Enum
Enum for all styles defined in pplt.
keys_list()
classmethod
¶
Return list of available Style names.
Source code in src/prettypyplot/style.py
30 31 32 33 |
|
Mode
¶
Bases: Enum
Enum for all modes defined in pplt.
keys_list()
classmethod
¶
Return list of available Mode names.
Source code in src/prettypyplot/style.py
47 48 49 50 |
|
update_style(interactive=None, colors=None, cmap=None, ncs=None, figsize=None, figratio=None, mode=None, style=None, ipython=None, true_black=None, latex=None, sf=None)
¶
Update alternative matplotlib style.
This function updates specified parameters of use_style
without changing
other.
Parameters:
-
interactive
(bool
, default:None
) –Set interactive mode.
-
colors
(string
, default:None
) –Set the default color cycler from continuous or discrete maps. Use any of matplotlibs defaults or specified in the colors submodule.
-
cmap
(string
, default:None
) –Set the default colormap.
-
ncs
(int
, default:None
) –Number of colors if continuous cmap is selected.
-
figsize
(int or int tuple
, default:None
) –Give size of default figure in inches, either as tuple (x, y) or a single float for the x-axis. The y-axis will be determined by figratio.
-
figratio
(str or float
, default:None
) –Set ratio of figsize x:y to 1:1/'option', where 'option' is one of
['sqrt(2)', 'golden', 'sqrt(3)']
or any number. Golden stands for the golden ratio (1.618). This option is ignored if figsize is used with tuple. -
mode
(str
, default:None
) –One of the following modes:
'default'
: use matplotlib defaults'beamer'
: extra large fontsize'print'
: default sizes'poster'
: for Din A0 posters -
style
(str
, default:None
) –One of the following styles:
'default'
: enables grid and upper and right spines'minimal'
: removes all unneeded lines'none'
: no changes to style -
ipython
(bool
, default:None
) –Deactivate high-res in jpg/png for compatibility with IPyhton, e.g. jupyter notebook/lab.
-
true_black
(bool
, default:None
) –If true black will be used for labels and co., else a dark grey.
-
latex
(bool
, default:None
) –If true LaTeX font will be used.
-
sf
(bool
, default:None
) –Use sans-serif font for text and latex math environment.
Source code in src/prettypyplot/style.py
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
use_style(interactive=None, colors='pastel5', cmap='macaw', ncs=10, figsize=(3,), figratio='golden', mode=_pplt.MODE, style=_pplt.STYLE, ipython=False, true_black=False, latex=True, sf=False)
¶
Define alternative matplotlib style.
This function restores first the matplolib default values and finally changes depicted values to achieve a more appealing appearence. It additionally loads pplts colormaps and colors in matplolib.
See update_style for parameters.
Source code in src/prettypyplot/style.py
203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 |
|