Skip to content

[BUG] export_svg shifting x-axis upward and overlapping with ticks in Bokeh v1.4 #9551

Description

@magruca

I'm working in bokeh v1.4 on Fedora29 and have been running into an issue that I hadn't seen before in export_svgs where the x-axis labels are getting shifted over the x-axis itself making it messy/illegible. This problem is not replicated in either show(p) or save_svg (I've attached an example of both the svg and png to demonstrate the problem -- both saved/imported here as pngs, but the file from the svg export is labeled as such). For some reason, this is worse in other plots (attached an example from my data -- I can provide more example code but I can't provide the data necessary to reproduce it).

Here's some example code for a couple of the provided plots:

from bokeh.plotting import figure, show
from bokeh.sampledata.iris import flowers
from bokeh.transform import factor_cmap, factor_mark

SPECIES = ['setosa', 'versicolor', 'virginica']
MARKERS = ['hex', 'circle_x', 'triangle']

p = figure(title = "Iris Morphology")
p.xaxis.axis_label = 'Petal Length'
p.yaxis.axis_label = 'Sepal Width'

p.scatter("petal_length", "sepal_width", source=flowers, legend_field="species", fill_alpha=0.4, size=12,
          marker=factor_mark('species', MARKERS, SPECIES),
          color=factor_cmap('species', 'Category10_3', SPECIES))

p.output_backend = "svg"
export_svgs(p, filename = 'test_scatter.svg')
export_png(p, filename = 'test_scatter.png')

test_scatter
test_scatter_svg
svg_export_example

Thanks a bunch for any help!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions