Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

filledContour does not work with plot.axes arguments #255

Open
brotherJ4mes opened this issue Mar 4, 2022 · 0 comments
Open

filledContour does not work with plot.axes arguments #255

brotherJ4mes opened this issue Mar 4, 2022 · 0 comments

Comments

@brotherJ4mes
Copy link

brotherJ4mes commented Mar 4, 2022

The help page for filledContour states that it can take "Any argument that can be passed to filled.contour (graphics package)"
However, I'm finding that it does not respect several arguments, including the plot.axes argument.

For example, in the case of trying to overlay contour lines on a filled contour plot, using graphics::filled.contour works as desired

filled.contour(volcano, plot.axes={contour(volcano, add=T)})

whereas, if I try to create a simple raster from volcano and try to use the raster analog method to overlay the lines:

ras_volc <- raster(volcano)
raster::filledContour(ras_volc, plot.axes={contour(ras_volc, add=T)})

No lines are overlaid. Additionally, I've found that some other arguments like key.title will work for graphics::filled.contour but not for raster::filledContour.

There are certainly other ways to achieve the desired result but the filledContour graphic looks the best in my opinion and it seems that it should be straight forward to do it this way ;)

If anyone can provide any insight into this issue would be greatly appreciated.

Note: If I plot a much larger raster this way to an X11 window, I can see the contour lines being drawn first for a fraction of a second but then the entire image is replaced with the filledContour plot, so it appears that it's trying to parse the plot.axes argument but it's not working the way it does with graphics::filled.contour

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant