@@ -63,6 +63,7 @@ def __init__(
63
63
self .points = []
64
64
self .ticksx = np .array (ticksx )
65
65
self .ticksy = np .array (ticksy )
66
+ self ._fill = fill
66
67
if tick_pos :
67
68
self ._tickposx = plot ._tickheightx
68
69
self ._tickposy = plot ._tickheighty
@@ -82,42 +83,40 @@ def __init__(
82
83
if limits is not None :
83
84
self ._limits = np .array (
84
85
plot .transform (
85
- self .ymin , self .ymax , plot ._newymin , plot ._newymax , np .array (limits )
86
+ self .ymin ,
87
+ self .ymax ,
88
+ plot ._newymin ,
89
+ plot ._newymax ,
90
+ np .array (limits ),
86
91
),
87
92
dtype = np .int16 ,
88
93
)
89
94
plot ._plot_palette [9 ] = limits_color
90
95
else :
91
96
self ._limits = None
92
97
93
- self .draw_points (plot , x , y , fill )
94
-
95
- if plot ._showticks :
96
- if plot ._loggingfirst :
97
- self ._draw_ticks (plot )
98
- plot ._loggingfirst = False
99
- plot ._showticks = False
98
+ self .draw_points (plot , x , y )
100
99
101
100
def _draw_ticks (self , plot ) -> None :
102
101
"""
103
102
Draw ticks in the plot area
104
103
105
104
"""
106
105
107
- ticksxnorm = np .array (
106
+ self . _ticksxnorm = np .array (
108
107
plot .transform (
109
108
self .xmin , self .xmax , plot ._newxmin , plot ._newxmax , self .ticksx
110
109
),
111
110
dtype = np .int16 ,
112
111
)
113
- ticksynorm = np .array (
112
+ self . _ticksynorm = np .array (
114
113
plot .transform (
115
114
self .ymin , self .ymax , plot ._newymin , plot ._newymax , self .ticksy
116
115
),
117
116
dtype = np .int16 ,
118
117
)
119
118
120
- for i , tick in enumerate (ticksxnorm ):
119
+ for i , tick in enumerate (self . _ticksxnorm ):
121
120
draw_line (
122
121
plot ._plotbitmap ,
123
122
tick ,
@@ -128,7 +127,7 @@ def _draw_ticks(self, plot) -> None:
128
127
)
129
128
if plot ._showtext :
130
129
plot .show_text (f"{ self .ticksx [i ]:.0f} " , tick , plot ._newymin , (0.5 , 0.0 ))
131
- for i , tick in enumerate (ticksynorm ):
130
+ for i , tick in enumerate (self . _ticksynorm ):
132
131
draw_line (
133
132
plot ._plotbitmap ,
134
133
plot ._newxmin - self ._tickposy ,
@@ -155,7 +154,7 @@ def clear_plot(plot) -> None:
155
154
0 ,
156
155
)
157
156
158
- def draw_points (self , plot : Plot , x : list , y : list , fill : bool = False ) -> None :
157
+ def draw_points (self , plot : Plot , x : list , y : list ) -> None :
159
158
"""
160
159
Draws points in the plot
161
160
:param Plot plot: plot object provided
@@ -164,12 +163,22 @@ def draw_points(self, plot: Plot, x: list, y: list, fill: bool = False) -> None:
164
163
:param bool fill: parameter to fill the plot graphic. Defaults to False
165
164
:return: None
166
165
"""
166
+
167
167
self .clear_plot (plot )
168
168
if self ._limits :
169
169
self ._draw_limit_lines (plot )
170
- self .draw_new_lines (plot , x , y , fill )
170
+ self .draw_new_lines (plot , x , y )
171
+ if plot ._showticks :
172
+ if plot ._loggingfirst :
173
+ self ._draw_ticks (plot )
174
+ plot ._loggingfirst = False
175
+ plot ._showticks = False
176
+
177
+ if plot ._tickgrid :
178
+ plot ._draw_gridx (self ._ticksxnorm )
179
+ plot ._draw_gridy (self ._ticksynorm )
171
180
172
- def draw_new_lines (self , plot : Plot , x : list , y : list , fill : bool = False ) -> None :
181
+ def draw_new_lines (self , plot : Plot , x : list , y : list ) -> None :
173
182
"""
174
183
Draw the plot lines
175
184
:param Plot plot: plot object provided
@@ -204,7 +213,8 @@ def draw_new_lines(self, plot: Plot, x: list, y: list, fill: bool = False) -> No
204
213
ynorm [index + 1 ],
205
214
self ._line_index ,
206
215
)
207
- if fill :
216
+
217
+ if self ._fill :
208
218
for index , _ in enumerate (xnorm ):
209
219
draw_line (
210
220
plot ._plotbitmap ,
0 commit comments