Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Plot Serializer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RDM Tools
Plot Serializer
Commits
22f42e76
Commit
22f42e76
authored
10 months ago
by
Julius
Browse files
Options
Downloads
Patches
Plain Diff
removed intermediate step for scales, added scales
parent
c3045c5a
No related branches found
No related tags found
1 merge request
!32
Expand type support
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
plot_serializer/matplotlib/serializer.py
+7
-11
7 additions, 11 deletions
plot_serializer/matplotlib/serializer.py
with
7 additions
and
11 deletions
plot_serializer/matplotlib/serializer.py
+
7
−
11
View file @
22f42e76
...
@@ -102,10 +102,6 @@ PLOTTING_METHODS = [
...
@@ -102,10 +102,6 @@ PLOTTING_METHODS = [
]
]
def
_convert_matplotlib_scale
(
scale
:
str
)
->
Scale
:
return
"
scale
"
def
is_array_like
(
x
):
def
is_array_like
(
x
):
try
:
try
:
np
.
array
(
x
)
np
.
array
(
x
)
...
@@ -639,7 +635,7 @@ class _AxesProxy(Proxy[MplAxes]):
...
@@ -639,7 +635,7 @@ class _AxesProxy(Proxy[MplAxes]):
else
:
else
:
self
.
_plot
.
spines_removed
.
append
(
spine
)
self
.
_plot
.
spines_removed
.
append
(
spine
)
xlabel
=
self
.
delegate
.
get_xlabel
()
xlabel
=
self
.
delegate
.
get_xlabel
()
xscale
=
_convert_matplotlib_scale
(
self
.
delegate
.
get_xscale
()
)
xscale
=
self
.
delegate
.
get_xscale
()
self
.
_plot
.
x_axis
.
label
=
xlabel
self
.
_plot
.
x_axis
.
label
=
xlabel
self
.
_plot
.
x_axis
.
scale
=
xscale
self
.
_plot
.
x_axis
.
scale
=
xscale
...
@@ -647,7 +643,7 @@ class _AxesProxy(Proxy[MplAxes]):
...
@@ -647,7 +643,7 @@ class _AxesProxy(Proxy[MplAxes]):
self
.
_plot
.
x_axis
.
limit
=
self
.
delegate
.
get_xlim
()
self
.
_plot
.
x_axis
.
limit
=
self
.
delegate
.
get_xlim
()
ylabel
=
self
.
delegate
.
get_ylabel
()
ylabel
=
self
.
delegate
.
get_ylabel
()
yscale
=
_convert_matplotlib_scale
(
self
.
delegate
.
get_yscale
()
)
yscale
=
self
.
delegate
.
get_yscale
()
if
not
self
.
delegate
.
get_autoscaley_on
():
if
not
self
.
delegate
.
get_autoscaley_on
():
self
.
_plot
.
y_axis
.
limit
=
self
.
delegate
.
get_ylim
()
self
.
_plot
.
y_axis
.
limit
=
self
.
delegate
.
get_ylim
()
...
@@ -843,8 +839,8 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
...
@@ -843,8 +839,8 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
traces
.
append
(
traces
.
append
(
SurfaceTrace3D
(
SurfaceTrace3D
(
type
=
"
surface3D
"
,
type
=
"
surface3D
"
,
length
=
length
,
_
length
=
length
,
width
=
width
,
_
width
=
width
,
label
=
label
,
label
=
label
,
datapoints
=
datapoints
,
datapoints
=
datapoints
,
)
)
...
@@ -879,7 +875,7 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
...
@@ -879,7 +875,7 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
if
isinstance
(
self
.
_plot
,
Plot3D
):
if
isinstance
(
self
.
_plot
,
Plot3D
):
xlabel
=
self
.
delegate
.
get_xlabel
()
xlabel
=
self
.
delegate
.
get_xlabel
()
xscale
=
_convert_matplotlib_scale
(
self
.
delegate
.
get_xscale
()
)
xscale
=
self
.
delegate
.
get_xscale
()
self
.
_plot
.
x_axis
.
label
=
xlabel
self
.
_plot
.
x_axis
.
label
=
xlabel
self
.
_plot
.
x_axis
.
scale
=
xscale
self
.
_plot
.
x_axis
.
scale
=
xscale
...
@@ -887,7 +883,7 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
...
@@ -887,7 +883,7 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
self
.
_plot
.
x_axis
.
limit
=
self
.
delegate
.
get_xlim
()
self
.
_plot
.
x_axis
.
limit
=
self
.
delegate
.
get_xlim
()
ylabel
=
self
.
delegate
.
get_ylabel
()
ylabel
=
self
.
delegate
.
get_ylabel
()
yscale
=
_convert_matplotlib_scale
(
self
.
delegate
.
get_yscale
()
)
yscale
=
self
.
delegate
.
get_yscale
()
self
.
_plot
.
y_axis
.
label
=
ylabel
self
.
_plot
.
y_axis
.
label
=
ylabel
self
.
_plot
.
y_axis
.
scale
=
yscale
self
.
_plot
.
y_axis
.
scale
=
yscale
...
@@ -895,7 +891,7 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
...
@@ -895,7 +891,7 @@ class _AxesProxy3D(Proxy[MplAxes3D]):
self
.
_plot
.
y_axis
.
limit
=
self
.
delegate
.
get_ylim
()
self
.
_plot
.
y_axis
.
limit
=
self
.
delegate
.
get_ylim
()
zlabel
=
self
.
delegate
.
get_zlabel
()
zlabel
=
self
.
delegate
.
get_zlabel
()
zscale
=
_convert_matplotlib_scale
(
self
.
delegate
.
get_zscale
()
)
zscale
=
self
.
delegate
.
get_zscale
()
self
.
_plot
.
z_axis
.
label
=
zlabel
self
.
_plot
.
z_axis
.
label
=
zlabel
self
.
_plot
.
z_axis
.
scale
=
zscale
self
.
_plot
.
z_axis
.
scale
=
zscale
...
...
...
...
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
sign in
to comment