Message Boards Message Boards

[✓] Smooth this graph?

GROUPS:

I used a previously functioning code with slight modifications-making the range of the function correspond to a user input of M- and the graph will not come out smoothly. I was told there was some sort of syntax error involved, but I have not been able to identify it. This is the altered code and the poorly depicted graph.

POSTED BY: Rosalie Connell
Answer
3 months ago

Use PlotPoints option in ContourPlot to get smoother contours.

levelsetwithbounds1[e_, k_, M_] := Module[{k1, set1}, k1 = k; 
set1 = ContourPlot[e == k1, {x, -M, M}, {y, -M, M}, Axes -> True, Mesh -> Full, PlotPoints -> 50]; Return[set1]];
levelsetwithbounds1[x^3 - y, 30, 40]

or:

MaxRecursion option in ContourPlot to get refine the surface.

levelsetwithbounds2[e_, k_, M_] := Module[{k1, set1}, k1 = k; 
set1 = ContourPlot[e == k1, {x, -M, M}, {y, -M, M}, Axes -> True, Mesh -> Full, MaxRecursion -> 6]; Return[set1]];
levelsetwithbounds2[x^3 - y, 30, 40]

Regards,MI

POSTED BY: Mariusz Iwaniuk
Answer
3 months ago

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST

Please do not post code as images.

The rules explain how to format your code properly. If you do not format code, it may become corrupted and useless to other members. Please EDIT your posts and make sure code blocks start on a new paragraph and look framed and colored like this.

int = Integrate[1/(x^3 - 1), x];
Map[Framed, int, Infinity]

enter image description here

POSTED BY: Moderation Team
Answer
3 months ago

Group Abstract Group Abstract