Tag Info

Hot answers tagged

10

Padding Without padding of any kind the over-all aspect ratio and element (primitive) aspect ratio are the same and as specified: g0 = Graphics[{Opacity[0.5, Red], Rectangle[{0, 0}, {3, 2}]}, AspectRatio -> 2/3, Background -> GrayLevel[0.8], PlotRangePadding -> 0] (There is a one pixel discrepancy along the right edge where the background ...


9

This problem can be simplified substantially by noting that only the largest ellipses contribute to the boundary of the second figure in the question. So, for instance, Table[ParametricPlot[RotationMatrix[β].{a + 5 Cos[Θ], b + 6 Sin[Θ]}, {Θ, 0, 2 Pi}, PlotRange -> {{-15, 15}, {-15, 15}}], {a, 0, 5, 1}, {b, 1, 6, 1}, {β, 0, Pi, 1}] // Flatten // ...


7

May way of thinking so far: According to the Documentation, when the third argument of Inset is Automatic, the inset will have its original size inside of enclosing graphics. Its a good start. The inset has non-zero ImagePadding (needed for the frame ticks), so some additional space must be added inside of the plot range of the enclosing graphics via ...


5

I do this all the time, but use small buttons next to the slider. This is handy when one wants to jump to specific value, and sometimes it is hard to get the slider to go there exactly without few hits and misses and one ends up opening the slider using "+" and typing in the value in the small window which is not very efficient sometimes. Here is an example ...


5

The general idea is the same as bbgodfrey's so most credits for him, the approach is slightly different, perhaps more automatic. We start by converting OP's parametric expression to cartesian: eq = #.# &@{Cos[Θ], Sin[Θ]} /. Solve[ Thread[{x, y} == RotationMatrix[β].{a + c Cos[Θ], b + d Sin[Θ]}], {Cos[Θ], Sin[Θ]} ][[1]] // Simplify ...


5

You could define $a_1,a_2$,.. as graphic primitives (Line) and use Translate: a1 = {Thickness[.01], Line[{{{0, 0}, {1, 0}}, {{1/2, -1/2}, {1/2, 1/2}}}]}; a2 = {Line[{{{0, 0}, {1, 0}}, {{1/2, -1/2}, {1/2, 1/2}}}]}; b1 = {Line[{{0, 0}, {1, 0}}], Thickness[.01], Line[{{1/2, -1/2}, {1/2, 1/2}}]}; b2 = {Line[{{1/2, -1/2}, {1/2, 1/2}}], Thickness[.01], Line[{{0, ...


4

Graphics[{PointSize[.04], Point[a = {6, 17}], Point[b = {7, 37}], InfiniteLine[{a, b}]}, Axes -> True, GridLines -> {{a[[1]], b[[1]]}, {a[[2]], b[[2]]}}, PlotRange -> {{0, 10}, {0, 40}}, AxesOrigin -> {0, 0}] From the documentation: InfiniteLine[{Subscript[p, 1],Subscript[p, 2]}] represents the infinite straight line passing ...


4

Scaled and ImageScaled coordinates are extremely useful to study the behaviors of the options for Graphics. I'll try to contribute what I can. What follows, mostly applies to Plot and similar functions. Often Graphics created explicitly with the Graphics head, such as those in Mr.Wizard's answer may behave differently, as compared to Plot. First example: ...


4

One way of doing that is create an image for each element and then use GraphicsGrid With the definition about line of @halmir a1 = {Thickness[.03], Line[{{{0, 0}, {1, 0}}, {{1/2, -1/2}, {1/2, 1/2}}}]}; a2 = {Line[{{{0, 0}, {1, 0}}, {{1/2, -1/2}, {1/2, 1/2}}}]}; b1 = {Line[{{0, 0}, {1, 0}}], Thickness[.03], Line[{{1/2, -1/2}, {1/2, 1/2}}]}; b2 = ...


4

It seems to me that there is little point in making the image size so small that the image cannot possibly have a close to accurate aspect ratio. If I also get rid of the superfluous parts outside of the plot range by setting PlotRangePadding, ImagePadding, and ImageMargins all to zero, I can use simple ImageDimensions to check aspect ratio. Doing all this ...


3

Update: The edge shape function "CurvedArc" has an option "Curvature" that controls the shape of the BezierCurve it produces. Examples: Graph[{1 -> 2, 2 -> 3, 1->3}, VertexCoordinates -> {{0, 0}, {1, 1}, {2, 2}}, VertexLabels -> Placed["Name", Center], VertexSize -> Medium, EdgeShapeFunction -> GraphElementData[{"CurvedArc", ...


3

Prolog You can use Prolog and Inset which avoids rasterizing the GeoGraphics: lena = ExampleData[{"TestImage", "Lena"}]; GeoGraphics[Polygon[Entity["Country", "Canada"]], GeoProjection -> {"Orthographic", "Centering" -> {0, -97}}, Prolog -> Inset[Image[lena, ImageSize -> 500]]] RemoveBackground RemoveBackground works on GeoGraphics; ...


3

I like the existing answers but I cannot resist posting my own formulation. I shall make use of the new-in-10.1 CirclePoints though I shall also provide an alternative without it. First Rules that specify the thickness of each radial line, counterclockwise from 3 o'clock: rls = {"a1" -> {3, 3, 3, 3}, "b1" -> {1, 3, 1, 3}, "c1" -> {1, 1, 3, 3}, ...


2

As @Mr.Wizard pointed out, multiple interesting solutions to your problem have been proposed on this site. I just wanted to add an observation here. I realize that you did not say so explicitly, but I would think that many users would try some combination of ListPointPlot3D for this kind of task. However, it has been my impression when using the *3D list ...


2

As per the comment section of the OP I assume that the image padding is a constant number of printer points, though it is not necessarily known. I use the rasterize trick to obtain the size of the plotting range in printer points: printerPointsPlotRange = (#[[2]] - #[[1]] &)@ (Rasterize[Show[#, Epilog -> ...


2

This is far from ideal and it has limitations with extreme triangles. The aesthetically pleasing images prompt me to post despite this. Perhaps others will improve. I modified David G. Stork function. The solid area is reasonable straight forward. The orange spheres delineate triangle: ae[a_, b_, c_] := Developer`PartitionMap[VectorAngle @@ # &, {a, ...


2

This appears fixed as of Mathematica 10.1.0, at least on my 32 bit Linux with NVidia Geforce GTX 750 Ti and binary driver 340.46, where the bug does reproduce with Mathematica 10.0.0.



Only top voted, non community-wiki answers of a minimum length are eligible