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.

Filter by
Sorted by
Tagged with
18
votes
4answers
2k views

Exclude data from a list

Let's create some random sample data data = Table[{RandomReal[{-10, 10}], RandomReal[{-10, 10}]}, {i, 1, 300}]; Then we plot them using ...
27
votes
2answers
1k views

Filling Space with Pursuit Polygons

I want to make a program which can fill a 2D space with "pursuit polygons". The following picture will help you understand better what I mean. You can also look up "pursuit curves" or mice problem or ...
18
votes
2answers
3k views

How can I draw a 3D cross-section of a 3-torus embedded in 4D Euclidean space?

I have a $3$-torus ($\mathbf S^1\times\mathbf S^1\times \mathbf S^1$) embedded in 4D Euclidean space. How can I draw the cross-section of this $3$-torus cut by a 3D Euclidean space in an arbitrary ...
13
votes
2answers
2k views

How to position text labels automatically to not overlap other graphics elements?

I was plotting reciprocal frame projection using Locators for a point to be expressed in terms of both the original basis (also specified with ...
26
votes
1answer
882 views

On drilling holes with minimal redundancy (and with colors!)

The old Mathematica package Graphics`Shapes` featured the function PerforatePolygons[], which drilled a hole in any ...
24
votes
2answers
3k views

Generating convex polyhedron from face planes?

Suppose I have lists of normals and points for planes. There's a convex polyhedron whose faces lie on these planes and are bounded by plane intersections. What would be the easiest way to produce an ...
13
votes
6answers
2k views

can the color in MeshStyle be specified by a ColorFunction, such as “SunsetColors” for example. If so, what is the correct syntax?

This is an example given in Help: Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, MeshStyle -> Gray] Could this be changed to something like ...
20
votes
3answers
1k views

How can I create a 3D FilledCurve object?

FilledCurve can create a 2D graphics object; for example: ...
19
votes
4answers
8k views

Reflect a Plot Object

I have a relatively simple operation I'd like to perform on a plot: I would like to reflect the plot across the x-axis. I do not have any tick labels, so making sure that the labels are not themselves ...
8
votes
4answers
1k views

Drawing a trihexagonal tiling

I am trying to draw a trihexagonal tiling of the following form using Mathematica. I attempted to begin by using the result given in this Stack Overflow Q & A. However, I couldn't figure out how ...
20
votes
5answers
2k views

How can I replace bi-directional DirectedEdge pairs in a Graph with a single UndirectedEdge?

The Cayley graphs produced by Mathematica 8.0's CayleyGraph function represent actions that are their own inverses in an unconventional way: rather than using a ...
13
votes
3answers
2k views

What does the AspectRatio option actually do?

The Documentation for AspectRatio on its first line under the "Details" section states: "AspectRatio determines the scaling for ...
21
votes
3answers
632 views

Is there a better way to repeatedly add elements to a Graphics(Box)?

Consider simple example where a set of points is generated and some are displayed. ...
19
votes
2answers
2k views

How can I change the default font used in ALL plots and legends in Mathematica?

Forgive me, but I cannot for the life of me figure out how to do this no matter how much I research. I really want to change the default font for all graphics, such as ArrayPlot, ContourPlot, ...
17
votes
2answers
2k views

Interpolation on a regular square grid spanning a triangular domain

Bug introduced in 10.0 and fixed in 10.1 Context I am trying to identify contours of a function which is sampled on a cartesian grid within an irregular (triangular) region. Here is the data ...
17
votes
2answers
1k views

Bouncy Bubbles animation

I want to make a bouncing bubbles animation, looking like this. Here is a start: ...
13
votes
6answers
1k views

Overlapping Red and Green ArrayPlots to show yellow intersections

Let's say I have two ArrayPlot[]s. One is in redscale and the other is in greenscale, such that the lowest value is white and the highest value is pure red or green....
10
votes
4answers
2k views

Obtaining better quality in ListPlot

I have a data file which can be downloaded from here. In order to plot this, I use the following Mathematica code ...
8
votes
1answer
5k views

ImageSize as absolute (metric) value

I have wondered more and more often lately how the size of an image is handled when displayed or exported. The documentation implies that the via ImageSize the ...
11
votes
2answers
374 views

How can I plot my financial indicator below a trading chart (produced by TradingChart) with the same x-axis?

Since this question was not answered, I would like to ask again with some additional information. I have a trading chart saved as chart1 as follows. ...
7
votes
2answers
370 views

Exporting an image so that the PlotRange has a fixed size in the output

I am writing a document that involves a table of plots, of an array of quantities ($f$ and $g$, say) against an array of variables ($x$ and $y$, say), and which I would like to present in the ...
3
votes
2answers
1k views

Cropping a Plot without rasterization [duplicate]

Suppose that I make a plot of $x^2$ vs. $x$: myPlot = Plot[x^2, {x, -1, 1}, Frame -> True] If I click on the plot, I see the orange handles with which I can ...
13
votes
2answers
10k views

How to insert graphics primitives into a plot?

I have a standard normal curve rendered with the following command: Plot[{1/Sqrt[2*Pi] Exp[-1/2*x^2]}, {x, -3, 3}, Filling -> Axis] It looks exactly as you ...
12
votes
4answers
2k views

Height-dependent filling color in 3D Data Plots

I would like to have the filling of my ListPlot3D display the same color than the one applied to the data. This question makes sense only in the case of conditional ...
15
votes
5answers
1k views

How can I generate and randomly assign color to annular sectors?

How can I generate such an image and fill every annular sector with a random colour?
11
votes
3answers
1k views

Distorted graphics when using custom ticks and AspectRatio -> Full

Bug introduced in 7.0.1 or earlier and persists through 12.0 I am having a problem using custom tick specifications along with AspectRatio -> Full. The problem ...
8
votes
1answer
519 views

Preventing cell height adjustment when rotating 3D graphics

I have a large dataset of scattered x,y,z coordinates. I am trying to use ListPointPlot3D to identify outliers in 3D. This involves generating a plot and then ...
7
votes
1answer
3k views

Hatched bars and bar-specific background in BarChart

I would like to diagonally hatch the bars in BarChart and to have three different background colors for the different bars, like this: Any ideas how to ...
14
votes
4answers
2k views

What does DisplayFunction->Identity do to graphics functions?

Does DisplayFunction->Identity do anything at all in Mathematica 8? In the third edition of Programming in Mathematica, Roman Maeder gives the following ...
13
votes
1answer
1k views

How can I display a multigraph with different colored edges?

I'm new to Mathematica(version 9) and I'm trying to display a multigraph with different colored edges. Here's my code so far: ...
11
votes
4answers
523 views

BarLegend can't make spaced contours when contours number>11

According to Document of BarLegend,BarLegend will select equally spaced contours: BarLegend[cf,contours] generates a legend that identifies color ranges from the color function cf based on the ...
9
votes
1answer
731 views

Antialiasing of horizontal lines

Consider the following graphic: g = Graphics[{Circle[], Table[Line[{{-1, i}, {1, i}}], {i, -1, 1, 0.2}]}, ImageSize -> 150] (You may need to look directly at ...
7
votes
2answers
2k views

How to insert guide-lines in graphics without specifying range?

Is it possible to insert guide lines in Graphics - for example a horizontal line through y=0 coordinate without specifying the range of the line? Originally I assumed Infinity might do the trick: <...
5
votes
1answer
2k views

ListPlot3D - How to make the Color depending on a second list

From a simulation (solid state physcis) i obtained a list1={{300,0,0},...} with x values=300,400,...,1500 and y-values=0,0.08,...,20 and z values. I plotted them ...
5
votes
2answers
903 views

Draw a partial line in Animate

I have a list of points that my line must go through, all at varying distances from one another. I'd like to draw just a piece of this line in an Animate, where the various segments are traversed at ...
14
votes
1answer
585 views

Why does GridLines option fail with Function?

Bug introduced in 10.0.0 and fixed in 10.0.1 The Plot option GridLines can be specified either as a list of explicit values at ...
12
votes
1answer
850 views

How to make PlotMarkers constructed from Graphics track plot style?

In this plot the Disk[] markers are not colored according to the style of the line to which they belong: ...
12
votes
3answers
827 views

How can I highlight a moving bar in an animation of a bar chart?

I wrote the following code, but I don't know how to highlight the moving bar. ...
8
votes
3answers
914 views

Why do I get empty graph when adding 'Abs' function?

Can someone be so nice to provide some help for this particular situation? I try to plot a graph of a derivative which contains modulus. Without it the graph is drawn correctly: But when I wrap the ...
5
votes
2answers
394 views

GridLines for a coordinate system with a particular basis

Suppose that I use the vectors $(2,1)$ and $(-1,1)$ as a basis for $R^2$. ...
5
votes
2answers
3k views

X label in GraphicsColumn is cut off

I'm trying to use GraphicsColumn to plot two curves with very different ranges. for example, ...
5
votes
1answer
451 views

Strange extrapolation in ListContourPlot?

I have some Table of {x,y,z} values (energy as a function of radial and azimuthal frequencies in a galaxy if you care to know): ...
5
votes
2answers
1k views

How can I insert an EPS file exported from RegionPlot into MS Word?

I generate a figure using RegionPlot and then Export it as "EPS". When I insert this picture ...
2
votes
2answers
3k views

Extracting polynomials from a cubic spline function

I have this set of three data points and I want the natural cubic spline functions for them: dat = {{-.0247500, .5}, {.3349375, -.25}, {1.101000, 0}}; I tried: ...
2
votes
3answers
2k views

Random non-overlapping disks in a square

I've found a nice code snippet by @belisarius from this question, that I'll reproduce here for reference: ...
1
vote
1answer
3k views

Problem with transparency when I export an eps file

I have the following simple Mathematica code: ...
11
votes
1answer
3k views

How to position legends exactly where I want them?

I just noticed another plot legend question today and while user solutions to this, in particular code by @Jens, are IMO better than the built in solutions, exact positioning often still requires some ...
8
votes
3answers
277 views

Graphics in Notebook Different from Graphics Expression?

Consider the expression TreeForm[a+b^2+c^3+d] which displays as This is a nice Graphics object, as I can prove by typing ...
7
votes
1answer
1k views

Adding graphics primitives to log plots [duplicate]

I am making ListLogLog plots with polygons in the Prolog and lines in the Epilog, and I want ...
5
votes
2answers
1k views

Adding dynamic graphics to an animation

I'm making this demonstration that draws a parametric plot of the unit circle, while at the same time has two plots off to the side that draw the sine and cosine curves. I have this made up as an ...

1
3 4
5
6 7
23