Message Boards Message Boards

0
|
3376 Views
|
2 Replies
|
3 Total Likes
View groups...
Share
Share this post:

How to convert negative part of a plot to zero?

Posted 2 years ago

Hi. I want to convert all negative part of the following plot to zero! Can you help me please?

POSTED BY: Reza Hamzeh
2 Replies

Hi Reza

Very strange usage of Do[ ] and Ne[ ], look at Neils post that's the right way. Keep the definition of Ne[ ] outside of any Do[ ] and Table[ ].

Alternatively to Neils suggestion you could suppress the unwanted plot region by using this Option:

RegionFunction -> Function[{x, y, z}, 0 < z]

Robert

POSTED BY: Robert Nowak

Reza,

You can use Max:

ListPlot3D[
 Table[Max[
   0, -2 Ne[Pi/4] && (\[Alpha]n^2 + \[Alpha]l^2) < 1], {\[Alpha]n, 0, 
   1, 0.01}, {\[Alpha]l, 0, 1, 0.01}], DataRange -> {{0, 1}, {0, 1}}, 
 PlotRange -> All, 
 AxesLabel -> {Style["\!\(\*SubscriptBox[\(\[Alpha]\), \(l\)]\)", 10, 
    Bold, Black], 
   Style["\!\(\*SubscriptBox[\(\[Alpha]\), \(n\)]\)", 10, Bold, 
    Black], Style["N", 10, Bold, Black]}, 
 PlotLabel -> "r=\!\(\*FractionBox[\(\[Pi]\), \(4\)]\)"]

Regards,

Neil

POSTED BY: Neil Singer
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