Ticket #7142 (closed: fixed)
most MantidPlot commands related to plotting/annotating curves does not work
Reported by: | Alex Buts | Owned by: | Martyn Gigg |
---|---|---|---|
Priority: | major | Milestone: | Release 3.2 |
Component: | Framework | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Tester: | Jay Rainey |
Description (last modified by Nick Draper) (diff)
the page http://www.mantidproject.org/MantidPlot:_1D_Plots_in_Python#The_plot_legend
describes the way to plot/annotate curves. Most examples provided on this page do not work.
there is the script illustrating this:
t = table("TableTest") if t==None: t=newTable("TableTest",10,3) for i in xrange(1,10): t.setCell(1,i,i) t.setCell(2,i,i*i) t.setCell(3,i,i*i*i) gr = graph("MyTest"); if gr == None : gr = newGraph("MyTest",2,1,2) l=gr.layer(1) l.setTitle("Flux/Frequency") l.setAxisTitle(Layer.Bottom, "Frequency [Hz]") l.setAxisTitle(Layer.Left, "Flux [n/s/cm^2]") l.setAntialiasing() #l.insertCurve(table("Table1"), "Table1_1", Layer.LineSymbols) l.addCurves(t, (1,3), Layer.Line, 1, 4) # returns True on success # self.graphFlux.insertCurve(self.t, "Flux/Frequency_2", Layer.Scatter) legend = l.newLegend(str(4)) #txt=legend.addText(str(4)) legend.setOrigin(5,15)
-- last command -- setOrigin is not available. Neither are the most commands provided on the page above.
Either description or code should change.
Change History
comment:1 Changed 7 years ago by Nick Draper
- Status changed from new to assigned
- Owner set to Anyone
comment:4 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:5 Changed 7 years ago by Nick Draper
- Owner changed from Anyone to Martyn Gigg
- Description modified (diff)
- Milestone changed from Backlog to Release 3.2
comment:6 Changed 7 years ago by Nick Draper
- Status changed from new to assigned
Bulk move of tickets out of triage (new) to assigned at the introduction of the triage state
comment:7 Changed 7 years ago by Martyn Gigg
- Status changed from assigned to inprogress
Fix inheritance hierarchy of LegendWidget in qti.sip declaration
It was wrongly stated that it inherits from QObject so that the Python type was showing up as QWidget & not the leaf class LegendWidget Refs #7142
Changeset: 122c093f8c317caf19872c070827b6fed3ac6be9
comment:8 Changed 7 years ago by Martyn Gigg
- Status changed from inprogress to verify
- Resolution set to fixed
Branch: bugfix/7142_qtiplot_python_cmds
Tester: As far as I can tell the script attached to the description should now work. I have edited the documentation page in the description to remove some commands like addText that are no longer in our code base or the HEAD of the current QtiPlot sources.
comment:9 Changed 7 years ago by Jay Rainey
- Status changed from verify to verifying
- Tester set to Jay Rainey
comment:10 Changed 7 years ago by Jay Rainey
- Status changed from verifying to closed
I ran through the 1D plot options in Mantid 3.1 to verify which options did not work. I then build the branch locally and tested from it. All options now work as expected.
comment:11 Changed 7 years ago by Jay Rainey
Merge remote-tracking branch 'origin/bugfix/7142_qtiplot_python_cmds'
Full changeset: ddd54dffcb6231b0fea0ff93fd8291597d4d189f
comment:12 Changed 5 years ago by Stuart Campbell
This ticket has been transferred to github issue 7988
Obviously we should favour making it work before giving up and removing the documentation.
I would suggest talking to Martyn Gigg or Russell taylor as to how to start off.