Displaying 20 results from an estimated 700 matches similar to: "can't print ggplot with Chinese characters to pdf files"
2017 Oct 13
1
[FORGED] can't print ggplot with Chinese characters to pdf files
Hi
Instead of ...
ggsave("test_plot_chinese.pdf", m2)
... try ...
cairo_pdf("test_plot_chinese.pdf")
print(m2)
dev.off()
Paul
On 13/10/17 02:12, John wrote:
> I install the Chinese font "Kaiti TC" on my mac, but I can't print the
> figures to pdf file by "marrangeGrob" command, which is in the package
> "gridExtra". Error message
2017 Oct 13
4
[FORGED] can't print ggplot with Chinese characters to pdf files
Hi
By the looks of it, you need to install Cairo graphics ...
https://www.cairographics.org/download/
Paul
On 13/10/17 15:48, John wrote:
> Thanks, Paul. Following your solution, ?I got this error message:
>
> Warning message:
> In cairo_pdf("test_plot_chinese.pdf") : failed to load cairo DLL
>
> Is there anything else I need to install?
>
> Thanks,
>
2017 Oct 13
0
[FORGED] can't print ggplot with Chinese characters to pdf files
Thanks, Paul. Following your solution, I got this error message:
Warning message:
In cairo_pdf("test_plot_chinese.pdf") : failed to load cairo DLL
Is there anything else I need to install?
Thanks,
John
2017-10-12 19:24 GMT-07:00 Paul Murrell <paul at stat.auckland.ac.nz>:
> Hi
>
> Instead of ...
>
> ggsave("test_plot_chinese.pdf", m2)
>
> ...
2017 Oct 16
0
[FORGED] can't print ggplot with Chinese characters to pdf files
Hi,
Sorry to bother you with this question here.
I tried to install Macports on my Mac OS Sierra, and type "sudo port
install cairo", but it did not respond. I haven't seen any file name or app
called Macports, but one file called "port" which is located at
loca/bin/port"
How should I do it?
Thanks,
John
*******
Last login: Sun Oct 15 02:52:49
2017 Oct 20
0
[FORGED] can't print ggplot with Chinese characters to pdf files
Hi,
Following Paul's instruction, I have installed the Cairo. I tried to run
the program, and there is no error message at all. I did see the Chinese
title in the plot if I ask my RStudio to show the plot (if I type "p1"),
but the pdf file shows the plots without the Chinese titles.
library(ggplot2)
library(gridExtra)
df1<-data.frame(x=1:2, y=3:4, z=5:6)
#p1<-ggplot(df1,
2016 Apr 09
3
How to print the graphs in landscape/portrait orientation
Hi,
I made a few graphs by ggplot. The following codes produce a pdf file
with graphs in landscape orientation on my Windows PC, while they produce a
pdf file with the same graphs, but in portrait orientation:
*p2 <- lapply(1:(2*n), function(.x) xyz_outl[.x][[1]]) #a sequence of
graphs made by ggplot*
*m2 <- marrangeGrob(p2, nrow=3, ncol=2) *
*ggsave("xyz.pdf", m2)*
2013 Sep 26
1
Less than equal to symbol in ggplot2 legend text
Hello,
I am trying to add a less than equal to symbol in a ggplot2 legend text.
See sample code below. I have tried using the expression function and
\u2264. I also tried adding labels to legend.text under theme.
Neither of these 3 options work.
Please help,
Mahesh
++++++++++++++
Extra.column=ifelse(data[,covariate]>cutpoint,1,0)
Grp1 <- "\u2264 1.5"
Grp2 <-
2017 Nov 02
3
ggplot inside function doesn't plot
I have a function:
myplot <- function (X) {
d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE)
png(paste("img/", X, ".png", sep=""))
ggplot(d, aes(x=condition, y=count, color=condition)) +
geom_point(position=position_jitter(w=0.1,h=0)) +
scale_y_log10(breaks=c(25,100,400)) +
ggtitle(X) +
2017 Nov 02
3
ggplot inside function doesn't plot
I don't really understand. I mean, I understand the solution is
print(ggplot(...)). But why is that required in a function and not at
the console?
Shouldn't I be able to rely on what I do at the console working in a
script? Is this inconsistent behavior by design?
On Thu, Nov 2, 2017 at 11:54 AM, David Winsemius <dwinsemius at comcast.net> wrote:
>
>> On Nov 2, 2017,
2017 Nov 02
0
ggplot inside function doesn't plot
> On Nov 2, 2017, at 9:27 AM, Ed Siefker <ebs15242 at gmail.com> wrote:
>
> I have a function:
>
> myplot <- function (X) {
> d <- plotCounts(dds2, gene=X, intgroup="condition", returnData=TRUE)
> png(paste("img/", X, ".png", sep=""))
> ggplot(d, aes(x=condition, y=count, color=condition)) +
>
2015 Jun 16
4
Ayuda boxplot ggplot2
Hola a todos
Me gustaría saber si me pueden ayudar con lo siguiente.
Realicé un Boxplot usando ggplot2 para visualizar el comportamiento de dos
variables. Visualmente no se notan las diferencias porque la gráfica de la
derecha (parásitos en el abdomen) llega hasta 20 en el eje y. ¿Cómo puedo
hacer para que las dos gráficas muestren la misma escala en el eje Y, es
decir, que las dos lleguen a 60?
2012 Aug 07
1
Styling gridExtra's title and left labels
Hi,
I'm using the gridExtra package to combine some graphs like in the
arrangeGrob example. Each of the graphs has a title but they appear much
larger than the overall combined plot title and left axis label. Does anyone
know how I can control the style / size of the gridExtra labels?
library(gridExtra)
library(ggplot2)
dsamp <- diamonds[sample(nrow(diamonds), 1000), ]
p1 <-
2009 Aug 20
1
ggsave to .png bug in ggplot2 (?)
Text is really small and legend boxes are huge in this plot when saved to
.png with ggsave. Plot is correct (i.e. looks the same as the screen) when
saved with dev.print. Saving to .pdf with ggsave give the correct output.
I'm a noob at ggplot2 so this may be user error rather than a bug. However
the interface to ggsave seems simple enough to exclude many possibilities
for screwing this up
2009 Jul 22
1
Link to documentation in another package
Dear all,
One of the functions that I wrote (ggsave.latex) extents the
functionality of a function (ggsave) in another package (ggplot2).
Instead of copying all the information I would like to create a link in
the helpfile of ggsave.latex to the helpfile of ggsave. I tried
\code{\link{ggsave}} and \code{\link{ggplot2::ggsave}}, but neither
worked. Both cases gave a 'missing link' warning.
2016 Apr 10
0
How to print the graphs in landscape/portrait orientation (revised)
Hi,
I made a few graphs by ggplot. The following codes produce a pdf file
with graphs, sometimes in landscape orientation, sometimes in portrait
orientation. I am using both Mac and Windows PC.
Question: how can I control the orientation of the pdf file? I try to
add a line pdf(paper = ?USr?) (or pdf(paper="letter")) in the following
code, but it does not work.
2010 Feb 24
3
ggsave in Linux
I have a script that creates a qplot that is then saved as a .png file which
works fine on Windows. But I also work on Linux servers via Putty and would
like to be able to create and save my plots to my working directory. Is
there a way I can ggsave my qplot without utilizing X11 in Linux? I don't
need to view the plot in Linux, I just want the plot created and immediately
saved to my working
2020 Oct 08
2
2 D density plot interpretation and manipulating the data
Hello,
I have a data frame like this:
> head(SNP)
mean var sd
FQC.10090295 0.0327 0.002678 0.0517
FQC.10119363 0.0220 0.000978 0.0313
FQC.10132112 0.0275 0.002088 0.0457
FQC.10201128 0.0169 0.000289 0.0170
FQC.10208432 0.0443 0.004081 0.0639
FQC.10218466 0.0116 0.000131 0.0115
...
and I am creating plot like this:
s <- ggplot(SNP, mapping = aes(x = mean, y = var))
2013 Mar 06
6
Ggplot2: Moving legend, change fill and removal of space between plots when using grid.arrange() possible use of facet_grid?
Hi,
# For publications, I am not allowed to repeat the axes. I have tried to
remove the axes using:
# yaxt="n", but it did not work. I have not understood how to do this in
ggplot2. Can you help me?
# I also do not want loads of space between the graphs (see below script
with Dummy Data).
# If I could make it look like the examples on the (nice) examples page:
#
2020 Sep 27
2
GRÁFICO DE BARRAS COMPARATIVO VARIOS AÑOS
Buenas noches,
Tengo que preparar un gráfico de barras comparativo para varios años, en
el que tenga agrupadas, 3 barras para enero, 3 barras para febrero, 3
barras para marzo y así sucesivamente para todos los meses, estando en cada
mes, los años 2020, 2019 y 2018 (juntas), un pequeño espacio y luego las de
febrero y así sucesivamente...
Con el siguiente código, hago un año:
2013 Aug 19
2
Problemas con ggsave(paste('img/',plotName,'.png', sep='')
Estimados usuarios de R:
Soy nuevo en R, le ruego disculpa por mi *Ignorancia*.
Estoy corriendo la siguiente instruccion,
ggsave(paste('img/',plotName,'.png', sep='')
y resulta el error:
ggsave(paste('img/',plotName,'.png', sep='')
Saving 7.32 x 4.87 in image
Error in grDevices::png(..., width = width, height = height, res = dpi, :