View source: R/plot_vector_2d.R
plot_vector_2d | R Documentation |
Function plots one or more arrowed vectors across a 2d plotting space. Options are provided to add an x-y axis
and a grid. Either the from_to
or to
arguments may be specified to populate the plot.
plot_vector_2d( from_to = NULL, to = NULL, vector_labels = NULL, vector_colors = NULL, vector_widths = NULL, vector_linetypes = NULL, draw_axis = TRUE, axis_color = "black", grid_color = "lightgreen", lines_00_color = "darkgreen", x_breaks = c(-5, 5, 1), y_breaks = c(-5, 5, 1), x_title = "X", y_title = "Y", char_mag = 1.5 )
from_to |
A n x 4 numeric matrix that defines n vectors where the first two columns define the x/y "from" point and the last two columns define the x/y "to" point of each vector. |
to |
An n x 2 numeric matrix that defines n vectors where the x/y "from" point is assumed to be
at the origin |
vector_labels |
A vector of strings with the same length as |
vector_colors |
A vector of strings with the same length as |
vector_widths |
A numeric vector with the same length as |
vector_linetypes |
A vector of strings with the same length as |
draw_axis |
A logical which if TRUE, draws the numeric x/y axis'. |
axis_color |
A string that defines the axis color. |
grid_color |
A string that defines the grid color. |
lines_00_color |
A string that defines the color for vertical/horizontal lines from (0,0). |
x_breaks |
A numeric three element vector of upper, lower, and interval for exact x axis tic locations. |
y_breaks |
A numeric three element vector of upper, lower, and interval for exact y axis tic locations. |
x_title |
A string that sets the x axis title. |
y_title |
A string that sets the y axis title. |
char_mag |
A numeric that defines the magnification of the vector's label size. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.