import matplotlib.pylab as plt
import dclab
ds = dclab.new_dataset("data/example.rtdc")
kde_lin = ds.get_kde_scatter(xax="area_um", yax="deform", yscale="linear")
kde_log = ds.get_kde_scatter(xax="area_um", yax="deform", yscale="log")

ax1 = plt.subplot(121, title="KDE with linear y-scale")
sc1 = ax1.scatter(ds["area_um"], ds["deform"], c=kde_lin, marker=".")

ax2 = plt.subplot(122, title="KDE with logarithmic y-scale")
sc2 = ax2.scatter(ds["area_um"], ds["deform"], c=kde_log, marker=".")

ax1.set_ylabel(dclab.dfn.get_feature_label("deform"))
for ax in [ax1, ax2]:
    ax.set_xlabel(dclab.dfn.get_feature_label("area_um"))
    ax.set_xlim(0, 150)
    ax.set_ylim(6e-3, 3e-1)
    ax.set_yscale("log")

plt.show()