Re: [R] rgl: exporting to pdf or png does not work

2006-08-23 Thread Berton Gunter
Please contact the package maintainer.

-- Bert Gunter
Genentech Non-Clinical Statistics
South San Francisco, CA
 
"The business of the statistician is to catalyze the scientific learning
process."  - George E. P. Box
 
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Gaspard Lequeux
> Sent: Wednesday, August 23, 2006 2:15 PM
> To: r-help@stat.math.ethz.ch
> Subject: [R] rgl: exporting to pdf or png does not work
> 
> 
> Hej,
> 
> When exporting a image from rgl, the following error is encountered:
> 
> > rgl.postscript('testing.pdf', fmt="pdf")
> RGL: ERROR: can't bind glx context to window
> RGL: ERROR: can't bind glx context to window
> Warning messages:
> 1: X11 protocol error: GLXBadContextState
> 2: X11 protocol error: GLXBadContextState
> 
> The pdf file is created and is readable, but all the labels are gone.
> 
> Taking a snapshot (to png) gives 'failed' and no file is created.
> 
> Version of rgl used: 0.67-2 (2006-07-11)
> Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
> Running Debian GNU/Linux testing (Etch).
> 
> /Gaspard
> 
> __
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide 
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] rgl: exporting to pdf or png does not work

2006-08-23 Thread Duncan Murdoch
On 8/23/2006 5:15 PM, Gaspard Lequeux wrote:
> Hej,
> 
> When exporting a image from rgl, the following error is encountered:
> 
>> rgl.postscript('testing.pdf', fmt="pdf")
> RGL: ERROR: can't bind glx context to window
> RGL: ERROR: can't bind glx context to window
> Warning messages:
> 1: X11 protocol error: GLXBadContextState
> 2: X11 protocol error: GLXBadContextState
> 
> The pdf file is created and is readable, but all the labels are gone.
> 
> Taking a snapshot (to png) gives 'failed' and no file is created.
> 
> Version of rgl used: 0.67-2 (2006-07-11)
> Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
> Running Debian GNU/Linux testing (Etch).

That looks like an X11 error to me, not something that I'm very likely 
to be able to fix.  If you can debug the error, it would be helpful.

Duncan Murdoch

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] rgl: exporting to pdf or png does not work

2006-08-24 Thread Gaspard Lequeux

Hej,

On Wed, 23 Aug 2006, Duncan Murdoch wrote:

> On 8/23/2006 5:15 PM, Gaspard Lequeux wrote:
>
>> When exporting a image from rgl, the following error is encountered:
>>
>>> rgl.postscript('testing.pdf', fmt="pdf")
>> RGL: ERROR: can't bind glx context to window
>> RGL: ERROR: can't bind glx context to window
>> Warning messages:
>> 1: X11 protocol error: GLXBadContextState
>> 2: X11 protocol error: GLXBadContextState
>>
>> The pdf file is created and is readable, but all the labels are gone.
>>
>> Taking a snapshot (to png) gives 'failed' and no file is created.
>>
>> Version of rgl used: 0.67-2 (2006-07-11)
>> Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
>> Running Debian GNU/Linux testing (Etch).
>
> That looks like an X11 error to me, not something that I'm very likely
> to be able to fix.  If you can debug the error, it would be helpful.

Actually after upgrading everything (debian testing (etch)) and restarting 
X, I didn't get that error anymore. It was worse: R crashed:

> library(rgl);triangles3d(c(1,,2,3),c(1,2,4),c(1,3,5));rgl.postscript('testing.pdf','pdf')
X Error of failed request:  GLXBadContextState
   Major opcode of failed request:  142 (GLX)
   Minor opcode of failed request:  5 (X_GLXMakeCurrent)
   Serial number of failed request:  85
   Current serial number in output stream:  85
[EMAIL PROTECTED]:~/seqanal$


I downloaded the source package (debian testing (etch), rgl-0.67-2).

In rgl-0.67-2/src/ I changed the following files:

rglview.cpp, around line 587. Commenting the function call gl2psBeginPage 
removed the crash (but also no pdf output...)

I enabled this function again and went to gl2ps.c, to the function 
gl2psBeginPage. At the end of that function, around line 4426, commenting 
out the line
glRenderMode(GL_FEEDBACK);
removes the R crash, but of course still no pdf output (well, only the 
background).

GL_FEEDBACK is defined in /usr/include/GL/gl.h as:

/* Render Mode */
#define GL_FEEDBACK 0x1C01
#define GL_RENDER   0x1C00
#define GL_SELECT   0x1C02

