Skip to content
Advertisement

Tag: matplotlib

Python: How to plot Pabon Lasso chart using matplotlib?

I’m trying to plot a Pabon-Lasso chart using python’s matplotlib library. Pabon-Lasso is a healthcare services efficiency/performance plot. I only found the R code library for the plotting at: https://cran.r-project.org/web/packages/PabonLasso/index.html through searching but I have zero R knowledge. Examples of a Pabon-Lasso chart is as follows: The X-axis refers to BOR (Bed Occupancy Rate). The Y-axis refers to BTR (Bed

How to mix the outliers (from boxplot or not) with violin plot?

The graphs. The first graph is captured from https://towardsdatascience.com/violin-plots-explained-fb1d115e023d. And the second one is created by myself. I found this requirement when I was doing my python matplotlib assignment since the professor required us to highlight the outliers on violin plot whether they existed. For the violin plot I created, there is no y values, or in other words, the

Creating multiple plots with for loop?

I have a dictionary of dataframes where the key is the name of each dataframe and the value is the dataframe itself. I am looking to iterate through the dictionary and quickly plot the top 10 rows in each dataframe. Each dataframe would have its own plot. I’ve attempted this with the following: This works, but only returns a plot

Add diagonal line to hist2d with matplotlib

I am analyzing the heights/widths of some ML label boxes by creating a 2D histogram with matplotlib: But I want to add a semi-transparent diagonal line from (0,0) to (0.1,0.1)–the line indicating a square label box–to emphasize how the majority of the aspect ratios tend towards the tall and narrow. I’ve tried adding this line both before the hist2d() call

Shrink/adjust the colorbar inside the plot

I am trying to shrink a colorbar, which is positioned inside the plot. When I position it outside of the plot (i. e. pad=0.05), it works just fine. Here’s a MWE: I have tried both shrink and fraction but none of them seem to do the trick. I am attaching the output. Any help is greatly appreciated! Answer Your basic

Advertisement