Uploaded image for project: 'DRP 2-D Pipeline'
  1. DRP 2-D Pipeline
  2. PIPE2D-1450

Make colours used in FiberProfile.plotInAxes available to user code

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      The routine FIberProfile.plotInAxes is useful, but it doesn't broadcast its choice of colours (it also doesn't have enough – we currently use c. 15 slices, but that colormap is only 10 wide.  Probably it'd be better to convert one of the standard cmps to a sampled one;  matplotlib can do that, and I have code somewhere).

      With this set of colours available, one can add a colorbar to the plots, telling you which profile is which.  Something like

      colors = ["r", "g", "b", "c", "m", "y", "k", "tab:orange", "tab:purple", "tab:brown"]  # from FiberProfile.plotInAxes
      
      prof = profiles[profiles.fiberId[0]]
      cmap = plt.matplotlib.colors.ListedColormap(colors, name='profileColors', N=len(prof.profiles))
      fig.colorbar(plt.matplotlib.cm.ScalarMappable(
                               norm= plt.matplotlib.colors.Normalize(prof.rows[0],  prof.rows[-1]), 
                               cmap=camp
                           ),
                           ax=axs.ravel().tolist(), orientation='vertical', label="row")
       

      It'd be nice to have that in the QA plots.

        Attachments

          Activity

            People

            • Assignee:
              wtgee Wilfred Gee
              Reporter:
              rhl rhl
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: