graph(title) color

41 views
Skip to first unread message

Todd Vanyo

unread,
Jan 24, 2023, 3:58:51 PM1/24/23
to VPython-users
Is it possible to modify the color of the background and foreground in the title of a graph?

Using a dark them in JupyterLab, which is what all the cool kids seem to be using these days, results in some serious visibility issues.Screen Shot 2023-01-24 at 14.51.42.png

Since it looks like vpython is using webgl, is there a way to pass html along to do either of the following:
  • Make the title background block transparent and the text color something visible against that background?
  • Make the background transparency of the plots themselves go away? For example, if the plot background was white, I'd be able to live with the title being on a white background.
    • Since the background of the X/Y labels are transparent I have to play games with the foreground color.
Simplest solution: Don't use a dark theme
Harder solution: Change the theme to give me a white background in the outputs

I'm looking for something in the middle of those two potential solutions.

Bruce Sherwood

unread,
Jan 25, 2023, 12:07:30 AM1/25/23
to VPython-users
Currently there isn't a way in VPython to change the background and foreground colors around the graph region.

Bruce

Todd Vanyo

unread,
Jan 26, 2023, 3:41:36 PM1/26/23
to VPython-users
Thanks, Bruce.

It would help if there was consistency between the opacity settings on titles/captions and the rest of the area the plot is in. As you see on my original post, the opacity of the plot is 0 (the black background is seen on the axes), but the opacity of the title is 1 (the background is white).

Todd

Bruce Sherwood

unread,
Jan 26, 2023, 10:08:40 PM1/26/23
to VPython-users
I'm not entirely sure what you are trying to achieve, but since you are the first of over 200,000 users of VPython to have expressed a desire to alter the current behavior we ourselves really can't afford to make the changes that you need. However, VPython is open source, so you could make the changes yourself. Here are the two GitHub repositories:

Web VPython:
     https://github.com/vpython/glowscript

The vpython module for use with installed Python:
     https://github.com/vpython/vpython-jupyter

Bruce
Reply all
Reply to author
Forward
0 new messages