Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.graphics.apps.gnuplot > #3609 > unrolled thread
| Started by | jacques.Lebourlot@obspm.fr |
|---|---|
| First post | 2017-04-03 01:27 -0700 |
| Last post | 2017-04-08 05:10 -0700 |
| Articles | 7 — 3 participants |
Back to article view | Back to comp.graphics.apps.gnuplot
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
| From | jacques.Lebourlot@obspm.fr |
|---|---|
| Date | 2017-04-03 01:27 -0700 |
| Subject | Point size default |
| Message-ID | <51e94c93-b07f-421a-aaa7-35378e81e01f@googlegroups.com> |
(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...
Any idea?
Thank you.
Jacques
PS: load the file interactively in gnuplot, then use the mouse to change view. The two blue circles (seen as ellipses) should stay tangent to the black one, whatever the view point.
Save the following code in a file.
-----------------------------------------------------------
# Optimized for interactive terminal (change view with the mouse)
set term wxt size 960, 576
set output
sc = 1.5
# Set a few global options
set angle degr
unset border
unset tics
set xran [-1.1:1.1]
set yran [-1.1:1.1]
set zran [-1.1:1.1]
set xyplane 0
set view equal xyz
set view 70, 110, sc
# Create a "heredoc" with the needed data
set print $M append
print "0.0 0.0 0.0"
print " "
do for [th = 0: 80: 1] {print cos(th*4.5), sin(th*4.5), 0.0}
print " "
do for [th = 0: 80: 1] {print 0.0, cos(th*4.5), sin(th*4.5)}
set arrow 1 from 0.0, 0.0, 0.0 to 0.0, 0.0, 1.25
set arrow 2 from 0.0, 0.0, 0.0 to 0.0, 1.25, 0.0
set arrow 3 from 0.0, 0.0, 0.0 to 1.25, 0.0, 0.0
splot \
$M ever :::0::0 not w p lc rgb "black" pt 6 ps 45.5*sc, \
$M ever :::1::1 not w l lt 6 lw 1, \
$M ever :::2::2 not w l lt 6 lw 1
-----------------------------------------------------------
[toc] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2017-04-03 13:20 +0200 |
| Message-ID | <obtb6h$ptk$1@solani.org> |
| In reply to | #3609 |
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
[toc] | [prev] | [next] | [standalone]
| From | jacques.Lebourlot@obspm.fr |
|---|---|
| Date | 2017-04-03 06:57 -0700 |
| Message-ID | <55d7ab13-0a81-481b-9a81-728b7156117d@googlegroups.com> |
| In reply to | #3610 |
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
[toc] | [prev] | [next] | [standalone]
| From | Karl Ratzsch <mail.kfr@gmx.net> |
|---|---|
| Date | 2017-04-04 06:02 +0200 |
| Message-ID | <obv5s9$33d$1@solani.org> |
| In reply to | #3611 |
Am 03.04.2017 um 15:57 schrieb jacques.Lebourlot@obspm.fr: > 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. Ah, sorry. I wasn't aware that both don't work in 3D plots. Well, you could derive it from the source code, but that's also by no means a clean solution, plus sounds tricky. What's wrong with using an empirical value instead? There are two variables GPVAL_VIEW_ROT_(X/Z) that would allow you to always have a plotted circle's normal always point in the viewers direction, but they only update upon "replot", not during mousing.
[toc] | [prev] | [next] | [standalone]
| From | jacques.Lebourlot@obspm.fr |
|---|---|
| Date | 2017-04-05 09:21 -0700 |
| Message-ID | <0d68b8c8-a986-4f39-8572-cc3725c5cd4f@googlegroups.com> |
| In reply to | #3612 |
> What's wrong with > using an empirical value instead? > I have to find an empirical value while "mousing around" (live demo, or looking for the best view point). Then I want to get a nice picture in my textbook, hence, I switch from wxt to pdf cairo, ...and I have to find another empirical value. So, I'd like compute directly the right one by: "Scaling_factor = 1.0 / terminal_default_value" > There are two variables GPVAL_VIEW_ROT_(X/Z) I may try to use that just before saving the PDF. Thanks for the tip.
[toc] | [prev] | [next] | [standalone]
| From | Ethan A Merritt <EAMerritt@gmail.com> |
|---|---|
| Date | 2017-04-05 21:25 -0700 |
| Message-ID | <oc4fpb$dad$1@dont-email.me> |
| In reply to | #3611 |
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
[toc] | [prev] | [next] | [standalone]
| From | jacques.Lebourlot@obspm.fr |
|---|---|
| Date | 2017-04-08 05:10 -0700 |
| Message-ID | <de11ec59-f4b1-4390-a7ea-8496cd6cf63f@googlegroups.com> |
| In reply to | #3614 |
Le jeudi 6 avril 2017 06:25:06 UTC+2, Ethan A Merritt a écrit : > 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 Nice! Thank you. But I still have to find the correct R by trial and error. I will wait for the new version. Jacques
[toc] | [prev] | [standalone]
Back to top | Article view | comp.graphics.apps.gnuplot
csiph-web