Hello, I have this code,which is used for x axis on graph. It shows names like januar, februar, ... on x axis
which gives an output:What I want is to have my own x axis - example: and desired output of the code would be:So, the question is how to get desired output?
Regards, Vlado
Code:
months = [1,2,3,4,5,6,7,8,9,10]month_labels = [ # Generate a list of tuples (x_value, x_label) (m, datetime.date(2020, m, 1).strftime('%B')) for m in months]print(month_labels)
which gives an output:
Code:
[(1, 'januar'), (2, 'februar'), (3, 'marec'), (4, 'april'), (5, 'maj'), (6, 'junij'), (7, 'julij'), (8, 'avgust'), (9, 'september'), (10, 'oktober')]
Code:
my_x_axses = [1,2,3,4,5,6,7,1,2,3]
Code:
[(1, '1'), (2, '2'), (3, '3'), (4, '4'), (5, '5'), (6, '6'), (7, '7'), (8, '1'), (9, '2'), (10, '3')]
Regards, Vlado
Statistics: Posted by California — Fri Aug 30, 2024 12:04 pm