2009-12-13 4 views
16

R의 앤티 앨리어싱 내가 내 qplot 후 다음 명령을 사용하여 앤티 앨리어싱 이미지 파일로 내 출력을 저장할 수 있습니다 알고 qplot 명령을하고 있어요qplot 내가 ggplot2 라이브러리를 사용하고

ggsave(file="filename.png") 

하지만 내 LCD 디스플레이는 어떻습니까? 앤티 앨리어싱 된 grpah로 모니터에 음모를 볼 수있는 방법이 있습니까?

+0

나는 그것이 당신과 창 관리자 사이에 있다고 생각합니다. –

+7

내 플롯 창을 앤티 앨리어스로 알리는 방법이 있습니까? – Mark

답변

13

Windows에서는 기본 제공되는 앤티 앨리어싱이 없습니다. 향후 출시를 계획하고 있는지 여부는 알 수 없습니다. cairoDevice 또는 Cairo 패키지에서 카이로 기반 그래픽 장치를 얻을 수 있습니다. 또 다른 옵션은 JGR (http://jgr.markushelbig.org/)을 통해 자바 기반의 그래픽을 사용하는 것입니다

다운로드 및 http://gladewin32.sourceforge.net/

에서 Gtk+ 2.12.9 Runtime Environment Revision 2를 설치하지만, 먼저 GTK+를 설치해야합니다. 또한 Qt 기반 장치가 개발 중에 있다고 생각합니다.

+0

환상적입니다, 정말 고마워요 – Mark

+2

Windows 7에서 R 3.1.1 64 비트 GTK +를 설치하지 않고도 카이로를 설치했습니다. 앤티 앨리어싱이 좋습니다. – jnm2

3

좋아, 방금 확인했습니다. 나는 이전의 코멘트에서 틀렸다. help(x11)에서 세부 사항을 많이 사용할 수 있습니다 곳 - 새로운 카이로 기반 장치를 사용할 앤티 앨리어싱이 수행

X11 패키지 : grDevices R 문서

X 윈도우 시스템 그래픽

설명 :

‘X11’ starts a graphics device driver for the X Window System 
(version 11). This can only be done on machines/accounts that 
have access to an X server. 

‘x11’ is recognized as a synonym for ‘X11’. 

사용법 :

인수 :

[...]

fonts: X11 font description strings into which weight, slant and 
     size will be substituted. There are two, the first for fonts 
     1 to 4 and the second for font 5, the symbol font. See 
     section ‘Fonts’. 

[...]

antialias: for cairo types, the typeof anti-aliasing (if any) to be 
     used. One of ‘c("default", "none", "gray", "subpixel")’. 

[...]

상세 :

The defaults for all of the arguments of ‘X11’ are set by 
‘X11.options’: the ‘Arguments’ section gives the ‘factory-fresh’ 
defaults. 

The initial size and position are only hints, and may not be acted 
on by the window manager. Also, some systems (especially laptops) 
are set up to appear to have a screen of a different size to the 
physical screen. 

Option ‘type’ selects between two separate devices: R can be built 
with support for neither, ‘type = "Xlib"’ or both. Where both are 
available, types ‘"cairo"’ and ‘"nbcairo"’ offer 

    * antialiasing of text and lines. 

    * translucent colours. 

    * scalable text, including to sizes like 4.5 pt. 

    * full support for UTF-8, so on systems with suitable fonts you 
     can plot in many languages on a single figure (and this will 
     work even in non-UTF-8 locales). The output should be 
     locale-independent. 

‘type = "nbcairo"’ is the same device as ‘type="cairo"’ without 
buffering: which is faster will depend on the X11 connection. 
Both will be slower than ‘type = "Xlib"’, especially on a slow X11 
connection as all the rendering is done on the machine running R 
rather than in the X server. 

All devices which use an X11 server (including the ‘type = "Xlib"’ 
versions of bitmap devices such as ‘png’) share internal 
structures, which means that they must use the same ‘display’ and 
visual. If you want to change display, first close all such 
devices. 

[... and more ...]

+0

좋아, 이제 여기 내 질문 : X11 (type = "cairo")을 입력하면 오류가 발생합니다. "X11 (type ="cairo ") 오류 : 사용되지 않는 인수 (type ="cairo ") "저는 카이로가 장착되어 있지만 X11을 어떻게 바꿀 수 있는지 알지 못합니다. Win XP에서 R 2.9.2를 사용하고 있습니다. 내 시스템 전체를 휴지통에 넣고 디스플레이에 앤티 앨리어스를 적용하려면 Mac을 사용해야합니까? – Mark

+0

나는 그 부분에 대해서 일종의 걱정을하고있었습니다. 나는 카이로가 Gnome/Gtk에서 왔고 리눅스에서 집에 있다는 것을 알고 있습니다. 그러나 저는 이것이 크로스 플랫폼이라고 생각했습니다. XP에서 R 세션에서'capabilities()'를 호출하면 어떻게됩니까? 나는 거기에 '카이로'사실을 가지고 있습니다. –

+0

나는 거짓말을하지만 어쨌든, 매우 흥미로운 여행. 나는 우분투에서 나중에 그것을 시도 할 것이다. 그것을 조사해 주셔서 다시 한번 감사드립니다. – Mark

12

다른 사람들이 언급했듯이 R의 기본 제공 Windows 그래픽 장치는 앤티 앨리어싱을 지원하지 않습니다. 그러나 요즘에는 카이로 그래픽 장치를 설치하는 것이 쉽습니다.

install.packages('Cairo',,'http://www.rforge.net/') 

테스트하려면 : 당신이 카이로 (다른 답변을 참조)를 설치 한 경우

plot(rnorm(1000)) # non-antialiased (on Windows) 
library('Cairo') 
CairoWin() 
plot(rnorm(1000)) # antialiased! 

More

2

는, 항 -로 저장하는 R 콘솔에서

앨리어스 처리 된 PNG로 코드를 변경하면됩니다.

ggsave(file="filename.png", type="cairo-png")

으로 명시된대로 here.

그러나 어떤 목적으로 "모니터의 플롯을 앤티 앨리어싱 된 그래프"또는 "앤티 앨리어스 플롯 창"으로보고 싶습니까? RStudio의 Plots 창 (탭)과 같은 뜻이라면 그 작업을 수행 할 수 있는지 확신 할 수 없습니다. 기본적으로 미리보기로 사용됩니다. 그래프를 파일에 저장 한 다음이 파일을 사용하여 그래프를 표시하거나 다른 용도로 사용하는 것이 좋습니다.

관련 문제