Message Boards Message Boards

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

Set x axis at y=0 on the following plot?

Posted 5 years ago

I plotted this graph

enter image description here with this command:

Labeled[Show[
  Plot[in, {r, 0, a}, 
   Ticks -> {{{a, "a"}, {3 a, "3a"}, {5 a, "5a"}, {7 a, "7a"}, {9 a, 
       "9a"}, {12 a, "12a"}}, {0, 2.2*^-11}}, PlotRange -> All],
  Plot[out, {r, a, 12 a}], PlotRange -> All, AxesStyle -> Black, 
  AxesLabel -> {r, "Intensity"}, 
  LabelStyle -> Directive[Bold, Medium]], Style["HE11", Bold, Large]]

in is a function to be plotted between 0 to a,

and

out is a function to be plotted between a to 12a.

As you can see, the r (horizontal axis) doesn't lie with the y=0 line. How can I fix this?

Should I instruct the PlotRange option in the Show function, rather than inside the second Plot? (I tried, but no graphics was produced).

POSTED BY: Ehud Behar
2 Replies
Posted 5 years ago

Yep, that's the one.

Thanks very much.

POSTED BY: Ehud Behar
Posted 5 years ago

I can't evaluate your code on my machine (don't have the necessary data), but are you looking for AxesOrigin?

Labeled[Show[
  Plot[in, {r, 0, a}, 
   Ticks -> {{{a, "a"}, {3 a, "3a"}, {5 a, "5a"}, {7 a, "7a"}, {9 a, 
       "9a"}, {12 a, "12a"}}, {0, 2.2*^-11}}, PlotRange -> All], 
  Plot[out, {r, a, 12 a}], PlotRange -> All, AxesStyle -> Black, 
  AxesLabel -> {r, "Intensity"}, LabelStyle -> Directive[Bold, Medium],
  AxesOrigin -> {0, 0}
  ], Style["HE11", Bold, Large]]
POSTED BY: Kyle Martin
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