Posts

Showing posts from September 24, 2018

Making a contour plot constrained to a circle sector look like a polar plot

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite I have a contour plot which is a sector of a circle. In the standard form, it is plotted in a framed box (cartesian coordinate). But I want to plot it in a polar coordinate frame. I mean I want to have a grid line in the x-direction and a grid curve for angle part. Here is my code ClearAll["Global`*"]; ContourPlot[Cos[x] + Cos[y], x, 0, 4, y, 0, 4, PlotLegends -> Automatic, RegionFunction -> Function[x, y, 0.01 <= Sqrt[x^2 + y^2] <= 4 && 0. <=ArcTan[x, y] <= [Pi]/3], ImageSize -> Large] which plots but I want to have or How can I do that? plotting ticks share | improve this question edited 40 mins ago asked 1 hour ago Hadi Sobhani 135 6 add a comment  |  up vote 1 down vote favorite I have a contour plot which is a sector of a circle. In the standard form, it is plotted in a framed box (cartesian coordinate). Bu

simplifying foreach to repeat a drawing

Image
Clash Royale CLAN TAG #URR8PPP up vote 1 down vote favorite I use the following code to repeat a drawing. Can it be simplified. documentclassbeamer setbeamertemplatenavigation symbols usepackagetikz begindocument beginframe[fragile,t] frametitle begintikzpicture foreach x in 0,.25,.5,.75,1,...,5 draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5]; endtikzpicture vspace -.18cm begintikzpicture foreach x in 0,.25,.5,.75,1,...,5 draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5]; foreach x in .75,1,1.25,1.5,1.75,2,2.25,2.5,2.75,3,3.25,3.5,3.75,4,4.25 draw<2-4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6]; endtikzpicture vspace -.18cm begintikzpicture foreach x in 0,.25,.5,.75,1,...,5 draw (x,0) node [circle, draw, brown, fill=yellow, scale=0.5]; foreach x in .75 draw<2,4> (x,0) node [circle, draw, very thick, green!40!black, fill=green, scale=0.6]; foreach x in 4.25 draw<2,3> (x,0) node [circle