Passed
Push — master ( 5fe8ad...12869f )
by Stefan
05:14
created

sciapy.plot_setup.plot_setup()   A

Complexity

Conditions 1

Size

Total Lines 29
Code Lines 26

Duplication

Lines 29
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 26
nop 0
dl 29
loc 29
rs 9.256
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
2
# vim:fileencoding=utf-8
3
#
4
# Copyright (c) 2018 Stefan Bender
5
#
6
# This module is part of sciapy.
7
# sciapy is free software: you can redistribute it or modify
8
# it under the terms of the GNU General Public License as published
9
# by the Free Software Foundation, version 2.
10
# See accompanying LICENSE file or http://www.gnu.org/licenses/gpl-2.0.html.
11
"""Matplotlib figure set up
12
"""
13
14
from matplotlib import rcParams
15
16
__all__ = ["plot_setup", "GRID_STYLE", "LINE_SPINES", "LINE_TICKS"]
17
18
GRID_STYLE = {"axes.grid": True,
19
		"axes.grid.axis": "y",
20
		"grid.alpha": 0.5}
21
22
LINE_SPINES = {"axes.spines.left": True,
23
		"axes.spines.bottom": True}
24
25
LINE_TICKS = {"xtick.top": False,
26
		"ytick.right": False}
27
28
29 View Code Duplication
def plot_setup():
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
Coding Style introduced by
This function should have a docstring.

The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:

class SomeClass:
    def some_method(self):
        """Do x and return foo."""

If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.

Loading history...
30
	rcParams["figure.dpi"] = 96
31
	rcParams["figure.figsize"] = [8, 5]
32
	rcParams["figure.constrained_layout.use"] = True
33
	rcParams["font.size"] = 16
34
	rcParams['mathtext.default'] = 'regular'
35
	rcParams['savefig.dpi'] = 600
36
	rcParams['pdf.compression'] = 0
37
	rcParams['axes.linewidth'] = 1.5
38
	rcParams['lines.linewidth'] = 1.5
39
	# visible ticks
40
	rcParams["xtick.minor.visible"] = True
41
	rcParams["ytick.minor.visible"] = True
42
	rcParams["xtick.top"] = True
43
	rcParams["ytick.right"] = True
44
	# tick sizes and padding
45
	rcParams["xtick.major.width"] = 1.5
46
	rcParams["xtick.major.size"] = 6
47
	rcParams["xtick.major.pad"] = 8
48
	rcParams["ytick.major.width"] = 1.5
49
	rcParams["ytick.major.size"] = 6
50
	rcParams["ytick.major.pad"] = 8
51
	rcParams["xtick.minor.size"] = 3
52
	rcParams["ytick.minor.size"] = 3
53
	# turn off axis spines
54
	rcParams["axes.spines.left"] = False
55
	rcParams["axes.spines.bottom"] = False
56
	rcParams["axes.spines.top"] = False
57
	rcParams["axes.spines.right"] = False
58