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

Vector graphics produced by the Julia Luxor package not being rendered in Quarto #1369

Open
bkostadi opened this issue Jul 13, 2022 · 0 comments
Milestone

Comments

@bkostadi
Copy link

bkostadi commented Jul 13, 2022

I set up the Julia kernel for Quarto documents in RStudio, following the instructions on the Quarto website, and I reproduced the Plots demo in https://quarto.org/docs/computations/julia.html

However, when I installed the Julia package Luxor, I rendered my Quarto document without any errors, but it did not produce a plot of the turtle graphics (only the value true) that I was trying to reproduce from https://juliagraphics.github.io/Luxor.jl/v1.0/turtle.html

I did modify the Julia code in their example and removed the turtle emoji and the turtle image (turtles.png). I thought that maybe the issue was related to the graphics device and tried using different graphics devices, but to no avail.

It appears that the drawing function can create a file with the drawing, which can be specified in the function Drawing(600, 400, :png, "test.png") with the file name test.png, but also have the png file in the memory, specified by the argument :png. So, I just loaded the image file after the Julia code gets executed. I guess that's one quick solution, but it would be much better if the graphics get captured and properly embedded into the final output after rendering the qmd document. I also wondered how to suppress the value true being returned when I render the qmd document. The chunk option results='hide' does not to work.

Finally, when I run the Julia code chunk inside the Quarto document, RStudio crashes, the R session gets aborted and I have to restart my R session. I do have the JuliaCall R package installed. Below is the qmd file, where the Julia packages Luxor and Colors have been installed:

---
title: "Luxor Turtle Graphics"
format: html
---

```{julia}
using Luxor, Colors
Drawing(600, 400, :png, "test.png")
origin()
background("midnightblue")
t = Turtle() 
Pencolor(t, "cyan")
Penwidth(t, 1.5)
global n = 5
for i in 1:400
    Forward(t, n)
    Turn(t, 89.5)
    HueShift(t)
    n += 0.75
end
fontsize(20)
finish()
```

![Turtle Graphics](test.png){width="70%"}

@bkostadi bkostadi changed the title Feature Request: Vector graphics produced by the Julia Luxor package not being rendered in Quarto Vector graphics produced by the Julia Luxor package not being rendered in Quarto Jul 13, 2022
@dragonstyle dragonstyle added this to the Future milestone Jul 19, 2022
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