You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to add a plot, side-by-side the joyplot, showing all of the distributions on one plot. I am successful at doing that, but something is weird with the xticks. I've been looking through the code at how the xticks are set and I don't see why what is in your package would be wrong.
The problem can be seen in the figure below. It looks like the xticks are being set relative to the figure size and not the last axes instance. Would you happen to know what's going on here? Because I sure don't. Any thoughts would be appreciated.
The figure:
The code:
from scipy.stats import gaussian_kde
import numpy as np
import pandas as pd
from sklearn import datasets
import joypy
import matplotlib.gridspec as gridspec
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.colors import rgb2hex
iris = datasets.load_iris()
df=pd.DataFrame(iris.data,columns=iris.feature_names)
fig = plt.figure(dpi=300)
gs = fig.add_gridspec(nrows=4, ncols=2)
ax1 = fig.add_subplot(gs[0, 0])
ax2 = fig.add_subplot(gs[1, 0])
ax3 = fig.add_subplot(gs[2, 0])
ax4 = fig.add_subplot(gs[3, 0])
ax5 = fig.add_subplot(gs[:, 1])
axes = [ax1, ax2, ax3, ax4]
joypy.joyplot(df, ax=axes, colormap=cm.autumn_r, linewidth=0.5)
limits = ax1.get_xlim()
x = np.arange(limits[0], limits[1], 0.01)
ncols = len(df.columns)
for i, (col, vals) in enumerate(df.items()):
gkde = gaussian_kde(vals, bw_method=None)
y = gkde.evaluate(x)
ax5.plot(x, y, lw=0.5, color='k')
ax5.fill_between(x, y, color=rgb2hex(cm.autumn_r(i / ncols)))
The text was updated successfully, but these errors were encountered:
I would like to note that an alternative to this might be using subfigures, since joypy, as it stands right now, uses multiple axes within the same figure. Therefore, you can combine joypy with other graphics probably in an easier way with subfigures than trying to use gridspec.
I'd like to add a plot, side-by-side the joyplot, showing all of the distributions on one plot. I am successful at doing that, but something is weird with the xticks. I've been looking through the code at how the xticks are set and I don't see why what is in your package would be wrong.
The problem can be seen in the figure below. It looks like the xticks are being set relative to the figure size and not the last axes instance. Would you happen to know what's going on here? Because I sure don't. Any thoughts would be appreciated.
The figure:
![download](https://user-images.githubusercontent.com/13836216/126006379-5c7150de-8adf-4c2e-aca5-5d8991651e4e.png)
The code:
The text was updated successfully, but these errors were encountered: