0

I am reading about machine learn algorithms using python. Though I am new to python I am trying to follow most of the stuff. But I am finding difficult to understand below

 axprops = dict(xticks=[], yticks=[])
 createPlot.ax1 = plt.subplot(111, frameon=False, **axprops)  

In above code what **axprops mean here? and why we are appending ** before axprops?

What is xticks and yticks in this context?

What is the declaration of subplot. I am not able to find one when I searched in Internet.

Thanks

2

1 Answer 1

1

Google knows nothing about axprops, it's an arbitraty variable name - search for *args and **kwargs (the latter meaning, "keyword arguments") in the python tutorial, or on SO as stated in the comment.

You can pass a lot of keyword arguments to your function in one call by providing a dictionary (in which the keys are limited to parameters the funtion expects, of course, but need not contain all parameters). In your example it's completely useless (well, a question of style), but you could construct this dictionary dynamically inside ifs, for example...

In this case you pass those arguments to tell the subplot not to draw any ticks (just try without passing the axprops, and you will see what this changes, it will autogenerate ticks which it thinks appropriate for the data)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.