Skip to content

Python API plotly.offline: Save Plot as SVG, "rgba" not translated correctly if using Pie Chart. #1614

Closed
@dsholes

Description

@dsholes

With Python API, I have been setting data.marker.color using an "rgba" string. When saving the plot as an SVG image using plotly.offline.plot(figure,image='svg',), the "rgba" is translated into "rgb" and "fill-opacity" as long as the figure is a bar chart or stacked bar chart, which is the preferred behavior.

However, when using a Pie chart, the SVG style "fill" for each Slice attempts to use "rgba" (i.e. it is not translated to "rgb" and "fill-opacity"). This is not an issue when viewing the SVG in the browser. However, Inkscape, GIMP (and I assume Illustrator) cannot interpret "rgba" values, and so opening the Pie chart SVG gives only black slices (i.e. the fill for each slice is "Unset").

This is not a huge issue, as users can manually set alpha using data.opacity and pass an "rgb" string to data.marker.color, producing an SVG that behaves correctly in Inkscape.

I just want to highlight the fact that the behavior is different for Bar Charts and Pie Charts.

This may be related to user's issue in plotly.js #707.

Metadata

Metadata

Assignees

Labels

bugsomething broken

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions