Message Boards Message Boards

0
|
2373 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

[?] Smooth this graph?

Posted 6 years ago

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
2 Replies

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

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
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract