Skip to content
This repository has been archived by the owner on Nov 5, 2020. It is now read-only.

Commit

Permalink
fix: use scaling when downsampling scatter plots (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Apr 10, 2019
1 parent f573815 commit 96b31ea
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
- Log-scale contour plots are now available in expert mode
(be careful when setting the contour accuracies)
- Bugfixes:
- Log-scale scatter plots did not show log-scale KDE data
- Log-scale scatter plots did not show log-scale KDE data (#231)
- Contour lines were shifted by a small amount due to an uncommon
interpretation of contour plots in chaco (contour lines are now
computed by dclab using the marching squares algorithm implemented
Expand Down
24 changes: 16 additions & 8 deletions shapeout/gui/plot_scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,22 @@ def set_scatter_data(plot, mm):
plotfilters = mm.config.copy()["plotting"]
xax = mm.config["plotting"]["axis x"].lower()
yax = mm.config["plotting"]["axis y"].lower()


scalex = mm.config["plotting"]["scale x"].lower()
scaley = mm.config["plotting"]["scale y"].lower()

x0 = mm[xax][mm.filter.all]

downsample = plotfilters["downsampling"]*plotfilters["downsample events"]

a = time.time()
lx = x0.shape[0]
x, y = mm.get_downsampled_scatter(xax=xax, yax=yax, downsample=downsample)
x, y = mm.get_downsampled_scatter(xax=xax,
yax=yax,
downsample=downsample,
xscale=scalex,
yscale=scaley,
)
if lx == x.shape:
positions = None
else:
Expand All @@ -209,14 +217,14 @@ def set_scatter_data(plot, mm):

kde_type = mm.config["plotting"]["kde"].lower()

kde_kwargs = plot_common.get_kde_kwargs(x=x,y=y, kde_type=kde_type,
xacc=mm.config["plotting"]["kde accuracy "+xax],
yacc=mm.config["plotting"]["kde accuracy "+yax])
kde_kwargs = plot_common.get_kde_kwargs(
x=x,
y=y,
kde_type=kde_type,
xacc=mm.config["plotting"]["kde accuracy "+xax],
yacc=mm.config["plotting"]["kde accuracy "+yax])

a = time.time()
scalex = mm.config["plotting"]["scale x"].lower()
scaley = mm.config["plotting"]["scale y"].lower()

density = mm.get_kde_scatter(xax=xax,
yax=yax,
positions=positions,
Expand Down

0 comments on commit 96b31ea

Please sign in to comment.