VectorPlotDigitizer
Documentation for VectorPlotDigitizer.
VectorPlotDigitizer.binedges_to_bin_midpoints
— Methodbinedges_to_bin_midpoints(data; zero_threshold::Real = 0.0, atol::Real= 0.0)
Transforms a set of points that delimits the vertexes of a binned plot into a set of points for each bin mid point value.
data
must be two-column array of numbers that delimit some bin vertexes. The function will detect a bin when two consecutive values of the y axis are not vertical. In such case it will compute the midpoint value of the x axis and take that y axis value.
If a value of zero_threshold
different than 0
is given, then every detected bin with a y value y < zero_threshold
will be considered as 0.0
.
If a value of atol
is provided, this will be taken as the absolute tolerance in the isapprox
method that checks if two points are a straigth vertical line or not. Higher values of atol
may give undesired results.
VectorPlotDigitizer.fill_zeros_bins
— Methodfill_zeros_bins(real_xs, xs, ys, atol; zero_threshold::Real = 0.0)
Given some digitized binned data, where xs
are the the bins x axis midpoints and ys
are the corresponding values on the y axis, this function fills with zeros the missing bins.
The complete set of bins is given by real_xs
and atol
is the absolute tolerance to use when comparing whether a given element of xs
is inside of ys
or not. Smaller values of atol
will make less values of xs
to be found inside real_xs
.
If a value of zero_threshold
different than 0
is given, then every bin with a y value y < zero_threshold
will be considered as 0.0
.
Examples
Given the following real_x
bins and the digitized x_bins
and y_bins
:
julia> real_bins = [0.5, 1.5, 2.5, 3.5]
+Home · VectorPlotDigitizer.jl VectorPlotDigitizer
Documentation for VectorPlotDigitizer.
VectorPlotDigitizer.binedges_to_bin_midpoints
— Methodbinedges_to_bin_midpoints(data; zero_threshold::Real = 0.0, atol::Real= 0.0)
Transforms a set of points that delimits the vertexes of a binned plot into a set of points for each bin mid point value.
data
must be two-column array of numbers that delimit some bin vertexes. The function will detect a bin when two consecutive values of the y axis are not vertical. In such case it will compute the midpoint value of the x axis and take that y axis value.
If a value of zero_threshold
different than 0
is given, then every detected bin with a y value y < zero_threshold
will be considered as 0.0
.
If a value of atol
is provided, this will be taken as the absolute tolerance in the isapprox
method that checks if two points are a straigth vertical line or not. Higher values of atol
may give undesired results.
sourceVectorPlotDigitizer.fill_zeros_bins
— Methodfill_zeros_bins(real_xs, xs, ys, atol; zero_threshold::Real = 0.0)
Given some digitized binned data, where xs
are the the bins x axis midpoints and ys
are the corresponding values on the y axis, this function fills with zeros the missing bins.
The complete set of bins is given by real_xs
and atol
is the absolute tolerance to use when comparing whether a given element of xs
is inside of ys
or not. Smaller values of atol
will make less values of xs
to be found inside real_xs
.
If a value of zero_threshold
different than 0
is given, then every bin with a y value y < zero_threshold
will be considered as 0.0
.
Examples
Given the following real_x
bins and the digitized x_bins
and y_bins
:
julia> real_bins = [0.5, 1.5, 2.5, 3.5]
4-element Vector{Float64}:
0.5
1.5
@@ -24,4 +24,4 @@
34.7
0.0
0.0
- 0.0
Notes
A warning is given if the absolute tolerance is very small. This means that the function is filling with more zeros than needed and some ys values are not taken into account. This warning has nothing to do whether we set a high zero_threshold
value or not.
sourceSettings
This document was generated with Documenter.jl version 1.2.1 on Monday 18 December 2023. Using Julia version 1.9.4.
+ 0.0
Notes
A warning is given if the absolute tolerance is very small. This means that the function is filling with more zeros than needed and some ys values are not taken into account. This warning has nothing to do whether we set a high zero_threshold
value or not.