Trying glRenderMode(GL_RENDER) removed the crash, but still only the 
background in the pdf.

If someone has some suggestions about what to do next...

/Gaspard

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] rgl: exporting to pdf or png does not work

2006-08-24 Thread Duncan Murdoch
On 8/24/2006 11:19 AM, Gaspard Lequeux wrote:
> Hej,
> 
> On Wed, 23 Aug 2006, Duncan Murdoch wrote:
> 
>> On 8/23/2006 5:15 PM, Gaspard Lequeux wrote:
>>
>>> When exporting a image from rgl, the following error is encountered:
>>>
 rgl.postscript('testing.pdf', fmt="pdf")
>>> RGL: ERROR: can't bind glx context to window
>>> RGL: ERROR: can't bind glx context to window
>>> Warning messages:
>>> 1: X11 protocol error: GLXBadContextState
>>> 2: X11 protocol error: GLXBadContextState
>>>
>>> The pdf file is created and is readable, but all the labels are gone.
>>>
>>> Taking a snapshot (to png) gives 'failed' and no file is created.
>>>
>>> Version of rgl used: 0.67-2 (2006-07-11)
>>> Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
>>> Running Debian GNU/Linux testing (Etch).
>>
>> That looks like an X11 error to me, not something that I'm very likely
>> to be able to fix.  If you can debug the error, it would be helpful.
> 
> Actually after upgrading everything (debian testing (etch)) and restarting 
> X, I didn't get that error anymore. It was worse: R crashed:
> 
>> library(rgl);triangles3d(c(1,,2,3),c(1,2,4),c(1,3,5));rgl.postscript('testing.pdf','pdf')
> X Error of failed request:  GLXBadContextState
>Major opcode of failed request:  142 (GLX)
>Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>Serial number of failed request:  85
>Current serial number in output stream:  85
> [EMAIL PROTECTED]:~/seqanal$
> 
> 
> I downloaded the source package (debian testing (etch), rgl-0.67-2).
> 
> In rgl-0.67-2/src/ I changed the following files:
> 
> rglview.cpp, around line 587. Commenting the function call gl2psBeginPage 
> removed the crash (but also no pdf output...)
> 
> I enabled this function again and went to gl2ps.c, to the function 
> gl2psBeginPage. At the end of that function, around line 4426, commenting 
> out the line
> glRenderMode(GL_FEEDBACK);
> removes the R crash, but of course still no pdf output (well, only the 
> background).
> 
> GL_FEEDBACK is defined in /usr/include/GL/gl.h as:
> 
> /* Render Mode */
> #define GL_FEEDBACK   0x1C01
> #define GL_RENDER 0x1C00
> #define GL_SELECT 0x1C02
> 
> Trying glRenderMode(GL_RENDER) removed the crash, but still only the 
> background in the pdf.
> 
> If someone has some suggestions about what to do next...

gl2ps is a separate project, whose source has been included into rgl. 
You can see the gl2ps project page at http://www.geuz.org/gl2ps/.

We're using version 1.2.2, which is a couple of years old.  The current 
stable release of gl2ps is 1.3.1.  It might fix your problem.

I don't know if we modified gl2ps.c or gl2ps.h when they were included, 
but they haven't been modified since.  (Daniel put them in, based on a 
patch from Albrecht Gebhardt, according to the log.)

It would be helpful to know:

1.  Is the rgl source identical to 1.2.2?
2.  Does rgl work if 1.3.1 is dropped in instead?
3.  Does 1.3.1 fix the bug you're seeing?

I'll look into these at some point, but probably not this week.

Duncan Murdoch

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] rgl: exporting to pdf or png does not work

2006-08-24 Thread Gaspard Lequeux

Hej,

On Thu, 24 Aug 2006, Duncan Murdoch wrote:

> On 8/24/2006 11:19 AM, Gaspard Lequeux wrote:
>>
>> On Wed, 23 Aug 2006, Duncan Murdoch wrote:
>>
>>> On 8/23/2006 5:15 PM, Gaspard Lequeux wrote:
>>>
 When exporting a image from rgl, the following error is encountered:

> rgl.postscript('testing.pdf', fmt="pdf")
 RGL: ERROR: can't bind glx context to window
 RGL: ERROR: can't bind glx context to window
 Warning messages:
 1: X11 protocol error: GLXBadContextState
 2: X11 protocol error: GLXBadContextState

 The pdf file is created and is readable, but all the labels are gone.

 Taking a snapshot (to png) gives 'failed' and no file is created.

 Version of rgl used: 0.67-2 (2006-07-11)
 Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
 Running Debian GNU/Linux testing (Etch).
