TransWikia.com

Seamless ContourPlot for a conditional function

Mathematica Asked on April 24, 2021

When I try to create a ContourPlot of a continuous conditional function, Mathematica leaves a "seam" in between the two regions demarcated by the conditional. How do I fill this seam?

fn[x_, y_] := If[x < 2, y/x^2, y/(2 x)]
ContourPlot[fn[x, y], {x, 1.5, 2.5}, {y, 0, 2}]

enter image description here

One Answer

Adding the option Exclusions -> None fixes the issue:

 ContourPlot[fn[x, y], {x, 1.5, 2.5}, {y, 0, 2}, Exclusions -> None]

enter image description here

Correct answer by kglr on April 24, 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