FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
finplot/finplot/pdplot.py at master · gitlong/finplot · GitHub
gitlong
/
finplot
Public
forked from
highfestiva/finplot
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
finplot
/
finplot
/
pdplot.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
53 lines (50 loc) · 1.83 KB
Breadcrumbs
finplot
/
finplot
/
pdplot.py
Copy path
File metadata and controls
53 lines (50 loc) · 1.83 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
'''
Used as Pandas plotting backend.
'''
import
finplot
def
plot
(
df
,
x
,
y
,
kind
,
**
kwargs
):
_x
=
df
.
index
if
y
is
None
else
df
[
x
]
try
:
_y
=
df
[
x
].
reset_index
(
drop
=
True
)
if
y
is
None
else
df
[
y
]
except
:
_y
=
df
.
reset_index
(
drop
=
True
)
kwargs
=
dict
(
kwargs
)
if
'by'
in
kwargs
:
del
kwargs
[
'by'
]
if
kind
in
(
'candle'
,
'candle_ochl'
,
'candlestick'
,
'candlestick_ochl'
,
'volume'
,
'volume_ocv'
,
'renko'
):
if
'candle'
in
kind
:
return
finplot
.
candlestick_ochl
(
df
,
**
kwargs
)
elif
'volume'
in
kind
:
return
finplot
.
volume_ocv
(
df
,
**
kwargs
)
elif
'renko'
in
kind
:
return
finplot
.
renko
(
df
,
**
kwargs
)
elif
kind
==
'scatter'
:
if
'style'
not
in
kwargs
:
kwargs
[
'style'
]
=
'o'
if
type
(
x
)
is
str
and
type
(
y
)
is
str
and
_x
is
not
None
and
_y
is
not
None
:
return
finplot
.
plot
(
_x
,
_y
,
**
kwargs
)
else
:
return
finplot
.
plot
(
df
,
**
kwargs
)
elif
kind
==
'bar'
:
if
type
(
x
)
is
str
and
type
(
y
)
is
str
and
_x
is
not
None
and
_y
is
not
None
:
return
finplot
.
bar
(
_x
,
_y
,
**
kwargs
)
else
:
return
finplot
.
bar
(
df
,
**
kwargs
)
elif
kind
in
(
'barh'
,
'horiz_time_volume'
):
return
finplot
.
horiz_time_volume
(
df
,
**
kwargs
)
elif
kind
in
(
'heatmap'
):
return
finplot
.
heatmap
(
df
,
**
kwargs
)
elif
kind
in
(
'labels'
):
if
type
(
x
)
is
str
and
type
(
y
)
is
str
and
_x
is
not
None
and
_y
is
not
None
:
return
finplot
.
labels
(
_x
,
_y
,
**
kwargs
)
else
:
return
finplot
.
labels
(
df
,
**
kwargs
)
elif
kind
in
(
'hist'
,
'histogram'
):
return
finplot
.
hist
(
df
,
**
kwargs
)
else
:
if
x
is
None
:
_x
=
df
_y
=
None
if
'style'
not
in
kwargs
:
kwargs
[
'style'
]
=
None
return
finplot
.
plot
(
_x
,
_y
,
**
kwargs
)
Back
|
FazBrowse Home
|
New Git URL