>>>
>>> That looks like an X11 error to me, not something that I'm very likely
>>> to be able to fix.  If you can debug the error, it would be helpful.
>>
>> Actually after upgrading everything (debian testing (etch)) and restarting
>> X, I didn't get that error anymore. It was worse: R crashed:
>>
>>> library(rgl);triangles3d(c(1,,2,3),c(1,2,4),c(1,3,5));rgl.postscript('testing.pdf','pdf')
>> X Error of failed request:  GLXBadContextState
>>Major opcode of failed request:  142 (GLX)
>>Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>>Serial number of failed request:  85
>>Current serial number in output stream:  85
>> [EMAIL PROTECTED]:~/seqanal$
>>
>>
>> I downloaded the source package (debian testing (etch), rgl-0.67-2).
>>
>> In rgl-0.67-2/src/ I changed the following files:
>>
>> rglview.cpp, around line 587. Commenting the function call gl2psBeginPage
>> removed the crash (but also no pdf output...)
>>
>> I enabled this function again and went to gl2ps.c, to the function
>> gl2psBeginPage. At the end of that function, around line 4426, commenting
>> out the line
>> glRenderMode(GL_FEEDBACK);
>> removes the R crash, but of course still no pdf output (well, only the
>> background).
>>
>> GL_FEEDBACK is defined in /usr/include/GL/gl.h as:
>>
>> /* Render Mode */
>> #define GL_FEEDBACK  0x1C01
>> #define GL_RENDER0x1C00
>> #define GL_SELECT0x1C02
>>
>> Trying glRenderMode(GL_RENDER) removed the crash, but still only the
>> background in the pdf.
>>
>> If someone has some suggestions about what to do next...
>
> gl2ps is a separate project, whose source has been included into rgl.
> You can see the gl2ps project page at http://www.geuz.org/gl2ps/.
>
> We're using version 1.2.2, which is a couple of years old.  The current
> stable release of gl2ps is 1.3.1.  It might fix your problem.
>
> I don't know if we modified gl2ps.c or gl2ps.h when they were included,
> but they haven't been modified since.  (Daniel put them in, based on a
> patch from Albrecht Gebhardt, according to the log.)
>
> It would be helpful to know:
>
> 1.  Is the rgl source identical to 1.2.2?

Yes. The version of gl2ps in rgl is identical to gl2ps version 1.2.2.

> 2.  Does rgl work if 1.3.1 is dropped in instead?

No:

In version 1.3.1:

#define GL2PS_PS  0
#define GL2PS_EPS 1
#define GL2PS_TEX 2
#define GL2PS_PDF 3
#define GL2PS_SVG 4
#define GL2PS_PGF 5

while in version 1.2.2:

#define GL2PS_PS  1
#define GL2PS_EPS 2
#define GL2PS_TEX 3
#define GL2PS_PDF 4

Thus rgl.postscript('probeer.pdf','tex') should be used to generate a pdf. 
The pdf has still no characters (axes annotations).

In R/enum.R

The last line (line 54)

rgl.enum (postscripttype, ps=1, eps=2, tex=3, pdf=4)

should be

rgl.enum (postscripttype, ps=0, eps=1, tex=2, pdf=3)

and mayebe add svg and pgf...


> 3.  Does 1.3.1 fix the bug you're seeing?

No. Same error.

The error occurs also on ubuntu dapper. On that ubuntu machine, when 
installing the libgl1-mesa-swrast, the packages libgl1-mesa 
libgl1-mesa-dri and x-window-system-core are removed. rgl.postscript 
doesn't produce any errors anymore, the pdf is created but no text (axes 
decorations) is written to the pdf.

On debian testing, libgl1-mesa-swx11 can be installed. This removes the 
follwing packages:

freeglut3-dev libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx 
libglitz-glx1-dev libglitz1-dev libglu1-mesa-dev libglui-dev libglut3-dev 
x-window-system-core xlibmesa-gl-dev xorg

but R doesn't crash anymore and the figure is written to file (still 
without axes annotations).

Reinstal libgl1-mesa-glx removes libgl1-mesa-swx11 and the R crash 
returns.

So it seems the bug is really triggered by libgl1-mesa. I filled in a bug 
report for the debian package libgl1-mesa-glx.

> I'll look into these at some point, but probably not this week.

Thanks. No hurry however, as I can still use the classical screenshots. 
The figures will probable not have to be published, as the expected 
results are not attained.

/Gaspard

_

Re: [R] rgl: exporting to pdf or png does not work

2006-08-25 Thread Duncan Murdoch
On 8/24/2006 4:34 PM, Gaspard Lequeux wrote:
> Hej,
> 
> On Thu, 24 Aug 2006, Duncan Murdoch wrote:
> 
>> On 8/24/2006 11:19 AM, Gaspard Lequeux wrote:
>>>
>>> On Wed, 23 Aug 2006, Duncan Murdoch wrote:
>>>
 On 8/23/2006 5:15 PM, Gaspard Lequeux wrote:

> When exporting a image from rgl, the following error is encountered:
>
>> rgl.postscript('testing.pdf', fmt="pdf")
> RGL: ERROR: can't bind glx context to window
> RGL: ERROR: can't bind glx context to window
> Warning messages:
> 1: X11 protocol error: GLXBadContextState
> 2: X11 protocol error: GLXBadContextState
>
> The pdf file is created and is readable, but all the labels are gone.
>
> Taking a snapshot (to png) gives 'failed' and no file is created.
>
> Version of rgl used: 0.67-2 (2006-07-11)
> Version of R used: R 2.3.1; i486-pc-linux-gnu; 2006-07-13 01:31:16;
> Running Debian GNU/Linux testing (Etch).

 That looks like an X11 error to me, not something that I'm very likely
 to be able to fix.  If you can debug the error, it would be helpful.
>>>
>>> Actually after upgrading everything (debian testing (etch)) and restarting
>>> X, I didn't get that error anymore. It was worse: R crashed:
>>>
 library(rgl);triangles3d(c(1,,2,3),c(1,2,4),c(1,3,5));rgl.postscript('testing.pdf','pdf')
>>> X Error of failed request:  GLXBadContextState
>>>Major opcode of failed request:  142 (GLX)
>>>Minor opcode of failed request:  5 (X_GLXMakeCurrent)
>>>Serial number of failed request:  85
>>>Current serial number in output stream:  85
>>> [EMAIL PROTECTED]:~/seqanal$
>>>
>>>
>>> I downloaded the source package (debian testing (etch), rgl-0.67-2).
>>>
>>> In rgl-0.67-2/src/ I changed the following files:
>>>
>>> rglview.cpp, around line 587. Commenting the function call gl2psBeginPage
>>> removed the crash (but also no pdf output...)
>>>
>>> I enabled this function again and went to gl2ps.c, to the function
>>> gl2psBeginPage. At the end of that function, around line 4426, commenting
>>> out the line
>>> glRenderMode(GL_FEEDBACK);
>>> removes the R crash, but of course still no pdf output (well, only the
>>> background).
>>>
>>> GL_FEEDBACK is defined in /usr/include/GL/gl.h as:
>>>
>>> /* Render Mode */
>>> #define GL_FEEDBACK 0x1C01
>>> #define GL_RENDER   0x1C00
>>> #define GL_SELECT   0x1C02
>>>
>>> Trying glRenderMode(GL_RENDER) removed the crash, but still only the
>>> background in the pdf.
>>>
>>> If someone has some suggestions about what to do next...
>>
>> gl2ps is a separate project, whose source has been included into rgl.
>> You can see the gl2ps project page at http://www.geuz.org/gl2ps/.
>>
>> We're using version 1.2.2, which is a couple of years old.  The current
>> stable release of gl2ps is 1.3.1.  It might fix your problem.
>>
>> I don't know if we modified gl2ps.c or gl2ps.h when they were included,
>> but they haven't been modified since.  (Daniel put them in, based on a
>> patch from Albrecht Gebhardt, according to the log.)
>>
>> It would be helpful to know:
>>
>> 1.  Is the rgl source identical to 1.2.2?
> 
> Yes. The version of gl2ps in rgl is identical to gl2ps version 1.2.2.
> 
>> 2.  Does rgl work if 1.3.1 is dropped in instead?
> 
> No:
> 
> In version 1.3.1:
> 
> #define GL2PS_PS  0
> #define GL2PS_EPS 1
> #define GL2PS_TEX 2
> #define GL2PS_PDF 3
> #define GL2PS_SVG 4
> #define GL2PS_PGF 5
> 
> while in version 1.2.2:
> 
> #define GL2PS_PS  1
> #define GL2PS_EPS 2
> #define GL2PS_TEX 3
> #define GL2PS_PDF 4
> 
> Thus rgl.postscript('probeer.pdf','tex') should be used to generate a pdf. 
> The pdf has still no characters (axes annotations).
> 
> In R/enum.R
> 
> The last line (line 54)
> 
> rgl.enum (postscripttype, ps=1, eps=2, tex=3, pdf=4)
> 
> should be
> 
> rgl.enum (postscripttype, ps=0, eps=1, tex=2, pdf=3)
> 
> and mayebe add svg and pgf...
> 
> 
>> 3.  Does 1.3.1 fix the bug you're seeing?
> 
> No. Same error.
> 
> The error occurs also on ubuntu dapper. On that ubuntu machine, when 
> installing the libgl1-mesa-swrast, the packages libgl1-mesa 
> libgl1-mesa-dri and x-window-system-core are removed. rgl.postscript 
> doesn't produce any errors anymore, the pdf is created but no text (axes 
> decorations) is written to the pdf.
> 
> On debian testing, libgl1-mesa-swx11 can be installed. This removes the 
> follwing packages:
> 
> freeglut3-dev libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx 
> libglitz-glx1-dev libglitz1-dev libglu1-mesa-dev libglui-dev libglut3-dev 
> x-window-system-core xlibmesa-gl-dev xorg
> 
> but R doesn't crash anymore and the figure is written to file (still 
> without axes annotations).
> 
> Reinstal libgl1-mesa-glx removes libgl1-mesa-swx11 and the R crash 
> returns.
> 
> So it seems the bug is really triggered by libgl1-mesa. I filled in a bug 
> report for the debian package libgl1-mesa-glx.
> 
>> I'll look into these at so

