I am trying to change the x axis in the graph to get the ordinal values ββof the text, and itβs hard for me to find a workaround. Here is my goal: I want to show the IRR 2 of the proposed modifications to the government program for senior citizens whose average income was $ 20,000 and $ 50,000 in their entire lives.
So, I have 4 IRRs: 2 for those who have $ 20,000, and 2 for those who have $ 50,000. What difficulty is that I do not have exact x coordinates; instead, I used the nominal x-coordinates to create my histograms (using the .quad () method).
Then, using the FixedTicker class, I got only 2 tickers that show: those that are between the bunkers that describe each income category. At this point, I hope that I can change these fixed tickers to some other custom tickers (perhaps using dict?), But I really don't know.
I guess here, so maybe I'm completely wrong in this FixedTicker strategy. Is there a way to change the tickers? If not, is there another way?
I tried to use categories on the x axis, but the problem was that I didnβt have pairs like category: value, it looks more like category: (value, value).
Here is my code:
from bokeh.io import show, output_notebook from bokeh.plotting import figure from bokeh.models import FixedTicker output_notebook() irr_fed = [4.24, 3.04] irr_prov = [2.59, 2.83] plot = figure(title="Internal Rates of Return: Federal vs. Provincial", y_range=(0,5), x_range=(0,12)) plot.quad(top=[irr_fed[0], irr_prov[0], irr_fed[1], irr_prov[1]], bottom=0, left=[1,3.5,7,9.5], right=[2.5,5,8.5,11]) plot.xaxis[0].ticker=FixedTicker(ticks=[3, 9]) show(plot)
I would show the plot that I brought here, but I can not publish the images, as I am new here, and I do not have enough reputation. If you want to see it, the code works fine in a laptop.