Ticket #2606 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Plotting negative values incorrectly when Log scale set in preferences

Reported by: Nick Draper Owned by: Steve Williams
Priority: major Milestone: Iteration 28
Component: MantidPlot Keywords:
Cc: ann.terry@… Blocked By:
Blocking: Tester: Anders Markvardsen

Description

From Nick:

It only occurs when you set your preferences of the a scale to log in the preferences window and then do a plot with a negative number on that scale. In this case the negative number is translated to a very high number in the plot.

If you leave the preferences for Y axis as linear, and then manually change them to Log by right clicking the plot and selecting axes->log, log Then this works fine and the negative values are ignored rather than be plotted arbitrarily high.

I understand this is not ideal at the moment and we will change it such that negative values are ignored throughout

From Ann Terry and Stephen King:

It occurs when Mantid plots the 2D data on a graph where the default axes set in Preferences are log-log. If they are set to lin-lin the plot is fine.

Screen shot and output workspace in babylon5/loq.

Change History

comment:1 Changed 10 years ago by Nick Draper

From Richard Heenan:

Note that having got the 1e20 numbers on a log axis, they stay there on changing the axes back to linear and do not revert to their proper (negative) values.

comment:2 Changed 10 years ago by Steve Williams

  • Status changed from new to accepted

The following workspace is a test case, plotting it when your view->preferences->2D Plots->Axes->DefaultY is set to log gives you the spurious 1020.

CreateWorkspace(OutputWorkspace="first_postive",DataX="1,2,3,5,6,7,8",DataY="1,-1,3,5,4,5",DataE="1,1,3,5,4,5",UnitX="TOF",VerticalAxisUnit="TOF",VerticalAxisValues="2")

comment:3 Changed 10 years ago by Steve Williams

(In [10128]) When plotting the MantidQwtData object needs to know the axis scale type on creation re #2606

comment:4 Changed 10 years ago by Steve Williams

(In [10129]) When plotting the MantidQwtData object needs to know the axis scale type on creation re #2606

comment:5 Changed 10 years ago by Roman Tolchenov

(In [10158]) Fixed a bug with log plotting of MantidCurves. re #2606

comment:6 Changed 9 years ago by Steve Williams

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

comment:7 Changed 9 years ago by Anders Markvardsen

  • Status changed from verify to verifying
  • Tester set to Anders Markvardsen

comment:8 Changed 9 years ago by Anders Markvardsen

  • Status changed from verifying to closed

Now when using the script

CreateWorkspace(OutputWorkspace="first_postive",DataX="1,2,3,5,6,7,8",DataY="1,-1,3,5,4,5",DataE="1,1,3,5,4,5",UnitX="TOF",VerticalAxisUnit="TOF",VerticalAxisValues="2")

and log set in preference negative data points not plotted.

(By the way trac does not seem react properly this morning...., this is the 3rd time I try and pass ticket...)

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3453

Note: See TracTickets for help on using tickets.