Re: [R] rgl: exporting to pdf or png does not work

2006-09-12 Thread Daniel Franke

[This is a follow-up to the recent discussion on R-help]

Hi all,

I can reproduce both problems on gentoo (2006.0 profile), 
but not on OpenSuSE-10.1. 

bash> cat rgl.postscript.r
library(rgl)
example(spheres3d)
rgl.postscript("spheres.eps", fmt="eps")

R> source("rgl.postscript.r")

X Error of failed request:  GLXBadContextState
  Major opcode of failed request:  142 (GLX)
  Minor opcode of failed request:  5 (X_GLXMakeCurrent)
  Serial number of failed request:  102
  Current serial number in output stream:  102


bash> cat rgl.snapshot.r
library(rgl)
example(spheres3d)
rgl.postscript("spheres.png", fmt="png")

R> source("rgl.snapshot.r")
[1] "failed"


Installed libraries:
 * Gentoo: R-2.2.1, rgl-0.67.2, OpenSuSE: R-2.3.1, rgl-0.67.2
 * Gentoo: libpng-1.2.12, OpenSuSE: libpng-1.2.8
 * Gentoo: Xorg-6.8.2 (mga), OpenSuSE: 6.9.0 (nvidia)
 * Gentoo: freeglut-2.4.0, OpenSuSE:  freeglut-051110
 * OpenSuse: mesa-6.4.2

Please let me know if there is anything I can do to help to 
solve this issue.

Regards
Daniel


P.S. Please CC me in your replies, I am not subscribed to the list.

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] rgl: exporting to pdf or png does not work

2006-09-13 Thread Ben Bolker
Daniel Franke  gmail.com> writes:

> 
> 
> [This is a follow-up to the recent discussion on R-help]
> 
> Hi all,
> 
> I can reproduce both problems on gentoo (2006.0 profile), 
> but not on OpenSuSE-10.1. 
> 
> Installed libraries:
>  * Gentoo: R-2.2.1, rgl-0.67.2, OpenSuSE: R-2.3.1, rgl-0.67.2
>  * Gentoo: libpng-1.2.12, OpenSuSE: libpng-1.2.8
>  * Gentoo: Xorg-6.8.2 (mga), OpenSuSE: 6.9.0 (nvidia)
>  * Gentoo: freeglut-2.4.0, OpenSuSE:  freeglut-051110
>  * OpenSuse: mesa-6.4.2
> 

  Just a quick question: if you use an example with
text in it, does the text show up in the output on
the version that works (OpenSuSE)?  Someone else reported
no crash, but no text output either.

   Otherwise I can't help.  For what it's worth,
I discovered that in the Ubuntu (and I assume any
Gnome) desktop, Alt-PrintScreen does screen capture
on a single window, which is a good workaround 
for rgl.snapshot() [although it would still be nice
to have rgl.postscript() working ...]

  Ben Bolker

__
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.