+ 1

How can I add a x and y axis to this code because I didn't create a plot it is just an illustration

https://sololearn.com/compiler-playground/cC4c6zvQbcnD/?ref=app

12th Mar 2024, 7:31 AM
P A Arrchith Iyer
P A Arrchith Iyer - avatar
8 Réponses
+ 6
ax.set_xticks([]) ax.set_yticks([]) ax.set_yticklabels([]) ax.set_xticklabels([]) With these you can control how many marks (ticks) to put on the horizontal and vertical lines, and what should be their label. Using an empty list you remove all ticks.
12th Mar 2024, 8:13 AM
Tibor Santa
Tibor Santa - avatar
+ 4
Have you read your own code at all? Comment line 37 #ax.axis('off')
12th Mar 2024, 7:57 AM
Tibor Santa
Tibor Santa - avatar
+ 3
Where did you get the code from initially?
12th Mar 2024, 9:18 AM
Lisa
Lisa - avatar
+ 3
It sounds like you don't have a good grasp yet of which part of the code is doing what. Try to rewrite the code line by line to dissect what the individual parts are doing. To understand the structure, it may help to look at some more matplot example – compare them with the code.
12th Mar 2024, 9:30 AM
Lisa
Lisa - avatar
+ 1
But if I turn it on it is so messy I need an organised plot, even you can try it how messy the x axis is.I want x axis as diameter of earth and y axis as height which is equal to diameter
12th Mar 2024, 8:00 AM
P A Arrchith Iyer
P A Arrchith Iyer - avatar
0
Can you implement it on my code to know the structure
12th Mar 2024, 8:52 AM
P A Arrchith Iyer
P A Arrchith Iyer - avatar
0
This idea is mine and I used google and chat gpt to understand the structure and I wrote the code because the chat gpt has a lot of errors and i analysed the structure and fixed the errors and enhanced the data accuracy
12th Mar 2024, 9:21 AM
P A Arrchith Iyer
P A Arrchith Iyer - avatar
0
In order to add an x and y axis, take some time throughout the day to read your code line by line. Figure out what each line does, see how it works. Test it out. Don't rely on bots. The more you understand your code, the easier you can work with it
14th Mar 2024, 3:44 AM
Aza
Aza - avatar