添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
气宇轩昂的便当  ·  热点分析 | ...·  4 月前    · 
活泼的木耳  ·  Forums·  1 年前    · 
果断的水龙头  ·  Hongguang (Wuling) - ...·  1 年前    · 

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement . We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account dsshow savefig error with matplotlib pdf and svg export. Shading intensity variation in png export. #1082 dsshow savefig error with matplotlib pdf and svg export. Shading intensity variation in png export. #1082 rotheconrad opened this issue May 4, 2022 · 3 comments numpy 1.21.6

Description of expected behavior and the observed behavior

The datashader plotted points should be the same size as the ax and export well but the scale is off and changes with dpi export settings. Additionally, the shading intensity is variable for png export.

Complete, minimal, self-contained example code that reproduces the issue

import matplotlib
import matplotlib.pyplot as plt
import datashader as ds
from datashader.mpl_ext import dsshow
import pandas as pd
import numpy as np
# Fake data for testing
x = np.random.normal(size=100000)
y = x * 3 + np.random.normal(size=100000)
fig, ax = plt.subplots()
dsartist = dsshow(
                ds.Point("xs", "ys"),
                ds.count(),
                vmin=0,
                vmax=100,
                norm="linear",
                aspect="auto",
                ax=ax
plt.title('300 dpi')
fig.savefig(test_300dpi.pdf, dpi=300)
fig.savefig(test_300dpi.png, dpi=300)
fig.savefig('test_300dpi.svg', dpi=300)
plt.close()
fig, ax = plt.subplots()
dsartist = dsshow(
                ds.Point("xs", "ys"),
                ds.count(),
                vmin=0,
                vmax=100,
                norm="linear",
                aspect="auto",
                ax=ax
plt.title('default dpi')
fig.savefig(test_defaultdpi.pdf)
fig.savefig(test_defaultdpi.png)
fig.savefig('test_defaultdpi.svg')
plt.close()

Screenshots or screencasts of the bug in action