Ticket #10639 (closed: fixed)

Opened 6 years ago

Last modified 5 years ago

Plotting: Optionally plot counts/width

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: critical Milestone: Release 3.3
Component: GUI Keywords: SSC,2014,All
Cc: Blocked By:
Blocking: #10668, #10669 Tester: Nick Draper

Description

Add an option to plot the counts/bin width for 1D plots in MantidPlot. This will help mostly in situations where the binning is not regular.

Change History

comment:1 Changed 6 years ago by Martyn Gigg

  • Status changed from new to assigned

comment:2 Changed 6 years ago by Martyn Gigg

  • Keywords SSC added

comment:3 Changed 6 years ago by Martyn Gigg

  • Status changed from assigned to inprogress

comment:4 Changed 6 years ago by Martyn Gigg

Fix bug in copying QwtWorkspaceSpectrumData

It now sets the distribution flag correctly. Refs #10639

Changeset: 50d8c830fdabcd7c5bf5aed8ab0d6a611f1b67b2

comment:5 Changed 6 years ago by Martyn Gigg

Require the distribution flag rather than it being optional

Refs #10639

Changeset: 76f841b83e471c0f5657562fa8f2bb36ead16c4c

comment:6 Changed 6 years ago by Martyn Gigg

Use an enumeration for distribution settings.

Currently reproduces what it did before. Refs #10639

Changeset: 936ea4f3d2749f250ebccfcc50e07cec88e697a3

comment:7 Changed 6 years ago by Martyn Gigg

Remove dead menu actions that were never attached to anything.

Refs #10639

Changeset: 6b915a3474f1e6d889cfbc18069f4dbdbdae5635

comment:8 Changed 6 years ago by Martyn Gigg

Add a configuration option for global distribution plotting

Refs #10639

Changeset: 27a167f691d905638b485efed00cfc6d60d93975

comment:9 Changed 6 years ago by Martyn Gigg

Use global configuration option for distribution plotting.

Refs #10639

Changeset: 5fa1580dab6eeeeca088b9a22a841e1ce5363cfe

comment:10 Changed 6 years ago by Martyn Gigg

Add normalization options to graph context menu.

Refs #10639

Changeset: ea5a9a16bb202859a77f86372fb0f002ac364c95

comment:11 Changed 6 years ago by Martyn Gigg

Add context menu options to set the distribution status.

Refs #10639

Changeset: 5734e7ed7b85874dd608768ef8f6c306356a7fa6

comment:12 Changed 6 years ago by Martyn Gigg

Only use distribution flag for histogram data.

Refs #10639

Changeset: 73956a68f2feb1f5f07104cb1322330b706ea333

comment:13 Changed 6 years ago by Martyn Gigg

Don't show Normalization context menu option if not applicable

Refs #10639

Changeset: 4de500e2638c52ddd3865570e97b1260001035a0

comment:14 Changed 6 years ago by Martyn Gigg

Reword option in ConfigDialog

Refs #10639

Changeset: 13aa83faf3479f644469faa84bc12e6a380c39b7

comment:15 Changed 6 years ago by Martyn Gigg

Fix for older Qwt versions that have a method as protected.

We simply defines a pass through method. Refs #10639

Changeset: 867e843137a664dab36364db13612454d1a61e69

comment:16 Changed 6 years ago by Martyn Gigg

Use correct axis labels for normalized data.

Refs #10639

Changeset: 6f5555d41baa332f7c7bebf9d326640f459e22d8

comment:17 Changed 6 years ago by Martyn Gigg

Update the axis title when plotting distribution

Refs #10639

Changeset: 744ba2e72f70838585a8799121d8148db1d9f6ed

comment:18 Changed 6 years ago by Martyn Gigg

Fix for case where data is already divided by the bin width

In this case the data is plotted as it is. Refs #10639

Changeset: 3e5f4a8ab915902559830ebabe38e1a5bcaaec47

comment:19 Changed 6 years ago by Martyn Gigg

I found this script useful for creating test workspaces

uniform_bins = CreateSampleWorkspace()
non_uniform_bins = Rebin(uniform_bins, Params="0,300,10000,500,20000")
point_data = ConvertToPointData(uniform_bins)
non_uniform_bins_distrib = non_uniform_bins.clone()
ConvertToDistribution(non_uniform_bins_distrib)

comment:20 Changed 6 years ago by Martyn Gigg

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

Branch: feature/10639_plot_distribution_option

Tester: This concerns how data from a spectrum plot is displayed by default. After these changes the default for a histogram plot will be to display the values normalized by the bin width. This will not change the original data, just affect how it is displayed.

I used the script in comment 19 to create a variety of workspaces with different characteristics:

  • A histogram with uniform binning;
  • A histogram with non uniform binning;
  • A point data set and
  • A histogram that is already a distribution.

Try plotting these and see that in the first 2 cases the default is now the plot counts/microsecond but for the last 2 the plot detects that either no normalizations is appropriate or it has already been applied.

For those that have been normalized automatically you can right-click on the plot and choose to change to normalization with a new option. Verify that this works as expected.

There is also a global option in View->Preferences->2D Plots that controls how histograms are plotted by default. Check that this works and is saved/reloaded between MantidPlot sessions.

comment:21 Changed 6 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:22 Changed 6 years ago by Nick Draper

  • Status changed from verifying to reopened
  • Resolution fixed deleted
  • Blocking 10668, 10669 added

Reopened due to a few issues: only the first should be dealt with in this ticket, the others have new tickets.

  1. If you plot errors, whether by plotspectrum with errors, or the graph->add error bars -> from workspace, they are not scaled by the bin width and therefore overpower the data.
  2. The interaction with fitting is confusing as you setup the plot against normalized data, but it fits against the underlying non normalized data. - Follow on ticket to deal with this #10668.
  3. We need to make sure the default is set "correctly" for this release - Follow on ticket to determine this and implement #10669.

comment:23 Changed 6 years ago by Martyn Gigg

  • Status changed from reopened to inprogress

comment:24 Changed 6 years ago by Nick Draper

  • Priority changed from major to critical

Move all SSC tickets to critical by default

comment:25 Changed 6 years ago by Martyn Gigg

Fix error plotting when normalizing by the bin width.

Refs #10639

Changeset: 28327fcce00e09cc892bbeb1e663f4b237afeeb9

comment:26 Changed 6 years ago by Martyn Gigg

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

Point 1 should be fixed now.

comment:27 Changed 6 years ago by Nick Draper

  • Status changed from verify to verifying

comment:28 Changed 6 years ago by Nick Draper

  • Status changed from verifying to closed

Merge remote-tracking branch 'origin/feature/10639_plot_distribution_option'

Full changeset: fde065c21c453efadb9abe9713c5c8001097a268

comment:29 Changed 6 years ago by Nick Draper

#10639 Passed, Ticket #10668 will need to be fixed to go in with this for this release.

comment:30 Changed 6 years ago by Nick Draper

  • Keywords SSC,2014,All added; SSC removed

comment:31 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 11481

Note: See TracTickets for help on using tickets.