Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.graphics.apps.gnuplot > #3758 > unrolled thread

pdfcairo/pngcairo file size limitations?

Started byschwarz.cd48@gmail.com
First post2017-09-28 06:07 -0700
Last post2017-10-02 13:52 -0700
Articles 6 — 4 participants

Back to article view | Back to comp.graphics.apps.gnuplot


Contents

  pdfcairo/pngcairo file size limitations? schwarz.cd48@gmail.com - 2017-09-28 06:07 -0700
    Re: pdfcairo/pngcairo file size limitations? Karl Ratzsch <mail.kfr@gmx.net> - 2017-09-28 22:47 +0200
      Re: pdfcairo/pngcairo file size limitations? schwarz.cd48@gmail.com - 2017-09-29 02:18 -0700
      Re: pdfcairo/pngcairo file size limitations? Ethan A Merritt <EAMerritt@gmail.com> - 2017-10-02 09:18 -0700
        Re: pdfcairo/pngcairo file size limitations? Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-10-02 11:44 -0700
          Re: pdfcairo/pngcairo file size limitations? Ethan A Merritt <sfeam@users.sourceforge.net> - 2017-10-02 13:52 -0700

#3758 — pdfcairo/pngcairo file size limitations?

Fromschwarz.cd48@gmail.com
Date2017-09-28 06:07 -0700
Subjectpdfcairo/pngcairo file size limitations?
Message-ID<413dce00-720f-411e-b421-007fc459f1dd@googlegroups.com>
gnuplot version 5.0 patchlevel 0


Hello gplusers,

I am trying to make a matrix plot of a file that is made up of 48 columns and 50000 lines. Each column contains integers between 0 - 140. I also want to produce a pdf in the end. The script for the plot looks like this

    #!/usr/bin/gnuplot
    set terminal pdfcairo font ",60" size 16,18
    set output "output.pdf"

    set cbrange [0:140]
    plot 'data.file' u 1:2:3 matrix wi image

The problem is that in the output.pdf the plot area/canvas is empty and only the xtics, ytics, and cbtics are shown. If I open gnuplot in the terminal and just do the plot in the standard qt terminal I will see the plot normally as expected, but it won't be produced in the pdf. The same goes for the pngcairo terminal. On the other hand, if I use 

    set terminal postscript eps enhanced

then the output.eps will contain the plot with no problems and I can convert eps to pdf.

But why does the pdfcairo/pngcairo not work?

I also found that if I reduce the number of lines in my 'data.file' from 50000 to 30000 (cutting off 2/5 of my data), then I will get a normal plot in my output.pdf. If I increase it again to 40000, the canvas will again be empty again. Does pdfcairo have some limitations here?

Cheers,
Paul

[toc] | [next] | [standalone]


#3759

FromKarl Ratzsch <mail.kfr@gmx.net>
Date2017-09-28 22:47 +0200
Message-ID<oqjn5i$n95$1@solani.org>
In reply to#3758
Am 28.09.2017 um 15:07 schrieb schwarz.cd48@gmail.com:
> gnuplot version 5.0 patchlevel 0

> I am trying to make a matrix plot of a file that is made up of 48 columns and 50000 lines. Each column contains integers between 0 - 140. I also want to produce a pdf in the end. The script for the plot looks like 

>     plot 'data.file' u 1:2:3 matrix wi image
> 
> The problem is that in the output.pdf the plot area/canvas is empty and only the xtics, ytics, and cbtics are shown. If I open gnuplot in the terminal and just do the plot in the standard qt terminal I will see the plot normally as expected, but it won't be produced in the pdf. The same goes for the pngcairo terminal. On the other hand, if I use 
> 
>     set terminal postscript eps enhanced
> 
> then the output.eps will contain the plot with no problems and I can convert eps to pdf.
> 
> But why does the pdfcairo/pngcairo not work?
> 
> I also found that if I reduce the number of lines in my 'data.file' from 50000 to 30000 (cutting off 2/5 of my data), then I will get a normal plot in my output.pdf. If I increase it again to 40000, the canvas will again be empty again. Does pdfcairo have some limitations here?


