Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8011763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:06:40+00:00 2026-06-04T19:06:40+00:00

I am running 64-bit R 2.15.0 on a Windows Server 2008 R2 Amazon EC2

  • 0

I am running 64-bit R 2.15.0 on a Windows Server 2008 R2 Amazon EC2 instance. grid does not produce output. For example, the following code should produce a single diagonal line in a device window:

grid.newpage()
l <- linesGrob()
grid.draw(l)

I, however, see nothing. Is there a flag or option I should be using on Windows Server 2008 R2 to enable grid output?

EDIT: Another reproducible example that works on my home (Windows 7 x64) and work PCs (Windows XP):

library(grid)
library(png)

img.path <- system.file("img", "Rlogo.png", package="png")
bg <- readPNG(img.path)
background <- rasterGrob(unclass(bg))

grid.draw(background)

This is the expected output, as seen on my work PC (resized to fit below):

R-log-png

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:06:41+00:00Added an answer on June 4, 2026 at 7:06 pm

    R does not produce raster images correctly in the window device over Remote Desktop Connection. If a raster image is required, the plot must be output to another device.

    library(ggplot2)
    library(grid)
    library(maps)
    library(mapproj)
    library(png)
    library(RgoogleMaps)
    
    counties <- map_data("county", region="virginia")
    states <- map_data("state")
    
    tmp <- tempfile(fileext=".png")
    bg <- GetMap.bbox(range(counties$long), range(counties$lat), destfile=tmp, 
         maptype="satellite", format="png32")
    background <- readPNG(tmp)
    background <- rasterGrob(unclass(background))
    
    p <- ggplot(counties, aes(long, lat)) +
       coord_map(xlim=c(bg$BBOX$ll[2], bg$BBOX$ur[2]), 
                 ylim=c(bg$BBOX$ll[1], bg$BBOX$ur[1])) +
       geom_path(aes(group=group), color="darkgrey") +
       geom_path(data=states, aes(group=group), color="white", size=1) +
       opts(axis.line=theme_blank(),
            axis.text.x=theme_blank(),
            axis.text.y=theme_blank(),
            axis.ticks=theme_blank(),
            axis.title.x=theme_blank(),
            axis.title.y=theme_blank(),
            axis.ticks.length=unit(0, "lines"),
            axis.ticks.margin=unit(0, "lines"),
            panel.border=theme_blank(),
            panel.background=function(...)background,
            panel.grid.major=theme_blank(),
            panel.grid.minor=theme_blank(),
            panel.margin=unit(0, "lines"),
            legend.position="none",
            legend.title=theme_blank(),
            legend.background=theme_blank(),
            plot.margin=unit(0*c(-1.5, -1.5, -1.5, -1.5), "lines"))
    
    pdf("plot.pdf", height=7, width=7)
    p
    dev.off()
    

    I have found that writing plotting commands between the pdf() and dev.off() produces blank files. Storing the plot in an object and calling it will work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am running a very simple vbs file on windows server 2008 32 bit
I have a client, who is running Windows 2008 Server 64 bit. He is
System is Windows Server 2008 R2 Enterprise 64 bit Running Microsoft SQL Server 2008
The Windows SDK for Server 2008 does not include Inspect.exe. Does anyone know where
The same setup works on Windows 7 / 64 Bit and Windows Server 2008
I am running PHP on a 64bit windows 2008 server. I have both ODBC
We are deploying our ASP.Net MVC application to a windows 2008 R2 server, running
Running php 5.2.5 on Windows Server 2003 (64 bit) and connecting to SQL Server
I have a freshly built 64-bit Windows Server 2008 R2 box that I have
I'm using Visual Studio 2008 (on Windows 2003 Server / 32 bit) to compile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.