@@ -56,6 +56,8 @@ class Uplot(displayio.Group):
56
56
:param bool show_box: select if the plot box is displayed
57
57
:param int background_color: background color in HEX. Defaults to black ``0x000000``
58
58
:param int box_color: allows to choose the box line color. Defaults to white ''0xFFFFFF``
59
+ :param int tickx_height: x axes tick height in pixels. Defaults to 8.
60
+ :param int ticky_height: y axes tick height in pixels. Defaults to 8.
59
61
60
62
"""
61
63
@@ -69,6 +71,8 @@ def __init__(
69
71
show_box : bool = True ,
70
72
background_color : int = 0x000000 ,
71
73
box_color : int = 0xFFFFFF ,
74
+ tickx_height : int = 8 ,
75
+ ticky_height : int = 8 ,
72
76
) -> None :
73
77
if width not in range (50 , 481 ):
74
78
print ("Be sure to verify your values. Defaulting to width=100" )
@@ -107,7 +111,8 @@ def __init__(
107
111
108
112
self ._showtext = False
109
113
110
- self ._tickheight = 8
114
+ self ._tickheightx = tickx_height
115
+ self ._tickheighty = ticky_height
111
116
self ._tickcolor = 0xFFFFFF
112
117
self ._showticks = False
113
118
self ._tickgrid = False
@@ -301,7 +306,7 @@ def _draw_ticks(self, x: int, y: int) -> None:
301
306
tick ,
302
307
self ._newymin ,
303
308
tick ,
304
- self ._newymin - self ._tickheight ,
309
+ self ._newymin - self ._tickheightx ,
305
310
2 ,
306
311
)
307
312
if self ._showtext :
@@ -313,7 +318,7 @@ def _draw_ticks(self, x: int, y: int) -> None:
313
318
self ._plotbitmap ,
314
319
self ._newxmin ,
315
320
tick ,
316
- self ._newxmin + self ._tickheight ,
321
+ self ._newxmin + self ._tickheighty ,
317
322
tick ,
318
323
2 ,
319
324
)
@@ -327,15 +332,15 @@ def _draw_ticks(self, x: int, y: int) -> None:
327
332
tick ,
328
333
self ._newymin ,
329
334
tick ,
330
- self ._newymin - self ._tickheight // 2 ,
335
+ self ._newymin - self ._tickheightx // 2 ,
331
336
2 ,
332
337
)
333
338
for tick in subticksyrenorm :
334
339
draw_line (
335
340
self ._plotbitmap ,
336
341
self ._newxmin ,
337
342
tick ,
338
- self ._newxmin + self ._tickheight // 2 ,
343
+ self ._newxmin + self ._tickheighty // 2 ,
339
344
tick ,
340
345
2 ,
341
346
)
@@ -346,24 +351,28 @@ def _draw_ticks(self, x: int, y: int) -> None:
346
351
347
352
def tick_params (
348
353
self ,
349
- tickheight : int = 8 ,
354
+ tickx_height : int = 8 ,
355
+ ticky_height : int = 8 ,
350
356
tickcolor : int = 0xFFFFFF ,
351
357
tickgrid : bool = False ,
352
358
showtext : bool = False ,
353
359
) -> None :
354
360
"""
355
361
Function to set ticks parameters
356
362
357
- :param int tickheight: tick height in pixels
358
- :param int tickcolor: tick color in hex
359
- :param bool tickgrid: defines if the grid is to be shown
363
+ :param int tickx_height: X axes tick height in pixels. Defaults to 8
364
+ :param int ticky_height: Y axes tick height in pixels. Defaults to 8
365
+ :param int tickcolor: tick color in hex. Defaults to white. ``0xFFFFFF``
366
+ :param bool tickgrid: defines if the grid is to be shown. Defaults to `False`
367
+ :param bool showtext: Show Axes text. Defaults to `False`
360
368
361
369
:return: None
362
370
363
371
"""
364
372
365
373
self ._showticks = True
366
- self ._tickheight = tickheight
374
+ self ._tickheightx = tickx_height
375
+ self ._tickheighty = ticky_height
367
376
self ._plot_palette [2 ] = tickcolor
368
377
self ._tickgrid = tickgrid
369
378
self ._showtext = showtext
0 commit comments