Yes, there is a problem. The following script produces a dataset
like yours and works on qt and windows terminal, crashes wxt, and
leaves an empty canvas with pdfcairo. (Tested on gp5.2pl0)


t=time(0)
n=40000
m=48
set print $dat;do for [i=1:n] {
  s=""
  do for [j=1:m] {s=s.sprintf(" %.2f",rand(0.))}
  if (i%1000==0) {set print; print i." of ".n;set print $dat append}
  print s}
set print
print time(0)-t

plot $dat us 1:2:3 matrix w image

[toc] | [prev] | [next] | [standalone]


#3760

Fromschwarz.cd48@gmail.com
Date2017-09-29 02:18 -0700
Message-ID<2a8d4872-467a-4941-9930-4596bc32073c@googlegroups.com>
In reply to#3759
Am Donnerstag, 28. September 2017 22:47:47 UTC+2 schrieb Karl Ratzsch:
> Am 28.09.2017 um 15:07 schrieb schwarz.cd48@gmail.com:
> > gnuplot version 5.0 patchlevel 0
> 
> > I am trying to make a matrix plot of a file that is made up of 48 columns and 50000 lines. Each column contains integers between 0 - 140. I also want to produce a pdf in the end. The script for the plot looks like 
> 
> >     plot 'data.file' u 1:2:3 matrix wi image
> > 
> > The problem is that in the output.pdf the plot area/canvas is empty and only the xtics, ytics, and cbtics are shown. If I open gnuplot in the terminal and just do the plot in the standard qt terminal I will see the plot normally as expected, but it won't be produced in the pdf. The same goes for the pngcairo terminal. On the other hand, if I use 
> > 
> >     set terminal postscript eps enhanced
> > 
> > then the output.eps will contain the plot with no problems and I can convert eps to pdf.
> > 
> > But why does the pdfcairo/pngcairo not work?
> > 
> > I also found that if I reduce the number of lines in my 'data.file' from 50000 to 30000 (cutting off 2/5 of my data), then I will get a normal plot in my output.pdf. If I increase it again to 40000, the canvas will again be empty again. Does pdfcairo have some limitations here?
> 
> 
> Yes, there is a problem. The following script produces a dataset
> like yours and works on qt and windows terminal, crashes wxt, and
> leaves an empty canvas with pdfcairo. (Tested on gp5.2pl0)
> 
> 
> t=time(0)
> n=40000
> m=48
> set print $dat;do for [i=1:n] {
>   s=""
>   do for [j=1:m] {s=s.sprintf(" %.2f",rand(0.))}
>   if (i%1000==0) {set print; print i." of ".n;set print $dat append}
>   print s}
> set print
> print time(0)-t
> 
> plot $dat us 1:2:3 matrix w image

I guess I report it as a bug then

[toc] | [prev] | [next] | [standalone]


#3761

FromEthan A Merritt <EAMerritt@gmail.com>
Date2017-10-02 09:18 -0700
Message-ID<oqtotf$nao$1@dont-email.me>
In reply to#3759
Karl Ratzsch wrote:

> Am 28.09.2017 um 15:07 schrieb schwarz.cd48@gmail.com:
>> gnuplot version 5.0 patchlevel 0
> 
>> I am trying to make a matrix plot of a file that is made up of 48
>> columns and 50000 lines. Each column contains integers between 0 -
>> 140. I also want to produce a pdf in the end. The script for the plot
>> looks like
> 
>>     plot 'data.file' u 1:2:3 matrix wi image
>> 
>> The problem is that in the output.pdf the plot area/canvas is empty
>> and only the xtics, ytics, and cbtics are shown. If I open gnuplot in
>> the terminal and just do the plot in the standard qt terminal I will
>> see the plot normally as expected, but it won't be produced in the
>> pdf. The same goes for the pngcairo terminal. On the other hand, if I
>> use
>> 
>>     set terminal postscript eps enhanced
>> 
>> then the output.eps will contain the plot with no problems and I can
>> convert eps to pdf.
>> 
>> But why does the pdfcairo/pngcairo not work?
>> 
>> I also found that if I reduce the number of lines in my 'data.file'
>> from 50000 to 30000 (cutting off 2/5 of my data), then I will get a
>> normal plot in my output.pdf. If I increase it again to 40000, the
>> canvas will again be empty again. Does pdfcairo have some limitations
>> here?
> 
> 
> Yes, there is a problem. The following script produces a dataset
> like yours and works on qt and windows terminal, crashes wxt, and
> leaves an empty canvas with pdfcairo. (Tested on gp5.2pl0)
> 
> 
> t=time(0)
> n=40000
> m=48
> set print $dat;do for [i=1:n] {
>   s=""
>   do for [j=1:m] {s=s.sprintf(" %.2f",rand(0.))}
>   if (i%1000==0) {set print; print i." of ".n;set print $dat append}
>   print s}
> set print
> print time(0)-t
> 
> plot $dat us 1:2:3 matrix w image

