This update brings many improvements to autoplot()
methods. These include enhanced capabilities for handling of normalized and scaled spectral data, as well as cosmetic tweaks to labels. It also tracks changes in packages ‘ggrepel’ (>= 0.9.1), ‘photobiology’ (>= 0.10.10) and ‘ggplot2’ (>= 3.3.3) and deprecation of functions in ‘tidyr’ (>= 1.0.0). The updated code depends on the revised normalize()
function in ‘photobiology’ (>= 0.10.10) and on ‘ggrepel’ (>= 0.9.1).
autoplot()
methods to support on-the-fly normalization internally using photobiology::normalize()
.autoplot()
methods for source_spct
, response_spct
, filter_spct
, reflector_spct
, source_mspct
, response_mspct
, filter_mspct
, and reflector_mspct
so that if the data are already normalized, by default the normalization is updated according to the arguments passed to unit.out
or plot.qty
and range
. (Update is possible only for objects normalized with ‘photobiology’ (>= 0.10.7). For objects created with earlier versions, the old behaviour of plotting spectra as is remains unchanged.)autoplot()
method for object_mspct
to force use of facets when plot.qty = "all"
instead of forcing plotting of transmittance only.autoplot()
method for object_mspct
to correctly handle normalization of collections of spectra, one spectrum at a time, correcting a bug.autoplot()
methods to generate shorter y-axis labels also improving reporting of scaling and normalization when needed.autoplot()
methods to fix bug leading to bad object name in plot title due to delayed evaluation.autoplot.cps_mspct()
and autoplot.raw_mspct()
methods.autoplot()
methods for collections of spectra.autoplot()
methods for collections of spectra adding support for sum
, prod
, var
, sd
, and se
as summaries. The support for these summaries depends on autoplot.generic_spct()
which is still experimental and subject to change.decoration()
to track changes in ‘ggrepel’ (>= 0.9.1).decoration()
to use position_nudge()
and position_nudge_repel()
to displace labels instead of “off-range” justification.ggplot()
methods and by autotitle()
.autoplot()
methods an explanation of how to modify the default plot annotations and tittles using arguments passed to parameter annotations
. Also add see also links to related help pages.autoplot()
methods have changed, in most cases only cosmetically to shorten them. In a few cases more significant edits correct problems.stat_wl_strip()
performance by simplifying data before plotting.scale_y_Afr_continuous()
for absorptance spectra.scale_y_mult_continuous()
for calibration spectra.autoplot()
methods to generate more compact axis labels (preliminary).autoplot.source_spct()
method to to natively support facets (partial).stat_wb_box()
adding parameter box.height (default behavior unchanged).stat_wl_strip()
draws fewer rectangles (in most cases these changes are barely visible).ggplot()
method for class object_spct.stat_spikes()
, useful for highlighting spikes.stat_find_wls()
using photobiology::wls_at_target()
."wls"
and "wls.labels"
in all autoplot()
methods.Although this update should not break any code, the plots created will in many cases differ from those created with earlier versions. Changes only affect the text of labels.
"data"
member of the "gg"
object. This allows use of methods specific to spectra in data transformations.set_annotations_default()
and set_w.band_default()
.autoplot()
methods.multiplot()
for adding a title to the composite figure.autoplot()
methods. Make autotitle() a synonim of ggtitle_spct()
, which is now deprecated."how.measured"
attribute in plot titles, subtitles and captions.stat_wb_label()
, stat_wb_box()
and stat_wl_strip()
, solving a bug affecting autoplot()
methods when called with multiple spectra.autoplot()
methods as replacements for plot()
methods, which are now deprecated. All documentation now uses autoplot()
.autoplot()
and the expected returned value is a ggplot which matches the returned value of the methods defined here, we have renamed them to autoplot()
. For backwards compatibility plot()
methods remain available, but their use in new code is deprecated.plot()
methods for source_spct
and response_spct
classes, that triggered errors in all cases when time.unit
was not "second"
.scale_y_s.e.irrad_log10()
and scale_y_s.q.irrad_log10()
.Change the names of some the values calculated by the stats defined in ‘ggspectra’ to avoid confusion with the names of ‘ggplot2’ aesthetics. This is a code breaking change!
Revise to track changes in ‘photobiology’ version 0.9.24 and ‘ggplot2’ 3.0.0, which are now required.
stat_label_peaks()
and stat_label_valleys()
now have a new parameter, label.fill
which can be used to set the content of ..x.label..
and ..y.label..
for labels not labeled as peaks or valleys. The earlier use of ""
is retained as default.stat_find_wls()
and stat_find_qtys()
, two new statistics useful for highlighting and labeling features in spectra.ylim
to all plot()
methods.plot()
methods to support objects with multiple spectra in long form.plot()
methods to NOT display by default calculated summaries in annotations when a plot contains multiple spectra.plot()
methods to retrieve and validate the name of the factor used to identify multiple spectra, using as default the value stored in the attribute "idfactor"
implemented in ‘photobiology’ 0.9.21 and later.autoplot()
as an alias of plot()
for spectra and collections of spectra.Revise to track changes in ‘photobiology’ 0.9.20 to avoid spurious messages.
Add ggplot()
method specialization for collections of spectra.
Add plot()
method specializations for collections of spectra.
Track changes in package ‘photobiology’ 0.9.18.
Add plot.calibration_spct().
Add ggplot.calibration_spct()
.
Improve handling of plot titles.
Add utility function ggtitle_spct()
.
Update all plot()
methods to allow flexible contents in automatic titles including setting of the time zone and format used for displaying time.
Track changes in package ‘photobiology’ 0.9.16 and 0.9.17. This among other improvements makes it easy to plot spectral absorptance. Expand y scale to expected range in all cases, but do not force these limits in any case when data exceeds them, except for absorbance for which the y scale is not expanded past 6 a.u. Add new annotation "boundaries"
to highlight with horizontal line(s) the expected range of the plotted quantity, highlighting the limit(s) exceeded if data fall outside the expected/range. Add previously missing ggplot()
method for class object_spct
. Revise vignettes.
Track changes in package ‘photobiology’ 0.9.14. Add continuous scales with defaults suitable for spectral data, with support for automatic axis labels both as R-expressions and as LaTeX mark-up. Add utility functions for SI scale prefixes. Add utility functions for x-axis-labels and secondary x-axis. Add utility functions for y-axis-labels. Update User Guide (add examples of graphical comparison of multiple lists of wavebands).
Improve handling of annotations parameter in plot()
methods. Add functions ggcolorchart()
and black_or_white()
. Add statistics stat_wb_box()
and stat_wb_column()
with "rect"
as default geom and stat_wb_hbar()
with "errorbarh"
as default geom. Change default geom from "rect"
to "text"
in all the summary stats for spectra. Update stats with “text” as default geom to use an additional variable BW.color
computed by black_or_white()
as default mapping for color. As default geoms and color mapping have changed, this update can break existing code. Changes to plot()
methods are backwards compatible but default color of some text labels is changed from "white"
to "black"
to improve readability, and fewer peaks and valleys are highlighted by default. In addition more ticks marks are used on the wavelength axis. Fix minor bugs in handling of color mapping. Update documentation.
Import ‘ggplot2’ in whole as only the most basic use of plot()
methods would not require user access to ‘ggplot2’. Add stat_label_peaks()
and stat_label_valleys()
which are designed to fully take advantage of geom_text_repel()
and geom_label_repel()
as revised in package ‘ggrepel’ (>= 0.6.3). Change behaviour of plot()
methods so that “illegal” values such as negative spectral irradiances or transmittances are plotted by default. Fix several minor bugs affecting plot()
methods with certain non-default sets of annotations. Improve documentation and vignettes.
Add code to maintain same stacking order under ‘ggplot2’ 1.1.0, 2.0.0, 2.1.0, and 2.1.9000 in plot.object_spct()
.
Add support for na.rm
to all plot()
methods setting default to TRUE
, and avoid triggering spurious warnings from internal code. Make default for parameter label.qty
in plot methods dependent on whether data are expressed in absolute units or have been rescaled or normalized. Move from the ‘User Guide’ the sections on plot()
methods creating a new vignette titled ‘Plot Methods’.
Add support for plot.qty = "absorptance"
to plot.filter_spct().
Add support for plot.qty
to plot.object_spct()
with possible values: "all"
or NULL
(previous behaviour, and current default), "transmittance"
, "absorbance"
, "absorptance"
, and "reflectance"
. The new options plot only one quantity at a time as a line instead of the default area plot.
Add stat_wb_label()
, stat_wb_e_irrad()
, stat_wb_q_irrad()
, stat_wb_e_sirrad()
, and stat_wb_q_irrad()
. Revise plot.raw_spct()
to handle multiple "counts"
columns. Revise plot.cps_spct()
to handle multiple "cps"
columns. Add text.size
parameter to all plot()
methods. Can be used to control the size of the font used for text decorations related to wavebands, peaks and valleys. Increase slightly the default font size for plot decorations, and decrease the number of peaks and valleys labelled by the plot()
methods. Fix existing bug revealed by dplyr update. Fix bug in decoration()
affecting plot.object_spct()
. Fix other minor bugs.
(First CRAN release)
Clean documentation and code for CRAN submission. Add examples of plotting of waveband objects as these were removed from the vignette of package ‘photobiologyWavebands’.
Fix bug in documentation.
Improve documentation.
Remove wb_guide()
. Remove wb_wb_summary()
. Add stat_wb_mean()
, stat_wb_total()
, stat_wb_contribution()
, stat_wb_relative()
. Add stat_wb_irrad()
, stat_wb_sirrad()
Implement 100% of the old functionality of the plot()
methods, but without using any annotations. In other words, now all calculations work as expected with grouping and panels. Some aesthetics may require tweaking in the case of grouping.
Tested with packages ‘ggrepel’ and ‘cowplot’.
Add text explaining examples to User Guide.
Rename several stats and functions with more descriptive names.
stat_color_guide()
-> stat_wl_strip()
stat_average()
-> stat_wl_summary()
stat_waveband()
-> stat_wb_summary()
color_guide()
-> wl_guide()
waveband_guide()
-> wb_guide()
Add multiplot()
function (unchanged from package photobiologygg). Improve stat_waveband()
. Add color_guide()
, waveband_guide()
.
Add ggplot()
methods for spectra, which use default mappings if mapping not explicitly supplied as argument to call.
Make plot()
methods almost fully functional. "contribution"
and "participation"
summary values not yet implemented. Neither summaries for BSWFs. If requested these summaries will show as NaN
(not a number) in the plots.
First preview version. Still with incomplete functionality.