Skip to content

Commit b1b0c50

Browse files
committed
cleanup readme
Signed-off-by: Andrei Gherghescu <8067229+andrei-ng@users.noreply.github.com>
1 parent 98aafd7 commit b1b0c50

File tree

1 file changed

+4
-17
lines changed
  • examples/customization/consistent_static_format_export

1 file changed

+4
-17
lines changed

examples/customization/consistent_static_format_export/README.md

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,9 @@ This example demonstrates exporting a plot to SVG, PNG, and PDF using plotly.rs
44

55
This example is based on [GitHub Issue #171](https://github.com/plotly/plotly.rs/issues/171).
66

7-
8-
**Summary:**
9-
107
For consistent font rendering across browsers and export formats, always set the `font.family` property explicitly in your plot configuration. Relying on default or generic font settings can lead to differences in appearance, especially for font size and legend layout, depending on the browser or export backend.
118

12-
**Recommendation:**
13-
14-
Always set the `font.family` property (e.g., to `"Times New Roman, serif"`) for all text elements (titles, axes, legends) to ensure consistent results in all output formats.
15-
16-
## Overview
17-
18-
This example creates a line and scatter plot with custom styling, including:
19-
- Large font sizes for titles, legends, and axes
20-
- Custom legend positioning and styling
21-
- Border shapes around the plot
22-
- Export to multiple formats (PDF, SVG, PNG)
9+
The issue reported in [#171](https://github.com/plotly/plotly.rs/issues/171)is solved when the `font.family` property is set explicitly (e.g., to `"Times New Roman, serif"`) for all text elements (titles, axes, legends) which ensures consistent results in all output formats accross different browsers.
2310

2411
## Running the Example
2512

@@ -29,6 +16,6 @@ cargo run
2916
```
3017

3118
This will generate three output files:
32-
- `Data_plot.pdf` - PDF format (typically renders correctly)
33-
- `Data_plot.svg` - SVG format (may have font/legend issues)
34-
- `Data_plot.png` - PNG format (typically renders correctly)
19+
- `Data_plot.png`
20+
- `Data_plot.svg` - will render fonts differently when compared with PNG if font family not fully specified
21+
- `Data_plot.pdf` - uses SVG for PDF generation and will inherit the same issue as SVG

0 commit comments

Comments
 (0)