The following approach:
- hides the spine representing the existing x-axis
- adds a dummy point for zero (e.g. at
x=40) - draws some lines for the kink, using
clip_on=Falseto draw outside the main axes' area, andax.get_xaxis_transform()to use "data coordinates" forxand "axes coordinates" fory(0at the bottom and1at the top); the thickness and line color are copied from the spine - shows the dummy zero position as
0
import matplotlib.pyplot as plt
import numpy as np
data = np.random.randint(50, 89, 80)
bins = np.arange(50, data.max()+6, 5)
fig, ax = plt.subplots(figsize=(12,5))
ax.hist(data, bins=bins, fc='skyblue', ec='navy')
false_zero = bins[0] - 10
ax.set_xticks(np.append(false_zero, bins))
ax.set_xticklabels(np.append(0, bins))
for spine in ['top', 'right', 'bottom']:
ax.spines[spine].set_visible(False)
ax.add_line(plt.Line2D(xdata=[false_zero, false_zero + 2, false_zero + 4, false_zero + 4, false_zero + 6, bins[-1] + 1],
ydata=[0, 0, 0.1, -0.1, 0, 0],
color=ax.spines['bottom'].get_edgecolor(), lw=ax.spines['bottom'].get_linewidth(),
clip_on=False, transform=ax.get_xaxis_transform()))
plt.tight_layout()
plt.show()

PS: For the kink of the original post:
ax.add_line(plt.Line2D(xdata=[false_zero, false_zero + 2, false_zero + 2, false_zero + 6, false_zero + 6, bins[-1] + 1],
ydata=[0, 0, 0.1, -0.1, 0, 0], ...))

GitHub
github.com › kodemore › kink
GitHub - kodemore/kink: Dependency injection container made for Python · GitHub
Dependency injection container made for Python. Contribute to kodemore/kink development by creating an account on GitHub.
Starred by 442 users
Forked by 30 users
Languages Python
Reddit
reddit.com › r/python › dependency injection made simple in python
r/Python on Reddit: Dependency Injection Made simple in Python
April 27, 2021 -
I have had enough of global variables, usage of global scope and hundreds of complex monkey patching flying around in our codebase at work so I made DI Container specially for python.We are using it right now with success on production environments and our codebase got better thanks to it. Thought I will share it and ask for your opinions.
Happy reading :)
https://github.com/kodemore/kink
Top answer 1 of 5
14
While this does look sophisticated, and probably is quite smart, I personally strongly dislike when python is made into something it is not. We already have similar sort of injections in pytest. It works there because tests are very "flat". Introducing something like this into main code base would make code incomprehensible for many average python users. Perhaps best to keep these kind of practices for other languages, and keep python pythinic (readability matters). Why not just do some lazy initialisation in your db library, and yes, give it a global state, make it manage its connection pool, whatever it takes so it looks sensible after import! Sometimes it's very hard to keep things simple, but we should keep trying.
2 of 5
4
I don't really see the point of the "magic" provided by a DI container. Why not just use an explicit config dict or object?
I spent 2 years building a dead-simple Dependency Injection package for Python Dec 2, 2025
r/Python 7mo ago
I built a minimal, type-safe dependency injection container for Python Jul 10, 2025
r/Python last yr.
PyPI
pypi.org › project › kink › 0.1.3
kink · PyPI
December 26, 2019 - pip install kink==0.1.3 Copy PIP instructions · Newer version available (0.9.0) Released: Dec 26, 2019 · Dependency injection for python. These details have been verified by PyPI · krac · These details have not been verified by PyPI · Homepage · Documentation ·
» pip install kink
Netguru
netguru.com › home page › blog › dependency injection with python, make it easy!
Dependency Injection With Python, Make It Easy!
October 11, 2023 - In all of my projects, I use kink (kodemore/kink) – it's a library created by my friend. 😉 · It provides us with a dependency injection container with an elegant pythonic way of using it, together with just one Python decorator to mark classes and functions that need the injection.
Ets-labs
python-dependency-injector.ets-labs.org
Dependency Injector — Dependency injection framework for Python — Dependency Injector 4.49.1 documentation
Dependency Injector is a dependency injection framework for Python. It helps to maintain you application structure. It was designed to be unified, developer-friendly tool that helps to implement dependency injection design pattern in formal, pretty, Pythonic way.
Repology
repology.org › project › python:kink › packages
python:kink packages - Repology
Summary: Dependency injection for python.
Instagram
instagram.com › p › DHEpJLYPYef
Hello, im Velvet Python, your friendly neighborhood kink ...
We cannot provide a description for this page right now
Python Line Sets
pythonls.com › home › faqs
FAQs - Python Line Sets
August 20, 2024 - While Python is less likely to kink than copper, it is susceptible to kinking once the minimum bend radius is exceeded.
ResearchGate
researchgate.net › publication › 331391178_Some_Recent_Developments_on_Kink_Collisions_and_Related_Topics_Python_Version
Some Recent Developments on Kink Collisions and Related Topics: Python Version | Request PDF
February 1, 2019 - Request PDF | Some Recent Developments on Kink Collisions and Related Topics: Python Version | We review recent works on modeling of dynamics of kinks in 1\(+\)1 dimensional \(\phi ^4\) theory and other related models, like sine-Gordon model... | Find, read and cite all the research you need ...
Andersartig
andersartig.de › en › brand › patrice-catanzaro › ladies-dresses › patrice-catanzaro-python-kink-dress › a-3460
PATRICE CATANZARO Python Kink Dress
Patrice Catanzaro Dresses: Exotic club couture and hot cocktail dresses - Wetlook dresses, vinyl robes, see-through dresses, submissive dress, bondage dress
RoseIndia
roseindia.net › answers › viewqa › pythonquestions › 130647-ModuleNotFoundError-No-module-named-kink.html
ModuleNotFoundError: No module named 'kink'
In your python environment you have to install padas library. You can install kink python with following command:
Python Line Sets
pythonls.com › home › about
About - Python Line Sets
August 20, 2024 - As an alternative to copper pipe, Python is light-weight, chemical resistant, UV resistant, and tear and kink resistant. Pricing is competitive and more stable than copper line set pipe pricing. Python is less likely to be stolen on job sites.
LibHunt
libhunt.com › compare-kink-vs-python-dependency-injector
kink vs Dependency Injector - compare differences and reviews? | LibHunt
connexion - Connexion is a modern Python web framework that makes spec-first and api-first development easy. kink vs flama Dependency Injector vs django-rest-framework kink vs injector Dependency Injector vs falcon kink vs flask_injector Dependency Injector vs connexion
