@@ -63,6 +63,7 @@ def __init__(
6363 self .points = []
6464 self .ticksx = np .array (ticksx )
6565 self .ticksy = np .array (ticksy )
66+ self ._fill = fill
6667 if tick_pos :
6768 self ._tickposx = plot ._tickheightx
6869 self ._tickposy = plot ._tickheighty
@@ -82,42 +83,40 @@ def __init__(
8283 if limits is not None :
8384 self ._limits = np .array (
8485 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 ),
8691 ),
8792 dtype = np .int16 ,
8893 )
8994 plot ._plot_palette [9 ] = limits_color
9095 else :
9196 self ._limits = None
9297
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 )
10099
101100 def _draw_ticks (self , plot ) -> None :
102101 """
103102 Draw ticks in the plot area
104103
105104 """
106105
107- ticksxnorm = np .array (
106+ self . _ticksxnorm = np .array (
108107 plot .transform (
109108 self .xmin , self .xmax , plot ._newxmin , plot ._newxmax , self .ticksx
110109 ),
111110 dtype = np .int16 ,
112111 )
113- ticksynorm = np .array (
112+ self . _ticksynorm = np .array (
114113 plot .transform (
115114 self .ymin , self .ymax , plot ._newymin , plot ._newymax , self .ticksy
116115 ),
117116 dtype = np .int16 ,
118117 )
119118
120- for i , tick in enumerate (ticksxnorm ):
119+ for i , tick in enumerate (self . _ticksxnorm ):
121120 draw_line (
122121 plot ._plotbitmap ,
123122 tick ,
@@ -128,7 +127,7 @@ def _draw_ticks(self, plot) -> None:
128127 )
129128 if plot ._showtext :
130129 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 ):
132131 draw_line (
133132 plot ._plotbitmap ,
134133 plot ._newxmin - self ._tickposy ,
@@ -155,7 +154,7 @@ def clear_plot(plot) -> None:
155154 0 ,
156155 )
157156
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 :
159158 """
160159 Draws points in the plot
161160 :param Plot plot: plot object provided
@@ -164,12 +163,22 @@ def draw_points(self, plot: Plot, x: list, y: list, fill: bool = False) -> None:
164163 :param bool fill: parameter to fill the plot graphic. Defaults to False
165164 :return: None
166165 """
166+
167167 self .clear_plot (plot )
168168 if self ._limits :
169169 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 )
171180
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 :
173182 """
174183 Draw the plot lines
175184 :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
204213 ynorm [index + 1 ],
205214 self ._line_index ,
206215 )
207- if fill :
216+
217+ if self ._fill :
208218 for index , _ in enumerate (xnorm ):
209219 draw_line (
210220 plot ._plotbitmap ,
0 commit comments