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

Showtext prevents creating cairo-png objects when labels are blank #20

Closed
pritz2 opened this issue Jul 5, 2018 · 3 comments
Closed

Comments

@pritz2
Copy link

pritz2 commented Jul 5, 2018

Created a plot, wanted to create a custom x-axis, so I set xlab to " " and xaxt="n". Found that the text and axis commands no longer drew to my graph!

library("showtext")
showtext.opts(dpi = 144)
showtext.auto()

#Open cairo-png device
png(filename = "output.png", type = "cairo-png")

# plot basic x/y graph
x<-1:10
y<-1:10
plot(x, y, ylab="Y axis",xlab=" ",xaxt = "n")

# add text and axis
text(x, y, label=y, pos=3)
axis(1, at=x, labels=x)

# close the device
dev.off()

Graph without labels

So I changed the plot line of code to be null instead of a space:

plot(x, y, ylab="Y axis",xlab="",xaxt = "n")

And then the axes and text appeared

Graph with labels

Am I missing something fundamental or is this a bug?

@yixuan
Copy link
Owner

yixuan commented Oct 12, 2018

This seems to be a genuine bug. I'll try to figure it out.

@yixuan
Copy link
Owner

yixuan commented Dec 14, 2018

820bfb3 fixes this issue. I'll prepare a CRAN release soon.

@yixuan
Copy link
Owner

yixuan commented Jan 11, 2019

On CRAN now.

@yixuan yixuan closed this as completed Jan 11, 2019
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

2 participants