Message Boards Message Boards

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

How to hide extra lines from a grid plot?

Posted 1 year ago

Hi. I tried to plot a frequence density with Mathematica 13.2. I want the square grid to be only in region {{0, 11} ; {0,7}}. But i got horizontal e vertical lines outside this area. I think threis something wrong with grid commands. All I'v done is in file Untitled-1, in Attachments. Can anybody help me, please! (It' s only a part of graph)

Plot1 = Plot[{3, 0}, {x, 0, 1}, Filling -> {1 -> {2}}, 
  FillingStyle -> {LightBlue}, 
  GridLines -> {Range[0, 11, 1/2], Range[0, 7, 1/2]}, Ticks -> None, 
  PlotRange -> {{-2, 11}, {-2, 7}}, AspectRatio -> Automatic, 
  PlotStyle -> 
   Directive[GrayLevel[0], Opacity[1], AbsoluteThickness[1.601]], 
  AxesStyle -> Arrowheads -> {Automatic}, AxesOrigin -> {0, 0}, 
  BaseStyle -> {FontFamily -> "Times New Roman", 
    FontWeight -> "Medium", FontSize -> 14}, 
  Epilog -> {{Rotate[
      Text[Style["Densiteti i frekuencës", FontSize -> 14], {-1.3, 
        3.5}], 90 Degree]}, 
    Text[Style["O", FontSize -> 14], {-0.5, -0.5}], 
    Text["Koha (min)", {5, -1}], Text["2", {1, -0.5}], 
    Text["4", {2, -0.5}], Text["12", {6, -0.5}], 
    Text["18", {9, -0.5}], Text["20", {10, -0.5}], 
    Text["4", {-0.4, 1}], Text["8", {-0.4, 2}], Text["12", {-0.5, 3}],
     Text["16", {-0.5, 4}], Text["20", {-0.5, 5}]}]
Attachments:
POSTED BY: ILIR HOXHA
2 Replies

The documentation for GridLines is not very clear. By experiment I found

GridLines -> {Range[0.5, 6], Range[0, 1.5, 1/2 ]}

Grid Lines reduced

It seems that the first parameter is the position, the next the number of lines, the third the distance.

By the way: In the "Image add" , Ctrl+G , window there is a "(or drag and drop)" but by no means I get an image implanted except by saving and loading it via file path. (Windows). Is there a trick?, Pasting an image by Ctrl +V, saved to clipboard, into the adress image works at stackexchange.

Regards Roland Franzius

POSTED BY: Roland Franzius
(*Ticks->Automatic, GridLines->Automatic, moved -0.5 to -1*)
Plot1 = Plot[{3, 0}, {x, 0, 1}, Filling -> {1 -> {2}}, 
  FillingStyle -> {LightBlue}, Ticks->Automatic,
  GridLines ->Automatic,  
  PlotRange -> {{-2, 11}, {-2, 7}}, AspectRatio -> Automatic, 
  PlotStyle -> 
   Directive[GrayLevel[0], Opacity[1], AbsoluteThickness[1.601]], 
  AxesStyle -> Arrowheads -> {Automatic}, AxesOrigin -> {0, 0}, 
  BaseStyle -> {FontFamily -> "Times New Roman", 
    FontWeight -> "Medium", FontSize -> 14}, 
  Epilog -> {{Rotate[
      Text[Style["Densiteti i frekuencës", FontSize -> 14], {-1.3, 
        3.5}], 90 Degree]}, 
    Text[Style["O", FontSize -> 14], {-0.5, -1}], 
    Text["Koha (min)", {5, -1}], Text["2", {1, -1}], 
    Text["4", {2, -1}], Text["12", {6, -1}], 
    Text["18", {9, -1}], Text["20", {10, -1}], 
    Text["4", {-1, 1}], Text["8", {-1, 2}], Text["12", {-1, 3}],
     Text["16", {-1, 4}], Text["20", {-1, -1}]}]
POSTED BY: Jalesh Dikshit
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