Your test script fails here under linux, but it fails because the string
in $dat  gets too long.  
If I change it to write to a file then I see no problem.
Tested with qt, wxt, pdfcairo terminals.

On a system+terminal where you see problems, can it correctly process
a large *.png or *.jpg image?  Take some multi-megapixel photo and try
displaying it with

gnuplot>   plot 'photo.jpeg' binary filetype=jpeg with rgbimage





[toc] | [prev] | [next] | [standalone]


#3762

FromEthan A Merritt <sfeam@users.sourceforge.net>
Date2017-10-02 11:44 -0700
Message-ID<oqu1e9$t1n$1@dont-email.me>
In reply to#3761
Ethan A Merritt wrote:

> Karl Ratzsch wrote:
> 
>> Am 28.09.2017 um 15:07 schrieb schwarz.cd48@gmail.com:
>>> gnuplot version 5.0 patchlevel 0
>> 
>>> I am trying to make a matrix plot of a file that is made up of 48
>>> columns and 50000 lines. Each column contains integers between 0 -
>>> 140. I also want to produce a pdf in the end. The script for the plot
>>> looks like
>> 
>>>     plot 'data.file' u 1:2:3 matrix wi image
>>> 
>>> The problem is that in the output.pdf the plot area/canvas is empty
>>> and only the xtics, ytics, and cbtics are shown. If I open gnuplot in
>>> the terminal and just do the plot in the standard qt terminal I will
>>> see the plot normally as expected, but it won't be produced in the
>>> pdf. The same goes for the pngcairo terminal. On the other hand, if I
>>> use
>>> 
>>>     set terminal postscript eps enhanced
>>> 
>>> then the output.eps will contain the plot with no problems and I can
>>> convert eps to pdf.
>>> 
>>> But why does the pdfcairo/pngcairo not work?
>>> 
>>> I also found that if I reduce the number of lines in my 'data.file'
>>> from 50000 to 30000 (cutting off 2/5 of my data), then I will get a
>>> normal plot in my output.pdf. If I increase it again to 40000, the
>>> canvas will again be empty again. Does pdfcairo have some limitations
>>> here?
>> 
>> 
>> Yes, there is a problem. The following script produces a dataset
>> like yours and works on qt and windows terminal, crashes wxt, and
>> leaves an empty canvas with pdfcairo. (Tested on gp5.2pl0)
>> 
>> 
>> t=time(0)
>> n=40000
>> m=48
>> set print $dat;do for [i=1:n] {
>>   s=""
>>   do for [j=1:m] {s=s.sprintf(" %.2f",rand(0.))}
>>   if (i%1000==0) {set print; print i." of ".n;set print $dat append}
>>   print s}
>> set print
>> print time(0)-t
>> 
>> plot $dat us 1:2:3 matrix w image
> 
> Your test script fails here under linux, but it fails because the string
> in $dat  gets too long.
> If I change it to write to a file then I see no problem.
> Tested with qt, wxt, pdfcairo terminals.
> 
> On a system+terminal where you see problems, can it correctly process
> a large *.png or *.jpg image?  Take some multi-megapixel photo and try
> displaying it with
> 
> gnuplot>   plot 'photo.jpeg' binary filetype=jpeg with rgbimage

Aha.  I tried on another machine and got a cairo error message from the
long-string failure:

Cairo is unhappy: invalid value (typically too big) for the 
                  size of the input (surface, pattern, etc.)

That error message comes from a maximum length limit inside the
cairo library.

[toc] | [prev] | [next] | [standalone]


#3763

FromEthan A Merritt <sfeam@users.sourceforge.net>
Date2017-10-02 13:52 -0700
Message-ID<oqu8v0$pj0$1@dont-email.me>
In reply to#3762
Ethan A Merritt wrote:

> Ethan A Merritt wrote:
> 
>> Karl Ratzsch wrote:
>> 
>>> Am 28.09.2017 um 15:07 schrieb schwarz.cd48@gmail.com:
>>>> gnuplot version 5.0 patchlevel 0
>>> 
>>>> I am trying to make a matrix plot of a file that is made up of 48
>>>> columns and 50000 lines. Each column contains integers between 0 -
>>>> 140. I also want to produce a pdf in the end. The script for the plot
>>>> looks like
>>> 
>>>>     plot 'data.file' u 1:2:3 matrix wi image
>>>> 
>>>> The problem is that in the output.pdf the plot area/canvas is empty
>>>> and only the xtics, ytics, and cbtics are shown. If I open gnuplot in
>>>> the terminal and just do the plot in the standard qt terminal I will
>>>> see the plot normally as expected, but it won't be produced in the
>>>> pdf. The same goes for the pngcairo terminal. On the other hand, if I
>>>> use
>>>> 
>>>>     set terminal postscript eps enhanced
>>>> 
>>>> then the output.eps will contain the plot with no problems and I can
>>>> convert eps to pdf.
>>>> 
>>>> But why does the pdfcairo/pngcairo not work?
>>>> 
>>>> I also found that if I reduce the number of lines in my 'data.file'
>>>> from 50000 to 30000 (cutting off 2/5 of my data), then I will get a
>>>> normal plot in my output.pdf. If I increase it again to 40000, the
>>>> canvas will again be empty again. Does pdfcairo have some limitations
>>>> here?
>>> 
>>> 
>>> Yes, there is a problem. The following script produces a dataset
>>> like yours and works on qt and windows terminal, crashes wxt, and
>>> leaves an empty canvas with pdfcairo. (Tested on gp5.2pl0)
>>> 
>>> 
>>> t=time(0)
>>> n=40000
>>> m=48
>>> set print $dat;do for [i=1:n] {
>>>   s=""
>>>   do for [j=1:m] {s=s.sprintf(" %.2f",rand(0.))}
>>>   if (i%1000==0) {set print; print i." of ".n;set print $dat append}
>>>   print s}
>>> set print
>>> print time(0)-t
>>> 
>>> plot $dat us 1:2:3 matrix w image
>> 
>> Your test script fails here under linux, but it fails because the string
>> in $dat  gets too long.
>> If I change it to write to a file then I see no problem.
>> Tested with qt, wxt, pdfcairo terminals.
>> 
>> On a system+terminal where you see problems, can it correctly process
>> a large *.png or *.jpg image?  Take some multi-megapixel photo and try
>> displaying it with
>> 
>> gnuplot>   plot 'photo.jpeg' binary filetype=jpeg with rgbimage
> 
> Aha.  I tried on another machine and got a cairo error message from the
> long-string failure:
> 
> Cairo is unhappy: invalid value (typically too big) for the
>                   size of the input (surface, pattern, etc.)
> 
> That error message comes from a maximum length limit inside the
> cairo library.

It turns out that cairo handles a maximum bitmap size of 32Kx32K.

From the cairo source at
https://github.com/tordex/cairo/blob/master/src/cairo-image-surface.c

/* Limit on the width / height of an image surface in pixels.  This is
 * mainly determined by coordinates of things sent to pixman at the
 * moment being in 16.16 format. */
#define MAX_IMAGE_SIZE 32767






[toc] | [prev] | [standalone]


Back to top | Article view | comp.graphics.apps.gnuplot


csiph-web