|
From: <mw...@us...> - 2006-12-16 21:31:41
|
I'm using the CVS head. I noticed a very weird problem when using 'set view map' in conjunction with 'splot' (aka. splot map). The symptom was noticed when I created some PNG files using TTF fonts. The x & y tics and labels looked fuzzy. I initially thought the problem was is gd.trm. However, I realized that the tics and labels were actually being drawn twice. Then I realized that the grid was not being drawn in the back as specified. This was all very confusing. I have done some digging through the code and found a couple of issues. First, gd.trm has two differing variables for storing character size information: term->[vh]_char and png_state.char[wh]. These are often set to each other. However, when finding approximate TTF font info the png_state.char[wh] variables were not being set. A quick fix is to always set png_state.char[wh] when the TTF font info is determined. So when the title font is different or invalid, the character size data is wrong when the axis text is drawn. This will removed the fuzziness from the PNG plot. I'm thinking that gd.trm should only have one variable that holds the character size info and that should probably be term->[vh]_char. It does nothing to address why the tics and labels are being drawn twice. So, I began comparing the 2D plotting stuff to the 3D stuff. I found that the drawing order for 2D and 3D were different. It appears that the layer settings are not working properly in the 3D code. I discovered that draw_3d_graphbox is called repeatedly and that is why the tics and axis labels are drawn twice. The x & y tics and labels are drawn every time draw_3d_graphbox is called. I suggest that draw_3d_graphbox be broken up into three routines: place_grid3d, plot_border3d, and place_axis_labels3d. This would allow finer control over drawing each part on the proper layer. I'm willing to tackle the break up of the routine if its agreed upon. The other thing I noticed is that the pre-processor token USE_GRID_LAYERS is set in graph3d.c and is not used as a configuration option anywhere. Can it be eliminated? Below is the a script that illustrates the problem using some exaggerated settings. You will notice that the grid is supposed to be in the back and the border in the front. However, the result has the grid in front over the border and the data points in the 3D splot map but not the 2D plot. Another odd thing is that the colorbox shows up on the 2D plot when its not needed. Mike Sutton set term x11 persist set style line 98 lt 1 lw 1 lc rgb 'magenta' set style line 99 lt -1 lw 3 lc rgb 'cyan' set grid back ls 98 unset key set xr [-60:60] set yr [-60:60] set xlabel "MY Xlabel" set ylabel "MY Ylabel" set cblabel "MY CB" set border front ls 99 set pm3d set view map png = 0 if (png > 0) set term png giant truecolor butt nocrop size 1280,1024;\ set term png font "luxirr,8"; \ set out 'splot-gd.png' set title "3D SPLOT MAP" font "luxirr,40" #set title font "luxirrdd,40" if (png >0) set term png font "luxirr,16" splot "mike2.dat" w p pt 5 ps 4 lc pal if (png < 1) set term x11 2 if (png >0) set out 'plot-gd.png' set title "2D PLOT" plot 'mike2.dat' w p pt 5 ps 4 -- data 0 0 44 0 10 -2 -30. 20 8 50 30 -5 -33 -44 10 |