Skip to content

Commit 7833788

Browse files
committed
added matplotlylib tests back, with some import changes -> passing!
1 parent ee5e432 commit 7833788

20 files changed

Lines changed: 1434 additions & 1 deletion

plotly/matplotlylib/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
'tools' module or 'plotly' package.
1010
1111
"""
12+
from . renderer import PlotlyRenderer
13+
from . mplexporter import Exporter

plotly/matplotlylib/renderer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from . mplexporter import Renderer
1212
from . import mpltools
13-
from ..plotly.graph_objs import *
13+
from ..graph_objs import *
1414

1515

1616

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def setup_package():
2+
import warnings
3+
warnings.filterwarnings('ignore')
4+
5+
6+
def teardown_package():
7+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
1+
from plotly.graph_objs import *
2+
3+
ANNOTATIONS = Figure(
4+
data=Data([
5+
Scatter(
6+
x=[0.0, 1.0, 2.0],
7+
y=[1.0, 2.0, 3.0],
8+
name='_line0',
9+
mode='lines',
10+
line=Line(
11+
dash='solid',
12+
color='#0000FF',
13+
width=1.0,
14+
opacity=1
15+
),
16+
xaxis='x1',
17+
yaxis='y1'
18+
),
19+
Scatter(
20+
x=[0.0, 1.0, 2.0],
21+
y=[3.0, 2.0, 1.0],
22+
name='_line1',
23+
mode='lines',
24+
line=Line(
25+
dash='solid',
26+
color='#0000FF',
27+
width=1.0,
28+
opacity=1
29+
),
30+
xaxis='x1',
31+
yaxis='y1'
32+
)
33+
]),
34+
layout=Layout(
35+
width=640,
36+
height=480,
37+
autosize=False,
38+
margin=Margin(
39+
l=80,
40+
r=63,
41+
b=47,
42+
t=47,
43+
pad=0
44+
),
45+
hovermode='closest',
46+
showlegend=False,
47+
annotations=Annotations([
48+
Annotation(
49+
x=0.000997987927565,
50+
y=0.996414507772,
51+
text='top-left',
52+
xref='paper',
53+
yref='paper',
54+
showarrow=False,
55+
align='left',
56+
font=Font(
57+
size=12.0,
58+
color='#000000'
59+
),
60+
opacity=1,
61+
xanchor='left',
62+
yanchor='top'
63+
),
64+
Annotation(
65+
x=0.000997987927565,
66+
y=0.00358549222798,
67+
text='bottom-left',
68+
xref='paper',
69+
yref='paper',
70+
align='left',
71+
showarrow=False,
72+
font=Font(
73+
size=12.0,
74+
color='#000000'
75+
),
76+
opacity=1,
77+
xanchor='left',
78+
yanchor='bottom'
79+
),
80+
Annotation(
81+
x=0.996989939638,
82+
y=0.996414507772,
83+
text='top-right',
84+
xref='paper',
85+
yref='paper',
86+
align='right',
87+
showarrow=False,
88+
font=Font(
89+
size=12.0,
90+
color='#000000'
91+
),
92+
opacity=1,
93+
xanchor='right',
94+
yanchor='top'
95+
),
96+
Annotation(
97+
x=0.996989939638,
98+
y=0.00358549222798,
99+
text='bottom-right',
100+
xref='paper',
101+
yref='paper',
102+
align='right',
103+
showarrow=False,
104+
font=Font(
105+
size=12.0,
106+
color='#000000'
107+
),
108+
opacity=1,
109+
xanchor='right',
110+
yanchor='bottom'
111+
)
112+
]),
113+
xaxis1=XAxis(
114+
domain=[0.0, 1.0],
115+
range=(0.0, 2.0),
116+
showline=True,
117+
ticks='inside',
118+
showgrid=False,
119+
zeroline=False,
120+
anchor='y1',
121+
mirror=True
122+
),
123+
yaxis1=YAxis(
124+
domain=[0.0, 1.0],
125+
range=(1.0, 3.0),
126+
showline=True,
127+
ticks='inside',
128+
showgrid=False,
129+
zeroline=False,
130+
anchor='x1',
131+
mirror=True
132+
)
133+
)
134+
)
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
from plotly.graph_objs import *
2+
3+
D = dict(
4+
x=[1, 2, 3, 4, 5, 6, 7, 8, 9, 10],
5+
y=[10, 3, 100, 6, 45, 4, 80, 45, 3, 59])
6+
7+
EVEN_LINEAR_SCALE = Figure(
8+
data=Data([
9+
Scatter(
10+
x=[1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0],
11+
y=[10.0, 3.0, 100.0, 6.0, 45.0, 4.0, 80.0, 45.0, 3.0, 59.0],
12+
name='_line0',
13+
mode='lines',
14+
line=Line(
15+
dash='solid',
16+
color='#0000FF',
17+
width=1.0,
18+
opacity=1
19+
),
20+
xaxis='x1',
21+
yaxis='y1'
22+
)
23+
]),
24+
layout=Layout(
25+
width=640,
26+
height=480,
27+
autosize=False,
28+
margin=Margin(
29+
l=80,
30+
r=63,
31+
b=47,
32+
t=47,
33+
pad=0
34+
),
35+
hovermode='closest',
36+
showlegend=False,
37+
xaxis1=XAxis(
38+
domain=[0.0, 1.0],
39+
range=[0.0, 18.0],
40+
type='linear',
41+
showline=True,
42+
tick0=0,
43+
dtick=3,
44+
ticks='inside',
45+
showgrid=False,
46+
autotick=False,
47+
zeroline=False,
48+
tickfont=Font(
49+
size=12.0
50+
),
51+
anchor='y1',
52+
side='bottom',
53+
mirror='ticks'
54+
),
55+
yaxis1=YAxis(
56+
domain=[0.0, 1.0],
57+
range=[0.0, 195.0],
58+
type='linear',
59+
showline=True,
60+
tick0=0,
61+
dtick=13,
62+
ticks='inside',
63+
showgrid=False,
64+
autotick=False,
65+
zeroline=False,
66+
tickfont=Font(
67+
size=12.0
68+
),
69+
anchor='x1',
70+
side='left',
71+
mirror='ticks'
72+
)
73+
)
74+
)

0 commit comments

Comments
 (0)