This message was deleted.
# help
s
This message was deleted.
f
they have a default stylesheet for text, yes
Copy code
plotSVG = Plot.plot({
  style: "font-family: 'comic sans ms';font-size: 14px;",
  height: 400,
  width: 400
})
❤️ 1
p
Nice! Thanks!
Looking at the generated SVG of from Plot there is an embedded style element
Copy code
<style>.plot-d6a7b5 {
  display: block;
  background: white;
  height: auto;
  height: intrinsic;
  max-width: 100%;
}
.plot-d6a7b5 text,
.plot-d6a7b5 tspan {
  white-space: pre;
}</style>
Is there a way of overriding this? Especially for text and tspan.
f
Copy code
fixSvg = Plot.plot({
  height: 400,
  width: 400,
  margin: 0,
  marks: [
    () => svg`<style>.annotations text {font-size: 13px}`
    ]
})
👍 1
p
Ha, found another text style on the plot SVG-element, an attribute
text-anchor
style. Overriding it in the Observable Plot style field w.
text-anchor: initial;
fixed it, the vanilla and plot SVGs look identical now! 🥳
Thanks for the help!
👍 1