|
From: Allin C. <cot...@wf...> - 2007-11-19 21:29:00
|
I've been playing with pngcairo and pdfcairo and I like what I see. However, I've hit one problem, with a polar plot where I want a (really circular!) circle in the output. In the old png and pdf terminal I can achieve this with set size square But this does not produce a circle in pngcairo and pdfcairo: it produces a vertically elongated ellipse. In pngcairo I get what looks like a perfect circle with set size ratio .5 In pdfcairo this produces an approximation to a circle, but not a very good one. -- Allin Cottrell Department of Economics Wake Forest University, NC |
|
From: Ethan M. <merritt@u.washington.edu> - 2007-11-20 01:37:41
|
On Monday 19 November 2007 13:27, Allin Cottrell wrote: >=20 > set size square >=20 > But this does not produce a circle in pngcairo and pdfcairo: it=20 > produces a vertically elongated ellipse. =20 You are right. =20 It looks like the aspect ratio code is broken in all of the cairo-based terminals including wxt. Worse, I can't even see how it is _supposed_ to work. Who/what/where is maintaining the values of=20 term->xmax and term->ymax term->h_tic and term->v_tic ? These are used to calculate aspect ratio, but I think the cairo drivers are not setting them to useful values either initially or when the window is resized. I'm hoping Timoth=E9e can provide a simple fix. =2D-=20 Ethan A Merritt |
|
From: <tim...@lp...> - 2007-11-20 08:29:37
|
Ethan Merritt a écrit : > On Monday 19 November 2007 13:27, Allin Cottrell wrote: > >> set size square >> >> But this does not produce a circle in pngcairo and pdfcairo: it >> produces a vertically elongated ellipse. >> > > You are right. > It looks like the aspect ratio code is broken in > all of the cairo-based terminals including wxt. > > Worse, I can't even see how it is _supposed_ to work. > Who/what/where is maintaining the values of > term->xmax and term->ymax > term->h_tic and term->v_tic ? > These are used to calculate aspect ratio, but I think the > cairo drivers are not setting them to useful values either > initially or when the window is resized. > > I'm hoping Timothée can provide a simple fix. > Hi, term->xmax and term->ymax are updated in *_graphics(), the latter also calls *_set_font() which sets term->h_tic, v_tic, v_char, h_char, based on the font size. For me it works: set term wxt set size square set polar plot 1 ...gives a square circle. And it works in pfdcairo and pngcairo too... Could you give the whole sequence of commands you use ? Best regards, Timothée |
|
From: Ethan A M. <merritt@u.washington.edu> - 2007-11-20 16:37:30
|
On Monday 19 November 2007 23:23, you wrote:
> > It looks like the aspect ratio code is broken in
> > all of the cairo-based terminals including wxt.
>
> term->xmax and term->ymax are updated in *_graphics(), the latter also
> calls *_set_font() which sets term->h_tic, v_tic, v_char, h_char, based
> on the font size.
>
> For me it works:
>
> set term wxt
> set size square
> set polar
> plot 1
>
> ...gives a square circle.
> Could you give the whole sequence of commands you use ?
lascaux [1007] ./gnuplot
G N U P L O T
Version 4.3 patchlevel CVS-16Nov2007
last modified Sun Nov 18 20:51:17 PST 2007
System: Linux 2.6.12-24mdksmp
Copyright (C) 1986 - 1993, 1998, 2004, 2007
Thomas Williams, Colin Kelley and many others
Type `help` to access the on-line reference manual.
The gnuplot FAQ is available from
http://www.gnuplot.info/faq/
Send comments and help requests to <gnu...@li...>
Send bug reports and suggestions to <gnu...@li...>
Terminal type set to 'wxt'
gnuplot> set size square
gnuplot> plot sin(x)
gnuplot> set term pngcairo
Terminal type set to 'pngcairo'
Options are ' size 640, 480 '
gnuplot> set output 'pngcairo_1.png'
gnuplot> replot
gnuplot> show size
size is scaled by 1,1
Try to set aspect ratio to 1:1.0
> And it works in pfdcairo and pngcairo too...
I got your command sequence to work using a 1 Aug 2007 build
from CVS, but it does not work using the current cvs.
Something must have broken.
I guess I'll have to sample from the cvs tree for the last
3 months and see what happened.
--
Ethan A Merritt
|
|
From: <tim...@lp...> - 2007-11-20 16:53:10
|
Ethan A Merritt a écrit : > On Monday 19 November 2007 23:23, you wrote: > >>> It looks like the aspect ratio code is broken in >>> all of the cairo-based terminals including wxt. >>> >> term->xmax and term->ymax are updated in *_graphics(), the latter also >> calls *_set_font() which sets term->h_tic, v_tic, v_char, h_char, based >> on the font size. >> >> For me it works: >> >> set term wxt >> set size square >> set polar >> plot 1 >> >> ...gives a square circle. >> Could you give the whole sequence of commands you use ? >> > > lascaux [1007] ./gnuplot > > G N U P L O T > Version 4.3 patchlevel CVS-16Nov2007 > last modified Sun Nov 18 20:51:17 PST 2007 > System: Linux 2.6.12-24mdksmp > > Copyright (C) 1986 - 1993, 1998, 2004, 2007 > Thomas Williams, Colin Kelley and many others > > Type `help` to access the on-line reference manual. > The gnuplot FAQ is available from > http://www.gnuplot.info/faq/ > > Send comments and help requests to <gnu...@li...> > Send bug reports and suggestions to <gnu...@li...> > > > Terminal type set to 'wxt' > gnuplot> set size square > gnuplot> plot sin(x) > gnuplot> set term pngcairo > Terminal type set to 'pngcairo' > Options are ' size 640, 480 ' > gnuplot> set output 'pngcairo_1.png' > gnuplot> replot > gnuplot> show size > > size is scaled by 1,1 > Try to set aspect ratio to 1:1.0 > > >> And it works in pfdcairo and pngcairo too... >> > > I got your command sequence to work using a 1 Aug 2007 build > from CVS, but it does not work using the current cvs. > Something must have broken. > > I guess I'll have to sample from the cvs tree for the last > 3 months and see what happened. > Hmm, I just tried with current CVS and I get the said problem. The previous version I had was only a few days old. Timothée |
|
From: <tim...@lp...> - 2007-11-20 16:56:43
|
Timothée Lecomte a écrit : > Ethan A Merritt a écrit : > >> On Monday 19 November 2007 23:23, you wrote: >> >> >>>> It looks like the aspect ratio code is broken in >>>> all of the cairo-based terminals including wxt. >>>> >>>> >>> term->xmax and term->ymax are updated in *_graphics(), the latter also >>> calls *_set_font() which sets term->h_tic, v_tic, v_char, h_char, based >>> on the font size. >>> >>> For me it works: >>> >>> set term wxt >>> set size square >>> set polar >>> plot 1 >>> >>> ...gives a square circle. >>> Could you give the whole sequence of commands you use ? >>> >>> >> lascaux [1007] ./gnuplot >> >> G N U P L O T >> Version 4.3 patchlevel CVS-16Nov2007 >> last modified Sun Nov 18 20:51:17 PST 2007 >> System: Linux 2.6.12-24mdksmp >> >> Copyright (C) 1986 - 1993, 1998, 2004, 2007 >> Thomas Williams, Colin Kelley and many others >> >> Type `help` to access the on-line reference manual. >> The gnuplot FAQ is available from >> http://www.gnuplot.info/faq/ >> >> Send comments and help requests to <gnu...@li...> >> Send bug reports and suggestions to <gnu...@li...> >> >> >> Terminal type set to 'wxt' >> gnuplot> set size square >> gnuplot> plot sin(x) >> gnuplot> set term pngcairo >> Terminal type set to 'pngcairo' >> Options are ' size 640, 480 ' >> gnuplot> set output 'pngcairo_1.png' >> gnuplot> replot >> gnuplot> show size >> >> size is scaled by 1,1 >> Try to set aspect ratio to 1:1.0 >> >> >> >>> And it works in pfdcairo and pngcairo too... >>> >>> >> I got your command sequence to work using a 1 Aug 2007 build >> from CVS, but it does not work using the current cvs. >> Something must have broken. >> >> I guess I'll have to sample from the cvs tree for the last >> 3 months and see what happened. >> >> > > Hmm, I just tried with current CVS and I get the said problem. The > previous version I had was only a few days old. > > Timothée Ok, found the typo ! I'll commit the fix as soon as I come back from my meeting tonight. Timothée |
|
From: <tim...@lp...> - 2007-11-20 22:05:00
|
Timothée Lecomte a écrit : > Timothée Lecomte a écrit : > >> Ethan A Merritt a écrit : >> >> >>> On Monday 19 November 2007 23:23, you wrote: >>> >>> >>> >>>>> It looks like the aspect ratio code is broken in >>>>> all of the cairo-based terminals including wxt. >>>>> >>>>> >>>>> >>>> term->xmax and term->ymax are updated in *_graphics(), the latter also >>>> calls *_set_font() which sets term->h_tic, v_tic, v_char, h_char, based >>>> on the font size. >>>> >>>> For me it works: >>>> >>>> set term wxt >>>> set size square >>>> set polar >>>> plot 1 >>>> >>>> ...gives a square circle. >>>> Could you give the whole sequence of commands you use ? >>>> >>>> >>>> >>> lascaux [1007] ./gnuplot >>> >>> G N U P L O T >>> Version 4.3 patchlevel CVS-16Nov2007 >>> last modified Sun Nov 18 20:51:17 PST 2007 >>> System: Linux 2.6.12-24mdksmp >>> >>> Copyright (C) 1986 - 1993, 1998, 2004, 2007 >>> Thomas Williams, Colin Kelley and many others >>> >>> Type `help` to access the on-line reference manual. >>> The gnuplot FAQ is available from >>> http://www.gnuplot.info/faq/ >>> >>> Send comments and help requests to <gnu...@li...> >>> Send bug reports and suggestions to <gnu...@li...> >>> >>> >>> Terminal type set to 'wxt' >>> gnuplot> set size square >>> gnuplot> plot sin(x) >>> gnuplot> set term pngcairo >>> Terminal type set to 'pngcairo' >>> Options are ' size 640, 480 ' >>> gnuplot> set output 'pngcairo_1.png' >>> gnuplot> replot >>> gnuplot> show size >>> >>> size is scaled by 1,1 >>> Try to set aspect ratio to 1:1.0 >>> >>> >>> >>> >>>> And it works in pfdcairo and pngcairo too... >>>> >>>> >>>> >>> I got your command sequence to work using a 1 Aug 2007 build >>> from CVS, but it does not work using the current cvs. >>> Something must have broken. >>> >>> I guess I'll have to sample from the cvs tree for the last >>> 3 months and see what happened. >>> >>> >>> >> Hmm, I just tried with current CVS and I get the said problem. The >> previous version I had was only a few days old. >> >> Timothée >> > Ok, found the typo ! I'll commit the fix as soon as I come back from my > meeting tonight. > > Timothée > > I have commited the fix to CVS. For those of you who want to have it right now instead of waiting for the anonymous CVS to be updated, just change the following line in src/wxterminal/gp_cairo.c (around line 1663): tmp_h_tic = tmp_h_char/2.5; to tmp_h_tic = tmp_v_char/2.5; Sorry for this error, and thanks for reporting ! Best regards, Timothée Lecomte |
|
From: Allin C. <cot...@wf...> - 2007-11-20 16:33:49
|
On Tue, 20 Nov 2007, Timothée Lecomte wrote: > term->xmax and term->ymax are updated in *_graphics(), the > latter also calls *_set_font() which sets term->h_tic, v_tic, > v_char, h_char, based on the font size. > > For me it works: > > set term wxt > set size square > set polar > plot 1 > > ...gives a square circle. Hmm, I just did a CVS update and tried the exact commands above, with the wxt terminal. Here, the circle is compressed in the horizontal dimension: the height seems to be twice the width. The numbers on the x-axis are also compressed and overlapping each other. waverley:~$ uname -a Linux waverley 2.6.23.8 #1 SMP PREEMPT Sun Nov 18 10:50:56 EST 2007 i686 GNU/Linux waverley:~$ pkg-config --modversion cairo 1.4.10 waverley:~$ pkg-config --modversion pango 1.18.3 Allin Cottrell |
|
From: Dmitri A. S. <das...@gm...> - 2007-11-20 16:38:26
|
On Nov 20, 2007 10:32 AM, Allin Cottrell <cot...@wf...> wrote: > On Tue, 20 Nov 2007, Timoth=E9e Lecomte wrote: > > > term->xmax and term->ymax are updated in *_graphics(), the > > latter also calls *_set_font() which sets term->h_tic, v_tic, > > v_char, h_char, based on the font size. > > > > For me it works: > > > > set term wxt > > set size square > > set polar > > plot 1 > > > > ...gives a square circle. > > Hmm, I just did a CVS update and tried the exact commands above, > with the wxt terminal. Here, the circle is compressed in the > horizontal dimension: the height seems to be twice the width. > The numbers on the x-axis are also compressed and overlapping > each other. > > waverley:~$ uname -a > Linux waverley 2.6.23.8 #1 SMP PREEMPT Sun Nov 18 10:50:56 EST > 2007 i686 GNU/Linux > waverley:~$ pkg-config --modversion cairo > 1.4.10 > waverley:~$ pkg-config --modversion pango > 1.18.3 > > Allin Cottrell > I can confirm that on Fedora 8 (the same version of pango and cairo). Sincerely, Dmitri. -- |