I wanted to set the background color of a plot to black (without axes shown) and figured I could add this to the PLOT structure: POLYGONS([[10,0],[0,0],[0,10],[10,10]],COLOUR(RGB, 0., 0., 0.))

And that worked fine. But I feel that it ought to be easier.

I'd first satisfied my self that plotting a constant horizontal line segment, with filled=true and color=black, was inefficient because by default it sampled at many points and constructed many polygons and that resulted in a larger object than necessary.

Then I noticed that someone had asked how to do it in 2008. The discussion got sidetracked on how to set one's default, for all plots, in initializtion or preferences files. And someone must have mentioned `implicitplot` at some point, because Robert Israel added a new answer a year ago, suggesting plottools:-rectangle instead. Amusingly, that `rectangle` call results in something equivalent to the POLYGONS object above.

Great. So there's a way which creates a small object. (...keep it simple and short, and let the GUI render it.)

But there should be a simpler way! It shouldn't be necessary to have to specify the dimensions of a rectangle whose only purpose is to cover exactly the whole plotted region, or to have to change the axis color and text color manually as well.

How about a new option accepted by `plot` or plots:-display, `background`=[color=...] where in the absence of an accompanying `foreground`=[color=...] or `axis`=[color=...] it would automatically use axes whose color was in highest  color contrast to the background? No messing with ranges needed. No messing with colors for axes,labels, and text. No fuss to make sure that the backgound was behind all other layers.

Please, nobody suggest setting this in an initializtion file, or even as a GUI setting. This should be an aspect of each plot object itself.


Please Wait...