Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
b7e72f87
Commit
b7e72f87
authored
2 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
Add option to pas existing axis object to the plot function
parent
788cd7fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!685
Release 2.4
,
!684
Release 2.4
,
!597
Add option to pas existing axis object to the plot function
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-0
1 addition, 0 deletions
CHANGELOG.md
saqc/funcs/tools.py
+5
-5
5 additions, 5 deletions
saqc/funcs/tools.py
saqc/lib/plotting.py
+13
-9
13 additions, 9 deletions
saqc/lib/plotting.py
with
19 additions
and
14 deletions
CHANGELOG.md
+
1
−
0
View file @
b7e72f87
...
...
@@ -10,6 +10,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
[
List of commits
](
https://git.ufz.de/rdm-software/saqc/-/compare/v2.2.1...develop
)
### Added
-
add option to not overwrite existing flags to
`concatFlags`
-
add option to pass existing axis object to
`plot`
### Changed
-
Remove all flag value restrictions from the default flagging scheme
`FloatTranslator`
-
Renamed
`TranslationScheme.forward`
to
`TranslationScheme.toInternal`
...
...
This diff is collapsed.
Click to expand it.
saqc/funcs/tools.py
+
5
−
5
View file @
b7e72f87
...
...
@@ -234,6 +234,7 @@ class ToolsMixin:
xscope
:
Optional
[
slice
]
=
None
,
phaseplot
:
Optional
[
str
]
=
None
,
store_kwargs
:
Optional
[
dict
]
=
None
,
ax
:
mpl
.
axes
.
Axes
|
None
=
None
,
ax_kwargs
:
Optional
[
dict
]
=
None
,
dfilter
:
float
=
FILTER_NONE
,
**
kwargs
,
...
...
@@ -297,7 +298,6 @@ class ToolsMixin:
"""
data
,
flags
=
self
.
_data
.
copy
(),
self
.
_flags
.
copy
()
interactive
=
path
is
None
level
=
kwargs
.
get
(
"
flag
"
,
UNFLAGGED
)
if
dfilter
<
np
.
inf
:
...
...
@@ -309,9 +309,8 @@ class ToolsMixin:
if
ax_kwargs
is
None
:
ax_kwargs
=
{}
if
interactive
:
if
not
path
:
mpl
.
use
(
_MPL_DEFAULT_BACKEND
)
else
:
mpl
.
use
(
"
Agg
"
)
...
...
@@ -324,13 +323,14 @@ class ToolsMixin:
history
=
history
,
xscope
=
xscope
,
phaseplot
=
phaseplot
,
ax
=
ax
,
ax_kwargs
=
ax_kwargs
,
)
if
interactiv
e
:
if
ax
is
Non
e
:
plt
.
show
()
else
:
if
path
:
if
store_kwargs
.
pop
(
"
pickle
"
,
False
):
with
open
(
path
,
"
wb
"
)
as
f
:
pickle
.
dump
(
fig
,
f
)
...
...
This diff is collapsed.
Click to expand it.
saqc/lib/plotting.py
+
13
−
9
View file @
b7e72f87
...
...
@@ -6,6 +6,8 @@
# -*- coding: utf-8 -*-
from
__future__
import
annotations
import
itertools
from
typing
import
Optional
,
Union
...
...
@@ -58,11 +60,12 @@ def makeFig(
field
:
str
,
flags
:
Flags
,
level
:
float
,
max_gap
:
Optional
[
str
]
=
None
,
history
:
Union
[
Optional
[
Literal
[
"
valid
"
,
"
complete
"
]],
list
]
=
"
valid
"
,
xscope
:
Optional
[
slice
]
=
None
,
phaseplot
:
Optional
[
str
]
=
None
,
ax_kwargs
:
Optional
[
dict
]
=
None
,
max_gap
:
str
|
None
=
None
,
history
:
Literal
[
"
valid
"
,
"
complete
"
]
|
None
|
list
[
str
]
=
"
valid
"
,
xscope
:
slice
|
None
=
None
,
phaseplot
:
str
|
None
=
None
,
ax
:
mpl
.
axes
.
Axes
|
None
=
None
,
ax_kwargs
:
dict
|
None
=
None
,
):
"""
Returns a figure object, containing data graph with flag marks for field.
...
...
@@ -152,9 +155,10 @@ def makeFig(
d
=
_insertBlockingNaNs
(
d
,
max_gap
)
# figure composition
fig
=
mpl
.
pyplot
.
figure
(
constrained_layout
=
True
,
**
FIG_KWARGS
)
grid
=
fig
.
add_gridspec
()
ax
=
fig
.
add_subplot
(
grid
[
0
])
if
ax
is
None
:
fig
=
mpl
.
pyplot
.
figure
(
constrained_layout
=
True
,
**
FIG_KWARGS
)
grid
=
fig
.
add_gridspec
()
ax
=
fig
.
add_subplot
(
grid
[
0
])
_plotVarWithFlags
(
ax
,
...
...
@@ -172,7 +176,7 @@ def makeFig(
)
plt
.
rcParams
[
"
font.size
"
]
=
default
return
fig
return
ax
.
figure
def
_plotVarWithFlags
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment