Solve the problem of "plot.new (): Figure margins too large" in Rstudio

Source: Internet
Author: User

The "plot.new (): Figure margins too large" issue often occurs when plotting using the plot () function in Rstudio. (1) is shown.


The problem occurs because the "plots" window in the Rstudio is too small to fit properly, or to set the Rstudio to full screen. The steps to resolve are as follows.
1. Select the "Plots" tab with the mouse, and then drag the window a little larger, as shown in (2).
   Figure (2) Drag the "Plots" window large
2. Test code
Data source Drink.txt

IndexHeat caffeine Na Price1   207.2   3.3 15.5    2.82   36.8    5.9 12.9    3.33   72.2    7.3 8.2 2.44   36.7    0.4 10.5    4.05   121.7   4.1 9.2 3.56   89.1    4.0 10.2    3.37   146.7   4.3 9.7 1.88   57.6    2.2 13.6    2.19   95.9    0.0 8.5 1.3Ten  199.0   0.0 10.6    3.5 One  49.8    8.0 6.3 3.7 A  16.6    4.7 6.3 1.5 -  38.5    3.7 7.7 2.0 -  0.0 4.2 13.1    2.2 the  118.8   4.7 7.2 4.1 -  107.0   0.0 8.3 4.2

  
Ceshi. R

Drink <-Read. Table ("G:/myproject/rdoc/unit3/rchap1/drink.txt", Header = T) drink <-drink[,-1]d=dist (drink) hc1=hclust (d,method="Ward. D2 ")#离差平方和法Hc2=hclust (d,method="single")#最短距离法Hc3=hclust (d,method="Complete")#最长距离法Hc4=hclust (d,method="Median")#中间距离法Opar=par (Mfrow=c (2,2))#分割绘图区域Plot (hc1,hang=-1);p Lot (hc2,hang=-1);p Lot (hc3,hang=-1);p Lot (hc4,hang=-1) par (OPAR)#释放绘图区域分割

The effect is as follows:

Figure (3) after the "Plots" window is enlarged, the effect of drawing is

Solve the problem of "plot.new (): Figure margins too large" in Rstudio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.