Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
edddb8a8
Commit
edddb8a8
authored
7 years ago
by
Karl Palmen
Browse files
Options
Downloads
Patches
Plain Diff
Add documentation for plot re #20005
Signed-off-by:
Karl Palmen
<
karl.palmen@stfc.ac.uk
>
parent
78be41f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/source/concepts/FitFunctionsInPython.rst
+17
-1
17 additions, 1 deletion
docs/source/concepts/FitFunctionsInPython.rst
with
17 additions
and
1 deletion
docs/source/concepts/FitFunctionsInPython.rst
+
17
−
1
View file @
edddb8a8
...
...
@@ -202,6 +202,22 @@ Also one can put parameters into the function when evaluating.
p = Polynomial(n=2)
print p([0,1,2,3], 0.0, 0.5, 0.5) #expect [ 0. 1. 3. 6.]
This enables one to fit the functions with ``scipy.optimize.curve_fit``.
This enables one to fit the functions with ``scipy.optimize.curve_fit``.
Plotting
--------
Functions may be plotted by calling the plot method of the function.
This method can be called in any of the following manners:
.. code:: python
f.plot(xValues=[0,2,2.5,3,5]) # for these x-values
f.plot(workpace=ws) # for the x-values of workspace ws
f.plot(workspace=ws, workspaceIndex=i) # for x-values of workspace index i of ws
f.plot(startX=xmin, endX=xmax) # for 20 x-values between xmin and xmax
f.plot(startX=xmin, endX=xmax, nSteps=10) # for 10 x-values between xmin and xmax
f.plot(workspace=ws, startX=xmin, endX=xmax) # for x-values of ws between xmin & xmax
Owing to the way workspaces are named in python, only one plot can be shown at a time.
.. categories:: Concepts
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment