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=False to draw outside the main axes' area, and ax.get_xaxis_transform() to use "data coordinates" for x and "axes coordinates" for y (0 at the bottom and 1 at 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], ...))

Answer from JohanC on Stack Overflow
🌐
GitHub
github.com › kodemore › kink
GitHub - kodemore/kink: Dependency injection container made for Python · GitHub
Dependency injection container made for python · Easy to use interface · Extensible with custom dependency resolvers · Automatic dependency injection (Autowiring) Lightweight · Support for async with asyncio · pip install kink · If you don't know poetry, I highly recommend visiting their webpage ·
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

Discussions

Put a kink in x axis in seaborn or matplotlib - python - Stack Overflow
I have searched everywhere but couldn't find a solution as to how in seaborn/matplotlib I can put a kink in the x-axis like the one shown in the figure More on stackoverflow.com
🌐 stackoverflow.com
python - Finding kinks/corners in array - Stack Overflow
I'm trying to programmatically analyze visual data that looks like this: An algorithm/method/filter to detect any "corner" (green squares drawn on plot) is what I'm after. The black dashed More on stackoverflow.com
🌐 stackoverflow.com
Kinking polygons in PYTHON To kink a polygon, we simply kink every one of its segments. Basic polygon function looks like this: poly1 = [(0, 0), (1, 2), (2, 0)] draw_polygon(*poly1) Write below the kinked polygon function.: def kink_polygon(poly): # YOUR CODE HERE Please help me write code for a kinked polygon function. I am using google
Answer to Kinking polygons in PYTHON To kink a polygon, we More on chegg.com
🌐 chegg.com
1
October 6, 2021
How to wire dependency injection for azure function python v2 - Stack Overflow
Microsoft documentation also doesn't mentioned anything about Dependency Injection in python function v2 programming guide python developer guidance for azure function v2 · This is partial code snippet of sample I tried but it didn't work. I used kink for DI in below example More on stackoverflow.com
🌐 stackoverflow.com
🌐
PyPI
pypi.org › project › kink › 0.1.3
kink · PyPI
December 26, 2019 - Dependency injection for python. ... from kink import inject from os import getenv @inject(dsn=getenv("DB_DSN"), password=getenv("DB_PASSWORD")) def get_database(dsn: str, password: str): ...
      » pip install kink
    
Published   Dec 26, 2019
Version   0.1.3
🌐
GitHub
github.com › kodemore › kink › blob › master › pyproject.toml
kink/pyproject.toml at master · kodemore/kink
"Topic :: Software Development :: Libraries :: Python Modules" ] · include = ["kink/py.typed"] · # Requirements · [tool.poetry.dependencies] python = "^3.8" typing_extensions = "^4.9.0" ·
Author   kodemore
🌐
Stack Overflow
stackoverflow.com › questions › 67190382 › finding-kinks-corners-in-array
python - Finding kinks/corners in array - Stack Overflow
I'm trying to programmatically analyze visual data that looks like this: An algorithm/method/filter to detect any "corner" (green squares drawn on plot) is what I'm after. The black dashed
🌐
Readthedocs
causalpy.readthedocs.io › en › stable › notebooks › rkink_pymc.html
Regression kink design with pymc models — CausalPy 0.8.1 documentation
We can visualise what these functions look like by plotting a number of them with randomly chosen \(\beta\) coefficients, but all with a kink point at \(0.5\).
Find elsewhere
🌐
Socket
socket.dev › pypi › package › kink
kink - pypi Package Security Analysis - Socket.dev
To fully utilise the potential of kink it is recommended to bootstrap your initial dependencies (config values, or instances of classes that are standalone, requires no other dependencies than themselves). Some people prefer to keep it in __init__.py in the top module of your application, other create separate bootstrap.py file for this purpose.
🌐
Netguru
netguru.com › home page › blog › dependency injection with python, make it easy!
Dependency Injection With Python, Make It Easy!
October 11, 2023 - You can add new dependencies as you are adding new values to the Python dict, which is a cool feature in my opinion. Also, you can register your dependencies in two ways: ... from kink import di ...
🌐
GitHub
github.com › sfermigier › awesome-dependency-injection-in-python
GitHub - sfermigier/awesome-dependency-injection-in-python: A curated list of awesome things related to dependency inversion / dependency injection in Python. (Contributions welcomed). · GitHub
Inject ★770 - Python dependency injection. [🐍, Apache License 2.0]. FastDepends ★497 - FastAPI Dependency Injection system extracted from FastAPI and cleared of all HTTP logic. [🐍, MIT License]. Kink ★438 - Dependency injection container made for Python.
Author   sfermigier
🌐
PyPI
pypi.org › project › kink › 0.3.7
kink
January 20, 2021 - JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Medium
jasondeden.medium.com › kinks-in-the-works-2a1e2b609cc9
Kinks In the Works. Increasing Functional Complexity in… | by Jason Eden | Medium
December 26, 2021 - Note that for each neuron in our network, we were able to define another hinge point, or “kink” in the line, that got added to the function so that the slope of the prediction line would change based on the sum of all of the neurons.
🌐
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.
🌐
GitHub
github.com › satanasov › scraper
GitHub - satanasov/scraper: Small python project to scrape kink.com and create NFO files
So I created this little thingy. Just start scraper.py and you will get simple interface that allows you to select the folder where your collection is and start adding scrapin one by one.
Author   satanasov
🌐
Medium
snir-orlanczyk.medium.com › python-di-dependency-injection-part-2-containers-c621f4311d55
Python — DI (dependency injection ) — Part 2 — Containers | by Snir Orlanczyk | Medium
November 29, 2023 - In this example I created a wrapper around kink, i used it as a very simple DI container that covers all the basic needs, and the implementation of it is straight forward and simple to understand and review.
🌐
GitHub
github.com › kodemore › kink › blob › master › kink › __init__.py
kink/kink/__init__.py at master · kodemore/kink
Dependency injection container made for Python. Contribute to kodemore/kink development by creating an account on GitHub.
Author   kodemore
🌐
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 on ResearchGate
🌐
Stack Overflow
stackoverflow.com › questions › 77449425 › how-to-wire-dependency-injection-for-azure-function-python-v2
How to wire dependency injection for azure function python v2 - Stack Overflow
Copyfrom kink import inject import logging from IocService import IocService import azure.functions as func bp = func.Blueprint() @inject @bp.route(route="default_template") def default_template(req: func.HttpRequest, context: func.Context, service: IocService) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request.') #ioc_service = context.get_service(IocService) name = req.params.get('name') if not name: try: req_body = req.get_json() except ValueError: pass else: name = req_body.get('name') if name: return func.HttpResponse( f"Hello, {name}. This HTTP-triggered function " f"executed successfully.") else: return func.HttpResponse( "This HTTP-triggered function executed successfully.
🌐
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 injector Dependency Injector vs django-rest-framework kink vs flama Dependency Injector vs falcon kink vs eff Dependency Injector vs connexion