[plotter] add xtransform
This commit is contained in:
@@ -987,6 +987,7 @@ class Plotter(Aggregator, BaseProcessor):
|
|||||||
yunit=None,
|
yunit=None,
|
||||||
xunit_coeff=1.0,
|
xunit_coeff=1.0,
|
||||||
yunit_coeff=1.0,
|
yunit_coeff=1.0,
|
||||||
|
xtransform=None,
|
||||||
ytransform=None,
|
ytransform=None,
|
||||||
xscale="linear",
|
xscale="linear",
|
||||||
yscale="linear",
|
yscale="linear",
|
||||||
@@ -1093,9 +1094,17 @@ class Plotter(Aggregator, BaseProcessor):
|
|||||||
if isinstance(yerr, str):
|
if isinstance(yerr, str):
|
||||||
yerr = self.save.get_node(yerr).read()
|
yerr = self.save.get_node(yerr).read()
|
||||||
|
|
||||||
|
# Apply transformations on x
|
||||||
|
if xtransform is not None:
|
||||||
|
x = xtransform(x)
|
||||||
|
|
||||||
# Apply transformations on y
|
# Apply transformations on y
|
||||||
if ytransform is not None:
|
if ytransform is not None:
|
||||||
y = ytransform(y)
|
y = ytransform(y)
|
||||||
|
if yerr is not None:
|
||||||
|
self._log(
|
||||||
|
"Errorbar may be meaning less when ytransform is used", "WARNING"
|
||||||
|
)
|
||||||
if smooth > 0:
|
if smooth > 0:
|
||||||
y = gaussian_filter1d(y, sigma=smooth)
|
y = gaussian_filter1d(y, sigma=smooth)
|
||||||
if run is not None:
|
if run is not None:
|
||||||
|
|||||||
Reference in New Issue
Block a user