Questions tagged [graphics]

Questions on the construction of 2D and 3D graphics through the direct use of primitives, directives, and functions. Include the graphics3d tag for questions specifically on 3D graphics. This tag is not to be used for basic questions on visualizing functions and lists using the various flavors of Plot commands.

Graphics relates to the construction of plots, diagrams, charts and other visualizations at a level beyond the use of visualization functions such as Plot, ListPlot, Plot3D, etc, mostly by using the functions Graphics and GraphicsComplex.

Questions solely about visualization functions (of datasets or functions) and their options should use .

Questions about creating visualizations using a mixture of visualization functions and additional elements may use both and .

Questions specifically about 3D graphics should also use the tag for easy archiving and searching. To exclude 3D graphics questions search for [graphics]-[graphics3d].


Some general questions that are frequently asked:

4819 questions
39
votes
1 answer

How can all those tiny polygons generated by RegionPlot be joined into a single FilledCurve?

RegionPlot will usually generate a large number of tiny polygons for filling the region: RegionPlot[-1 < x < 1 && -1 < y < 1 && x^2 + y^2 > 4/5, {x, -1.2, 1.2}, {y, -1.2, 1.2}, Mesh -> All] When exported to PDF, these are often not very fast to…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
38
votes
4 answers

How do I add arrowheads to circular arcs?

I have figures containing several arcs showing the extend of angular measures, and would like to indicate the directions in which angles are measured with arrowheads. How do I add an arrowhead at the "ends" of these arcs? (The "arrowheads" panel in…
orome
  • 12,819
  • 3
  • 52
  • 100
34
votes
1 answer

Make a map of squares

I'm trying to use Mathematica to make a map similar to the one here i.e. a US map where each state is represented by a square of a given size, located as close as possible to its true geographical position while not overlapping with other squares.…
F'x
  • 10,817
  • 3
  • 52
  • 92
30
votes
5 answers

Creating new graphics primitive (EdgeForm, FaceForm)

My question is strongly related to this question, nevertheless I would like to bring it to everyone's attention. Let's say I want to create a new graphics primitive Boing which should look like this Boing[] := Polygon[Join[#1, Reverse[#2]] & @@@ …
halirutan
  • 112,764
  • 7
  • 263
  • 474
28
votes
7 answers

How to draw all paths from (1,1) to (n,n) by move (+1, 0) or (0, +1)?

Now I can draw some grid: But what I want(I'm sorry for the weird line. I have no image processing software in my mac...): Please notice: f(1, 1) = f(2, 1) = f(3, 1) = 1 f(1, 1) = f(1, 2) = f(1, 3) = 1 f(2, 2) = f(1, 2) + f(2, 1) = 2 f(3, 3) =…
Sayakiss
  • 859
  • 7
  • 13
27
votes
1 answer

Programmatically combine 2D contour plots with 1D projections

I regularly need to plot 2D and 1D data together. I want to be able to show a 2D contour plot with the projections along each of the axes. As it is now, I create the three plots separately and use Inkscape to combine them. The problem with this…
Jason B.
  • 68,381
  • 3
  • 139
  • 286
26
votes
4 answers

How to draw cylinders inside a cube

I want to create the following graphic (ignore the unit vectors). What I do is the following (not the most elegent and smart way I guess:-)!): 1) Use the code below to generate randomly distributed but not intersecting circles (I adopt the code from…
Dimitris
  • 4,794
  • 22
  • 50
25
votes
9 answers

How do you draw the plane on which two vectors lie?

Given two arbitrary vectors $\textbf{v}_1$ and $\textbf{v}_2$, how can I draw the plane which they span?
BeauGeste
  • 2,815
  • 2
  • 29
  • 32
24
votes
4 answers

How can I specify the arrowhead size in printers points?

Is there any way to specify the size of an arrowhead in printer's points? I'm looking for something that would have similar functionality to AbsolutePointSize, AbsoluteThickness, or AbsoluteDashing, except for Arrowheads. The best I have come up…
Jim Belk
  • 547
  • 3
  • 11
24
votes
1 answer

Is there an equivalent of FullGraphics for Graphics3D?

For 2D graphics, there exists the function FullGraphics to turn the stuff Mathematica generates automatically on Graphics (like axes) into explicit graphics primitives. However that function doesn't work on Graphics3D objects. So is there some…
celtschk
  • 19,133
  • 1
  • 51
  • 106
22
votes
3 answers

2D Visualization of links and knots

I am trying to draw a picture using Mathematica of three loops linking together in 3D as follows. Module[{r = 0.03, col1, col2, col3}, {col1, col2, col3} = ColorData["HTML"] /@ {"Firebrick", "ForestGreen", "RoyalBlue"}; Graphics3D[{{{{col2, …
Everett You
  • 2,277
  • 1
  • 17
  • 19
22
votes
4 answers

Subplots with connector lines

I am looking for advice from people who have more experience in this area on what is the best (simplest, least effort) way to create a graphic like the following: This is a rough mockup made in a drawing program. There is a central graph,…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
21
votes
1 answer

Drawing Rotated views while ignoring the Bounding box

I am trying to make an animation of a rotating cube using the following code: cube = GraphicsComplex[ {{0, 0, 0}, {0, 0, 1}, {0, 1, 0}, {0, 1, 1}, {1, 0, 0}, {1, 0, 1}, {1, 1, 0}, {1, 1, 1}}, Polygon[{{1, 2, 4, 3}, {5, 6, 8, 7}, {1, 2, 6, 5}, {3, 4,…
robjohn
  • 1,071
  • 8
  • 18
21
votes
3 answers

How can I create a 3D FilledCurve object?

FilledCurve can create a 2D graphics object; for example: a = {{-1, 0}, {0, 1}, {1, 0}}; b = {{0, -(2/3)}}; Graphics[FilledCurve[{{BezierCurve[2 a], Line[2 b]}, {BezierCurve[a], Line[b]}}]] How can I put a Graphics3D object like this on a plane,…
xslittlegrass
  • 27,549
  • 9
  • 97
  • 186
20
votes
4 answers

Retrieving the ImagePadding in absolute units

Consider the following graphic: g = Graphics[Circle[], Frame -> True, FrameLabel -> {"one", "two"}] Retrieving the ImagePadding by traditional means does not work: AbsoluteOptions[g, ImagePadding] (* ==> {ImagePadding -> All} *) My guess for the…
Szabolcs
  • 234,956
  • 30
  • 623
  • 1,263
1
2 3
33 34