Ticket #6980 (closed: fixed)

Opened 7 years ago

Last modified 5 years ago

Plot curve colours should carry on from the last selected colour

Reported by: Nick Draper Owned by: Russell Taylor
Priority: major Milestone: Release 3.0
Component: GUI Keywords:
Cc: Blocked By:
Blocking: Tester: Arturs Bekasovs

Description (last modified by Martyn Gigg) (diff)

From Richard Heenan:

If change the colour of the last workspace on a plot, then the next workspace added does get the next colour in the table as expected, but add any more added all get the same colour as the one before. Also, thank you for moving the invisible yellow colour further down the list.

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Component changed from Mantid to Framework

comment:2 Changed 7 years ago by Nick Draper

  • Milestone changed from Release 2.6 to Backlog

Moved to backlog at the code freeze for R2.6

comment:3 Changed 7 years ago by Martyn Gigg

  • Keywords Poker added
  • Description modified (diff)

comment:4 Changed 7 years ago by Martyn Gigg

  • Milestone changed from Backlog to Release 3.0

comment:5 Changed 7 years ago by Russell Taylor

This feels like it is related to #4132 (or that a solution could incorporate that).

comment:6 Changed 7 years ago by Martyn Gigg

Agreed. Would you like me to take #4132 off your hands or given it's visible thing would you prefer to incorporate this one into the update from #4132?

comment:7 Changed 7 years ago by Nick Draper

  • Keywords Poker removed

Poker Estimate: 4d

comment:8 Changed 7 years ago by Russell Taylor

  • Owner changed from Martyn Gigg to Russell Taylor

We've agreed that I'll take this and fix it as part of #4132.

comment:9 Changed 7 years ago by Nick Draper

  • Component changed from Framework to User Interface

comment:10 Changed 7 years ago by Russell Taylor

I ran out of time for #4132 in this release, but I should be able to fix this one I think.

comment:11 Changed 7 years ago by Russell Taylor

  • Status changed from new to inprogress

Re #6980. Fix calculation of color index.

The problem was that the ColorBox had been added, which extended the number of colours to 24, but the method contained this hard-coded so the calculation wrapped around too soon. Also if you hit white you then got 'stuck' at black - now it skips on to the next colour. I've changed to calling methods on ColorBox instead of magic numbers, and also streamlined the code in other places.

Changeset: e8a67c6b8f931441c5288a453b6b5bf3096ffa97

comment:12 Changed 7 years ago by Russell Taylor

  • Status changed from inprogress to verify
  • Resolution set to fixed

The described problem should be sorted out now, so have a go at plotting a spectrum, adding more (you can drag the workspace onto the graph) and changing colours around.

There is one case in which you will still get 'stuck' on black. This is if you have a curve with the last colour in the list (dark yellow); subsequently added curves will all be black. I don't think it's worth implementing a more complex solution for this likely rare case.

comment:13 Changed 7 years ago by Arturs Bekasovs

  • Status changed from verify to verifying
  • Tester set to Arturs Bekasovs

comment:14 Changed 7 years ago by Arturs Bekasovs

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/bugfix/6980_curve_colour_choosing'

Full changeset: a58b3ce80276601b33842c0d6b4f31f3c099f6d8

comment:15 Changed 7 years ago by Arturs Bekasovs

All works as expected. White color is skipped correctly, all the consequent curves get the color which is "lower" in the list of colors than the "lowest" one, no matter which part of the color list they are in.

Was able to reproduce the problem with color being black when we run out of colors for new curves, but I don't see any obvious solutions as well and I agree that it's quite a rare case.

comment:16 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 7826

Note: See TracTickets for help on using tickets.