Skip to content

Commit

Permalink
minor modifications to plot
Browse files Browse the repository at this point in the history
  • Loading branch information
dkahle committed Sep 27, 2024
1 parent 968fa6e commit 69813ae
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
20 changes: 12 additions & 8 deletions R/plot.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Plot the variety
#' Plot the (real) variety of a polynomial
#'
#' Determine all r-vectors with nonnegative integer entries summing to n. Note
#' that this is not intended to be optimized.
#' The variety must have only 2 variables; it is plotted over a finite window;
#' and it will not discover zero-dimensional components.
#'
#' @param x an mpoly object
#' @param xlim,ylim numeric(2) vectors; x and y limits
Expand All @@ -18,24 +18,28 @@
#' @return [NULL]
#' @examples
#'
#' p <- mp("x^2 + 16 y^2 - 1")
#' p <- mp("x^2 + y^2 - 1")
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1))
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1), asp = 1)
#'
#' p <- mp("x^2 + 16 y^2 - 1")
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1))
#'
#' p <- mp("u^2 + 16 v^2 - 1")
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1), asp = 1)
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1))
#'
#' p <- mp("v^2 + 16 u^2 - 1")
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1), asp = 1)
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1))
#'
#' p <- mp("u^2 + 16 v^2 - 1")
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1), varorder = c("v","u"), asp = 1)
#' plot(p, xlim = c(-1, 1), ylim = c(-1, 1), varorder = c("v","u"))
#'
#' p <- mp("y^2 - (x^3 + x^2)")
#' plot(p, xlim = c(-1.5, 1.5), ylim = c(-1.5, 1.5))
#'
#' plot(lissajous(3, 3, 0, 0), xlim = c(-1, 1), ylim = c(-1, 1), asp = 1)
#' plot(lissajous(5, 5, 0, 0), col = "red", add = TRUE)
#'
#'
#'
plot.mpoly <- function(x, xlim, ylim, varorder, add = FALSE, n = 251, nx = n, ny = n, f = 0.05, col = "#3366FF", ...) {

Expand Down
18 changes: 11 additions & 7 deletions man/plot.mpoly.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 69813ae

Please sign in to comment.