Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Code length limit in cells?

I have a worksheet that is set to R code. Then I do a bunch of stuff, and at the end I want to produce a nice looking plot. To make the plot look nice, I am setting lots of options, which makes it become a huge block of text.

It seems there is some sort of limit on the length of code that a cell may contain? If I do this:

plot(...)
#lines(...)
#etc

Then I get no output, no png is produced, nothing at all and no error message either. However, if I do the same, but remove the commented lines (starting with #) then I do get a plot.

For more details, I started out by asking this question on StackExchange also. But I figure this question might belong here instead...

How do I set Sage to accept cells with longer text contents, so I can do my plots with all the options I want?

click to hide/show revision 2
edited for reproducible example

Code length limit in cells?

I have a worksheet that is set to R code. Then I do a bunch of stuff, and at the end I want to produce a nice looking plot. To make the plot look nice, I am setting lots of options, which makes it become a huge block of text.

It seems there is some sort of limit on the length of code that a cell may contain? If I do this:

plot(...)
#lines(...)
#etc

Then I get no output, no png is produced, nothing at all and no error message either. However, if I do the same, but remove the commented lines (starting with #) then I do get a plot.

For more details, I started out by asking this question on StackExchange also. But I figure this question might belong here instead...

How do I set Sage to accept cells with longer text contents, so I can do my plots with all the options I want?

EDIT (for reproducibility):

It seems the limit is around 1000 characters. The following code can be pasted in a cell, and produces nothing, but if you remove one single character anywhere then you will get a plot output:

png("temp.png")
plot(1:20)
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111111
#111111111111111111111111111
dev.off()