TransWikia.com

PointValuePlot can't generate vector figure when set ColorFunction->"Rainbow"

Mathematica Asked by ChuanNan Li on May 26, 2021

It’s amazing that 12.2’s new function PointValuePlot can’t generate vector figure when I set ColorFunction->"Rainbow". Then I save the figure as PDF, I am sure it’s not an vector figure. Is this due to my computer problem? How to solve it if I want to use ColorFunction->"Rainbow"?


Code:

PointValuePlot[
    RandomReal[{0, 1}, {100, 2}] -> RandomReal[{0, 100}, 100],
    ColorFunction -> "Rainbow",
    FrameTicks -> None,
    FrameStyle -> Thick
]

Very Thanks!


Update

Steps:

  1. Use the aforementioned code, you can get a figure, then generate a palette from this figure, you can use Alt+P+P as shortcut key.

  2. Save this palette as pdf, and observe whether it is an vector figure.

According to my experiment, this problem only occur with ColorFunction.

Example Figures:

  1. No ColorFunction
    Vector Figure

  2. With ColorFunction
    Not an Vector Figure

One Answer

This is die to VertexColors used in the output. You can see it's internal structure with my shortInputForm function:

pl = PointValuePlot[
   RandomReal[{0, 1}, {100, 2}] -> RandomReal[{0, 100}, 100], 
   ColorFunction -> "Rainbow", FrameTicks -> None, 
   FrameStyle -> Thick];

pl // shortInputForm // Short

output

One can get rid of VertexColors by applying Normal. Then the plot is exported without rasterization:

Export["PointValuePlot.pdf", pl // Normal] // SystemOpen

screenshot

This isn't a bug, but I suggest writing a suggestion for improvement about this issue to the official technical support.

Answered by Alexey Popkov on May 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP