|
From: Daniel J S. <dan...@ie...> - 2003-12-15 05:25:03
|
I don't have time to modify and test a quick fix for the colorbox.
However, looking at the code I can give a suggestion of what to try.
In the 2D plot and 3D plot seems to be common _global_ variables
xright, xleft, ybot, ytop. When the 2D plot borders are drawn, the
vectors are based directly on these variables. My guess is that for 3D
plots these same variables (which currently seem to be modified
accordingly) serve a similar purpose of being the general view extent of
the 3D axes. So, in the draw_smooth_color_box() routine, try basing the
computation of the color box extent on xright, xleft, ybot, ytop rather
than using the plot axes values and projecting via map3d_xy(). To me,
that projection seems like extra, unneeded effort if the plot extent
information is already given in xright, etc.
After you (whoever wants to try this) do that, if you want to try
touching things up find the last location in graph3d.c where xright,
etc. are set equal to some value then make an adjustment based upon the
position of the color box. For example, in the image patch is the
adjustment
#ifdef WITH_IMAGE
#ifdef PM3D
#define COLORBOX_SCALE 0.125
#define WIDEST_COLORBOX_TICTEXT 3
/* Make room for the color box if it will be seen for the IMAGE plot
style. */
if ((plots->lp_properties.use_palette) && (color_box.where !=
SMCOLOR_BOX_NO) && (color_box.where != SMCOLOR_BOX_USER)) {
xright -= (int) (xright-xleft)*COLORBOX_SCALE;
xright -= (int) ((t->h_char) * WIDEST_COLORBOX_TICTEXT);
}
#endif
#endif
You'll notice this is only a temporary addition to the image patch
because I was hoping in the future it could be made nicer and common
between 2D and 3D plots. The above is only for right, vertical
placement. (Bottom would modify ybot, left would modify xleft, top
would modify ytop.) In the future it would be nice to support right
vertical, left vertical, bottom horizontal, top horizontal. Also, in
the future it would be nice to easily control the colorbox by specifying
the width (i.e., the COLORBOX_SCALE in the code above) as a percentage
of the overall plot. In the above example the color box area is 12.5%
of the overall plot width for a vertical colorbox.
Dan
Petr Mikulik wrote:
>>>OK, so you are saying the rotating colorbox in 3D is embarrassing enough
>>>to warrant a quick fix. :-)
>>>
>>>
>
>
>
>>Not quite --- it's Petr who wants this quick fix.
>>
>>
>
>Exactly, I want just a simple, easy and trivial fix to replace "my"
>numbers of auto positioning the 3D colorbox by "somebody else"'s
>numbers/funciton so that when rotating splot by mouse it does not circulate
>around. Otherwise, this will be immediatly a FAQ (tested on other people).
>
>It don't want to touch any other code else -- yes, we had a discussion about
>colorbox positioning with Daniel, but that's not relevant to this issue.
>
>Unfortunately, I don't have time to understand these transformations and
>implement my requested feature. Hans-Bernhard, could you please try this?
>Otherwise, it will be let as is.
>
>---
>Petr Mikulik
>
>
>
>-------------------------------------------------------
>This SF.net email is sponsored by: SF.net Giveback Program.
>Does SourceForge.net help you be more productive? Does it
>help you create better code? SHARE THE LOVE, and help us help
>YOU! Click Here: http://sourceforge.net/donate/
>_______________________________________________
>gnuplot-beta mailing list
>gnu...@li...
>https://lists.sourceforge.net/lists/listinfo/gnuplot-beta
>
>
>
>
--
Dan Sebald
email: daniel . sebald @ ie ee . o rg
URL: ht tp://acer-access.c om/~dsebald @ acer-access.c om/
|