View source: R/barplot_stacked.r
barplot_stacked | R Documentation |
Stacked barplot developed for plotting landings data by fleet and year
barplot_stacked(
data,
units,
unit_scale = 1,
ylab = "y-axis label",
plot_prop_text = TRUE,
prop_digits = 2,
xlabBy = 5,
leg_title = "",
leg_bty = "n",
...
)
data |
data frame object. Intended for rows (x-axis) to be years, columns (groups) to be fleets, and values (y-axis) to be landings, discards, etc. |
units |
Text for printing the scale of values in ylab (e.g. fish, lb). character vector |
unit_scale |
Allows you to provide a numeric value to scale the values for plotting |
ylab |
y-label for plot. Note that if unit_scale!=0 then the value of unit_scale will be appended to the y-axis label. |
plot_prop_text |
should text be added to the plot indicating what proportion of the total values (sum(data)) are in each group? logical |
prop_digits |
Number of digits to display if plot_prop_text==TRUE |
xlabBy |
Specify frequency for plotting values along x-axis (e.g. 1, 5, 10) |
leg_title |
Title text for labeling legend. character vector |
leg_bty |
Pass to argument |
Nikolai Klibansky
## Not run:
barplot_stacked(rdat_BlackSeaBass$N.age,units="fish",unit_scale = 1e6,ylab="N",leg_title = "Age")
barplot_stacked(rdat_BlackSeaBass$N.age/1e6,units="million fish",ylab="N",leg_title = "Age")
barplot_stacked(rdat_BlackSeaBass$N.age/1e6,units="million fish",ylab="N",plot_prop_text=FALSE,leg_bty = "o")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.