Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

24.05.0 Can't Plot Vectors With wxdraw3d() #1949

Closed
LP314159 opened this issue Sep 2, 2024 · 6 comments
Closed

24.05.0 Can't Plot Vectors With wxdraw3d() #1949

LP314159 opened this issue Sep 2, 2024 · 6 comments

Comments

@LP314159
Copy link

LP314159 commented Sep 2, 2024

Entering the following commands into 24.05.0 causes gnuplot error:

load(draw)$
wxdraw3d(vector([0,0,0],[1,1,1]))$
Message from maxima's stderr stream: "/tmp/maxout_656_13.gnuplot" line 38: All edges undefined or out of range, thus no plot.

Entering the equivalent commands into Maxima results in normal plot with no error:

load(draw)$
draw3d(vector([0,0,0],[1,1,1]))$
[Normal Plot]

However, in wxMaxima, if I preceed the vector() object with another object then the plot is normal without error:

wxdraw3d(points([[1/10,1/10,1/10], [1/2,1/2,1/2]]),vector([0,0,0],[1,1,1]))$
[Normal Plot]

In this case I am using the "points()" object but any other object is also sufficient.

Also, in wxMaxima, using "draw3d()" in place of "wxdraw3d()" cuases a normal vector plot but the plot is not in-line but rather appears in an external window.

@daute
Copy link
Member

daute commented Oct 2, 2024

I looked at this some time ago and was not able to reproduce, now again - it seems to work here without problems. wxMaxima 24.05.0, wxMaxima current development version, Gnuplot 5.2, Gnuplot 6.0, etc.

Can you give more details? Gnuplot version, Maxima version, maybe an error on the console (perhaps from gnuplot), if you start wxMaxima from the console, etc.? Does it work with the recent release or perhaps the current git version of wxMaxima?
Or post the contents of the /tmp/maxout_<number-in-the-error-message>.gnuplot file?

@LP314159
Copy link
Author

LP314159 commented Oct 2, 2024

I may have found the source of the problem. See below.

I went through the motions again:

Start wxmaxima (24.05.0)
Enter commands:

load(draw)$
wxdraw3d(vector([0,0,0],[1,1,1]))$

Output:

Message from maxima's stderr stream: "/tmp/maxout_15238_1.gnuplot" line 38: All edges undefined or out of range, thus no plot.

Gnuplot version 6.0.1
Maxima version: 5.47.0

File output, maxout_15238_1.gnuplot:

set terminal pngcairo dashed enhanced truecolor size 800, 800
set out '/tmp/maxout_15238_1.png'
if(GPVAL_VERSION >= 5.0){set for [i=1:8] linetype i dashtype i; set format '%h'}
set zero 0.0
set datafile separator whitespace
set size 1.0, 1.0
set origin 0.0, 0.0
set obj 1 rectangle behind from screen 0.0,0.0 to screen 1.0,1.0
set style rectangle fillcolor rgb '#ffffff' fs solid 1.0 noborder
set xrange [0.0:1.0]
set yrange [0.0:1.0]
set zrange [0.0:1.0]
set cbrange [:]
set title ''
set xlabel ''
set ylabel ''
set zlabel ''
set datafile missing 'NIL'
unset logscale x
unset logscale y
unset logscale z
set key top center
unset logscale cb
unset grid
unset xzeroaxis
unset yzeroaxis
unset zzeroaxis
set xtics norotate border autofreq
set ytics norotate border autofreq
set ztics norotate border autofreq
set cbtics autofreq
set view 60, 30, 1, 1

set pm3d at s depthorder explicit
set colorbox
set cblabel ''
set palette rgbformulae 7,5,15
splot '/tmp/maxout_15238_2.data' index 0 notitle w vect head size 2, 45 filled lw 1 lt 1 lc rgb '#0000ff'
unset output

File output, maxout_15238_2.data:

0.0 0.0 0.0 1.0 1.0 1.0

Note that the data is separated by spaces. My .gnuplot config
file does not contain an option to set the datafile separator.
However, if I add following line the problem disappears:

set datafile separator whitespace

Possibly, wxmaxima or maxima or gnuplot is setting the datafile
separator to a value that is not compatible with the wxmaxima output.

But this does not explain why if I preceed the vector object with another
object it will plot normally.

@daute
Copy link
Member

daute commented Oct 3, 2024

Really strange. The 5th line of maxout_15238_1.gnuplot IS: set datafile separator whitespace. And even if the would be not there - whitespace should be the default: http://gnuplot.info/docs_6.0/loc11191.html
"By default data fields are separated by whitespace."

@daute
Copy link
Member

daute commented Oct 5, 2024

Hm. Do you use the same Maxima & Gnuplot in both cases? Maybe a self compiled version in one case and the Maxima (and/or Gnuplot) included in the distribution in the second case? Last idea: There is a file wxmaxima-init.mac (in ~/.maxima on Linux/Unix), which provides commands, which are only executed, if wxMaxima starts Maxima. Does that file exist and contain something 'special'?

And finally: Does the current release (or current Git development version) work?

@LP314159
Copy link
Author

LP314159 commented Oct 5, 2024

It appears to be a gnuplot issue.

I noticed that if I remove my ~/.gnuplot config file, the following wxmaxima commands execute without error:

load(draw)$
wxdraw3d(vector([0,0,0],[1,1,1]))$
[Normal plot]

Then I went through the ~/.gnuplot file line by line until I found the problem:

set hidden3d

If I remove this line from ~/.gnuplot then there is no error with wxmaxima.

The same result happens if I execute the wxmaxima output files directly within gnuplot.

Maybe this issue should be reported to gnuplot?

@daute
Copy link
Member

daute commented Oct 6, 2024

Thanks for the feedback. So that is not a wxMaxima issue, I am closing this bug report.

@daute daute closed this as completed Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants