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


Groups > comp.graphics.apps.gnuplot > #3614

Re: Point size default

From Ethan A Merritt <EAMerritt@gmail.com>
Newsgroups comp.graphics.apps.gnuplot
Subject Re: Point size default
Date 2017-04-05 21:25 -0700
Organization A noiseless patient Spider
Message-ID <oc4fpb$dad$1@dont-email.me> (permalink)
References <51e94c93-b07f-421a-aaa7-35378e81e01f@googlegroups.com> <obtb6h$ptk$1@solani.org> <55d7ab13-0a81-481b-9a81-728b7156117d@googlegroups.com>

Show all headers | View raw


jacques.Lebourlot@obspm.fr wrote:

> Le lundi 3 avril 2017 13:20:52 UTC+2, Karl Ratzsch a écrit :
>> Am 03.04.2017 um 10:27 schrieb jacques.Lebourlot@obspm.fr:
>> > 
>> > (This was posted on "Gnuplot in Action" forum some time ago, but
>> > did not get any answer. I need it again...)
>> > 
>> > Point sizes are scaled from a "default" size, but I can't find the
>> > (terminal dependent) absolute value of this default.
>> > 
>> > I wish to set a single point (pt 6) in a 3D splot to get a fixed
>> > circle of (physical) size 1, in the plane of the screen, when I
>> > change view with the mouse. This is to illustrate 3D coordinate
>> > systems (see the simplified example below).
>> > 
>> > I managed to adjust the size by trial and error (45.5*sc below)),
>> > but it would be much more convenient to compute the scaling factor
>> > from known values. Hence, I need the default point size...
>> > 
>> 
>> Point sizes are defined per terminal, and not guaranteed to have a
>> certain absolute size.
>> 
>> You can either plot with style "circles", or put the circle at the
>> desired position directly via "set object circle".
>> 
>>    $zero << EOD
>>    0
>>    EOD
>>    plot $zero us 1:1:(6) with circles
>> 
>> or
>> 
>>    set object 1 circle at 0,0 size 6
>> 
>> hth.
>> 
>>  Karl
> 
> No! Please check carefully the example given (at the end of my initial
> message).
> 
> * This is a 3D plot (splot), not 2D. hence I cannot use objects.
> * "6" is not the size, but the "point type" (pt), which is an empty
> circle * That circle MUST have exacly a physical size of "1.0" => i.e.
> a radius equal to the unit size of the 3 axes. * It must stay in the
> plane of the screen when I move the 3D object with the mouse.
> 
> I know that sizes are terminal dependent. That is the point of the
> question... I had to ajust things by trial and errors, by multiplying
> an "unknown" initial size to get the desired result. That size *has*
> to be defined (or computed) somewhere in the code, and passed to the
> graphical engine at some point, but I am not fluent enough in C to
> find where from the source code.
> 
> Thank you for taking the time to answer anyway.
> 
> Jacques

If you are using gnuplot 5, the following may give you some ideas 
about other ways to create such a plot.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
unset border
set angles degrees
set view  equal xyz
set style data lines
set zzeroaxis
set xyplane at 0
unset xtics
unset ytics
unset ztics
set xrange [ -1.0 : 1.0 ]
set yrange [ -1.0 : 1.0 ]
set zrange [ -1.0 : 1.0 ]
#
R = 0.3
set object 1 circle at screen 0.5, 0.5 radius screen R
#
splot sample [u=0:360] '+' using (cos(u)):(0):(sin(u)) with lines, \
             [u=0:360] '+' using (cos(u)):(sin(u)):(0), \
             [u=0:360] '+' using (0):(cos(u)):(sin(u))
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

There is still an issue with scaling the fixed circle radius.
It may be possible to work out the desired screen fraction 
dynamically using variables GPVAL_TERM_XMIN, GPVAL_TERM_XMAX, GPVAL_TERM_XSIZE, 
but I didn't pursue that.  Those are defined for the 2D plot layout,  not 3D, 
so additional fudge-factors would be needed.

The development version (gnuplot 5.1) allows you to give the radius in 
plot or axis coordinates rather than screen coordinates, which may or may not
make it easier.

     Ethan

Back to comp.graphics.apps.gnuplot | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Point size default jacques.Lebourlot@obspm.fr - 2017-04-03 01:27 -0700
  Re: Point size default Karl Ratzsch <mail.kfr@gmx.net> - 2017-04-03 13:20 +0200
    Re: Point size default jacques.Lebourlot@obspm.fr - 2017-04-03 06:57 -0700
      Re: Point size default Karl Ratzsch <mail.kfr@gmx.net> - 2017-04-04 06:02 +0200
        Re: Point size default jacques.Lebourlot@obspm.fr - 2017-04-05 09:21 -0700
      Re: Point size default Ethan A Merritt <EAMerritt@gmail.com> - 2017-04-05 21:25 -0700
        Re: Point size default jacques.Lebourlot@obspm.fr - 2017-04-08 05:10 -0700

csiph-web