Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Use light background in plots? #56

Open
cpascual opened this issue Aug 5, 2020 · 5 comments
Open

Use light background in plots? #56

cpascual opened this issue Aug 5, 2020 · 5 comments
Labels
question Further information is requested

Comments

@cpascual
Copy link
Member

cpascual commented Aug 5, 2020

Intro

Pyqtgraph's choice of a dark background for plots has generated mixed reactions among taurus users.

Changing it to a light background has been a common request, but the decision has always been postponed because of lack of time and its not-so-obvious implications.

But it may be good to do some discussion about it now in order to take decision.

Note: pyqtgraph plot widgets allow calling .setBackgroundBrush() individually, but pyqtgraph as a whole provides a global switch mechanism.

Arguments for each option

Apart of purely aesthetic preferences (there is people who prefers dark themes and others who prefer light ones), here are some arguments for each option:

Arguments in favor of changing background to a light color:

  • It makes the curves easier to see (but whether this is intrinsic or it can be managed with a change in the colors for the curves palette, is not clear to me)
  • It is more similar to the qwt5-based plots that we are replacing (less change stress on the users, smoother transition)
  • It matches better the default desktop theme in KDE (which is light)

Arguments in favor of keeping the original dark background :

  • It is less work: changing the colors is easy, but providing configurability that covers all use cases may be difficult (see next section)
  • Concerns that "going against upstream" will result in more maintenance work and possibly require more tweaks by end users (e.g. it is possible that some design decisions assume that colors are the default dark ones, and we or the final user will need to do extra work to fix issues that would not be apparent if we used the default)
  • It maintains visual consistency with pure-pyqtgraph widgets. Note that a design goal of taurus_pyqtgraph is to encourage the use of pure pyqtgraph widgets and APIs and minimize the amount of taurus-specific knowledge needed to use it. Nevertheless, if we use the global switch mechanism for changing the colors at pyqtgraph level, all pyqtgraph-based widgets in the same application would be affected

Configurability

Whichever the decision, should we provide a simple "switch" mechanism?

And if so, which scope should this mechanism act onto (a global configuration, at the widget / tool level, ...)?

And should the mechanism be used implicitly (e.g. set the colors when importing taurus_pyqtgraph) or explicitly (e.g. a function that you need to call in all your guis).

Note that an implicit and global change may seem convenient but will probably upset GUIs which mix pure pyqtgraph widgets with taurus_pyqtgraph ones.

@cpascual
Copy link
Member Author

cpascual commented Aug 6, 2020

Here is a comparison of different options:

  • upper left: black background (current for tpg plot, which uses the default in pyqtgraph)
  • upper right: old qwt5 plot (for reference)
  • bottom left: white background
  • bottom right: light gray background (mimics qwt5)

image

@cpascual
Copy link
Member Author

cpascual commented Aug 6, 2020

In the above screenshot, it is evident that the current choice of the curve colors is more appropriate for a light background than a dark one. Here is another screenshot where I manually changed curve colors for better contrast (changing the default palette of curve colors is something we definitely should do if we keep the dark background).

image

@cpascual
Copy link
Member Author

cpascual commented Sep 3, 2020

Note that since v0.4.0, the background color for each plot can be set via plot config dialog and it is (re)stored via config properties.

@reszelaz
Copy link

reszelaz commented Sep 3, 2020

Great news! IMO it is the best possible option to let the user to choose. Many thanks!
Have you left the configuration per trend/plot or also a global one?

@cpascual
Copy link
Member Author

cpascual commented Sep 3, 2020

Have you left the configuration per trend/plot or also a global one?

No, this is a related, but independent setting at widget level. IMHO, using a global switch (and adapting the curve color palette accordingly) is still something we should consider

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants