Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
outLab5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sanjna
outLab5
Commits
f7174ad9
Commit
f7174ad9
authored
Sep 19, 2020
by
Sanjna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload new file
parent
26869a22
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
0 deletions
+49
-0
q3/q3.py
q3/q3.py
+49
-0
No files found.
q3/q3.py
0 → 100644
View file @
f7174ad9
from
mpl_toolkits.mplot3d
import
Axes3D
from
PIL
import
Image
from
matplotlib
import
cm
import
matplotlib.pyplot
as
plt
import
csv
import
os
from
mpl_toolkits.axes_grid1
import
make_axes_locatable
fig
=
plt
.
figure
(
figsize
=
(
12
,
12
))
axs
=
fig
.
add_subplot
(
111
,
projection
=
'3d'
)
#plt.box(on=None)
#right_side = axs.spines["right"]
#right_side.set_visible(False)
x
=
[]
y
=
[]
z
=
[]
with
open
(
'csv_file'
,
'r'
)
as
csvfile
:
ips
=
csv
.
reader
(
csvfile
,
delimiter
=
','
)
for
row
in
ips
:
x
.
append
(
float
(
row
[
0
]))
y
.
append
(
float
(
row
[
1
]))
z
.
append
(
float
(
row
[
2
]))
bardtl
=
axs
.
scatter
(
x
,
y
,
z
,
c
=
z
,
alpha
=
0.5
,
marker
=
'o'
,
cmap
=
cm
.
coolwarm
)
#axs.view_init(40, 295)
divider
=
make_axes_locatable
(
plt
.
gca
())
cax
=
fig
.
add_axes
([
0.94
,
0.25
,
0.02
,
0.5
])
plt
.
colorbar
(
bardtl
,
shrink
=
0.5
,
cax
=
cax
)
axs
.
set_xlabel
(
'X axis'
,
fontweight
=
'bold'
)
axs
.
set_ylabel
(
'Y axis'
,
fontweight
=
'bold'
)
axs
.
set_zlabel
(
'Z axis'
,
labelpad
=
6
,
fontweight
=
'bold'
)
axs
.
w_xaxis
.
pane
.
fill
=
False
axs
.
w_yaxis
.
pane
.
fill
=
False
axs
.
w_zaxis
.
pane
.
fill
=
False
axs
.
grid
(
None
)
fig
.
savefig
(
'q3plot2.png'
,
bbox_inches
=
'tight'
)
im1
=
Image
.
open
(
r'q3plot2.png'
)
imjpg
=
im1
.
convert
(
'RGB'
)
imjpg
.
save
(
'q3plot.jpg'
)
os
.
remove
(
"q3plot2.png"
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment