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
bcdc6bb9
Commit
bcdc6bb9
authored
10 years ago
by
Owen Arnold
Committed by
Federico Montesino Pouzols
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
refs #8912. Start work looking at pyplot.plot.
parent
c008136d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Code/Mantid/MantidPlot/mantidplotpy/matplotlib/__init__.py
+0
-0
0 additions, 0 deletions
Code/Mantid/MantidPlot/mantidplotpy/matplotlib/__init__.py
Code/Mantid/MantidPlot/mantidplotpy/matplotlib/pyplot.py
+40
-0
40 additions, 0 deletions
Code/Mantid/MantidPlot/mantidplotpy/matplotlib/pyplot.py
with
40 additions
and
0 deletions
Code/Mantid/MantidPlot/mantidplotpy/matplotlib/__init__.py
0 → 100644
+
0
−
0
View file @
bcdc6bb9
This diff is collapsed.
Click to expand it.
Code/Mantid/MantidPlot/mantidplotpy/matplotlib/pyplot.py
0 → 100644
+
40
−
0
View file @
bcdc6bb9
import
numpy
as
np
from
mantid.api
import
MatrixWorkspace
as
MatrixWorkspace
def
__is_array
(
arg
):
return
isinstance
(
arg
,
list
)
or
isinstance
(
arg
,
np
.
ndarray
)
def
__is_workspace
(
arg
):
return
isinstance
(
arg
,
MatrixWorkspace
)
def
__is_array_of_workspaces
(
arg
):
return
__is_array
(
arg
)
and
len
(
arg
)
>
0
and
__is_workspace
(
arg
[
0
])
def
__plot_as_workspace
(
arg
):
print
"
TODO plot_as_workspace
"
pass
def
__plot_as_workspaces
(
arg
):
print
"
TODO plot as workspaces
"
pass
def
__plot_as_array
(
arg
):
print
"
TODO plot as array
"
pass
def
plot
(
y
,
x
=
None
,
marker
=
None
):
print
type
(
y
)
if
__is_array
(
y
):
if
__is_array_of_workspaces
(
y
):
__plot_as_workspaces
(
y
)
elif
__is_workspace
(
y
):
__plot_as_workspace
(
y
)
else
:
__plot_as_array
(
y
)
else
:
raise
ValueError
(
"
Cannot plot argument of type
"
+
str
(
type
(
y
))
)
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