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.
4,999 questions
1
vote
0
answers
19
views
How can I correctly render hidden lines in a 3D graphic as dashed lines and visible lines as solid lines?
When working on 3D plots, I’d like to implement a feature where visible edges are drawn as solid lines and obscured (hidden) edges are drawn as dashed lines. I haven’t found a good solution to this ...
0
votes
1
answer
95
views
HowTo vertically center node labels in Graph output
Version: "14.3.0 for Linux x86 (64-bit) (July 8, 2025)"
The code listed below using the data following it produces the result shown in the image. I want the node labels positioned directly ...
1
vote
2
answers
341
views
Creating a spiral
This is both a math question and a Mathematica question. I am trying to draw a simple spiral, and found this diagram that fits what I am trying to create.
Implementing the math, using Mathematica, I'...
1
vote
3
answers
420
views
How to change the color of the individual squares on a chessboard?
The code I have written to create a chessboard is as follows:
...
4
votes
1
answer
185
views
Blurry AxisObject
I am trying to imitate default frame of ContourPlot with AxisObject. I used AbsoluteOptions ...
1
vote
0
answers
69
views
How to simply change filled-in marker with empty circles in the given code?
I use this code
p1 = Graphics[{PointSize[0.05], Red, Point[{{4, 0}, {7, 0}}]}];
p2 = Plot[Sin[x], {x, 0, 10}, PlotRange -> {-2, 2}];
Show[{p1, p2}]
which gives ...
1
vote
1
answer
97
views
How to make a Framed PlotLabel span the exact width of the plot Frame?
I am trying to add a title with a background color to my plot. Currently, using Framed inside PlotLabel only creates a box around the text itself.
I want the background box of the title to:
Span the ...
4
votes
1
answer
152
views
Cut a thick arc (sector of annulus)
I have a thick arc (or it can be represented as sector of annulus), just a very simple example:
...
2
votes
3
answers
195
views
Styling collection of polygons in single Polygon differently [closed]
In documentation of Polygon we can read:
Polygon[{poly_1,poly_2,…}] represents a collection of polygons poly_i.
But then there is no example how to style each ...
0
votes
1
answer
82
views
ParametricNDSolveValue Doesn't Work
I am plotting particle trajectory using ParametricNDSolveValue, but it gives error. Any help is highly appreciated.
...
4
votes
0
answers
186
views
Make graphics units exactly 1 cm in exported PNG/PDF to match LaTeX TikZ picture coordinates
Bug introduced in 14.3 or earlier.
Question has been amended — see below
How can I make a plot, such as from the following, so that the spacing of the points x = 1, 2, 3 on the x-axis and y = 1, 2, 3,...
1
vote
1
answer
109
views
How to make edges of a graph longer in 13.3, so that long edge labels are always readable?
In Mathematica 13.3, is there a robust way to force longer edges so that long edge labels are always readable and not clipped/overlapped? As far as I could see, options for edge spacing in "...
4
votes
1
answer
161
views
Find all cases of shortest curve on 3D surface
There are cases when there exist several different shortest curves with exactly the same length.
Do you have a better idea than mine which is adding obstacles to first found curve so that algorithm is ...
2
votes
2
answers
182
views
How to plot a very large bracket but keep it thin in Graphics?
Text[Style["}", 230, FontWeight -> "Thin"], {0, 0}] in Graphics gives me a large bracket, but it is toooo thick. How can I get a thin bracket ...
3
votes
1
answer
140
views
Automatic tooltips of ContourPlot are miraculously fast and selective in Show
How is this possible that tooltips of Show (inherited from ContourPlot) are that perfectly selective that they are displayed ...
3
votes
3
answers
826
views
Drawing a matrix of billiard balls
I would like Mathematica to produce for me a matrix $M$, where the entry $M_{ij}$ is a coloured disk with a black numeral in it, representing a billiard ball.
Basically, I want a simplified example ...
1
vote
0
answers
85
views
Manually programming parula colormap for family of curves [duplicate]
In an attempt to graphically present my research, I wish to plot families of curves in the xy plane. The curves depend on a parameter, p, that ranges from 0 to some positive constant, k. I want to ...
3
votes
3
answers
243
views
Versatile way to show points array
I often work with point processes and need simple graphical representation of points.
Processes are investigated in all three dimensions, so arrays of points look like that:
...
4
votes
1
answer
197
views
Texture applied with ugly artifacts
High quality texture image was produced from matrix mat of dimension 640x640.
When the texture is applied to a polygon (square) ...
6
votes
2
answers
377
views
Manual manipulation of graphs
I have just discovered that it is possible to manipulate vertices or edges of graphs if they are converted to Graphics.
After manipulation you can extract position ...
5
votes
1
answer
218
views
CircularArcThrough[points] does not return a circular arc through points
Bug introduced in 14.2 or earlier, fixed in 14.3.
...
7
votes
3
answers
467
views
(discrete) Surface parametrization in Mathematica
In Python there are very easy to use and efficient libraries for surface parametrization (for instance igl). I wonder if in Mathematica we have a ready-made implementation.
The parametrization is ...
2
votes
0
answers
146
views
How can I create a zebra stripe pattern? [closed]
This picture is from the public domain but does not quite look so real...
I assume that there is a 'decently simple' and known solution but I have not found a good approach by internet research.
...
1
vote
1
answer
141
views
Adding texts to an image
Suppose I have a PNG image
img=Import["......\\img.png"];
I want a function addtext which will do this:
...
1
vote
0
answers
48
views
VertexColors works strange in Polygon: how to make Polygon with not monotonic color? [duplicate]
Graphics[ Polygon[l = {{-1, 0}, {1, 0}, {1, 0.5}, {1, 1}, {-1, 1}, {-1, 0.5}}, VertexColors -> (Blend[{Green, Red}, #[[2]]] & /@ (l))]] gives me this:
Good,...
3
votes
1
answer
202
views
Making an illustrative image of Poincare section using Mathematica
I am trying to redraw this illustration for the Poincaré section using Mathematica:
For which I used this code as a start:
...
0
votes
2
answers
175
views
How to include this broken axis symbol while keeping PlotRangeClipping?
I'm trying to use the idea in this answer to make a plot that has a "discontinuous break" symbol on one of the axes. The trouble is that my plot has a frame and no ...
6
votes
1
answer
741
views
Animated line to trick the eye into seeing 'flow'
I would like to create a 2d Graphic[] representing time-dependent flow direction in a network of 'pipes'. Commercial applications use 'animated' dashed lines where ...
0
votes
0
answers
111
views
How to plot multiple figures in one figure
I am trying to produce certain figures for a report that I am writing. Below, I put a previously produced image against which I am benchmarking tic marks and fonts etc of all the images of the report:
...
2
votes
1
answer
165
views
Graphics: inscribed circles and points of intersections
I have the programm which is quite difficult for me and I'm trying to use it for my own purposes, to demonstrate the solution of the geomtric problem.
What should I add in this program to get the ...
0
votes
0
answers
78
views
1D vertex texture coordinates
I'm interested in using VertexTextureCoordinates in a GraphicsComplex but the behavior is unexpected so I'm looking for ...
0
votes
2
answers
136
views
How to change the point style in Graphics to a diamond or any other marker style? [duplicate]
I have a combination of ListLinePlot and Graphics. How can I change the point style in Graphics to a diamond or any other marker ...
0
votes
0
answers
80
views
Calculating distance between objects in een Graphic image (printing Laser Cutter)
I am converting a drawing into a grid of black circles. I want to send this new drawing to a laser cutter. The laser cutter should cut out all the black circles. To get ...
6
votes
1
answer
273
views
Finding General Solution for Straight-Line Films between Two Closed Shapes [duplicate]
Given two closed shapes, I want to see if there exists a 'film' between the two shapes and if one exists what they are for various solutions where the film is formed by non-intersecting straight lines ...
28
votes
4
answers
2k
views
Boids by Simon Woods: can we re-invent further efficient flocking models to forge complexity from simple rules?
It has been 12 years since @simon-woods created this fascinating animation an invented a boids model which is more efficient than typical ones. Code is extremely short an elegant:
...
0
votes
3
answers
317
views
Visualize the contour for $\oint_{|z|=2} \frac{1}{z^2+1}\,dz$ with two enclosed poles
I solved the following Integral
$$
\oint_{|z|=2} \frac{1}{z^2+1}\,dz
$$
and in my proof, I factor $z^2+1=(z-i)(z+i)$, so the function has simple poles at $z=i$ and $z=-i$, both inside the contour $ |z|...
8
votes
0
answers
225
views
A. L. Crego "Traces" video art reproduction
I saw this recent art "Traces" by A. L. Crego - check original at the link, ecause animated GIF here is low quality:
I cannot figure out what makes it look like it does. I guess we could ...
4
votes
2
answers
430
views
Reproducing the Geometric Diagram from Strang's *Introduction to Linear Algebra* in Mathematica
I'm trying to recreate a geometric figure similar to the one on the cover of Gilbert Strang’s Introduction to Linear Algebra using Mathematica.
The cover illustrates the structure of the complete ...
1
vote
0
answers
69
views
Circumvent bugous behaviour - Text representation depending on presence of HatchFilling in Show
I found and reported a likely bug (in 14.1, persisting till current 14.2.1), but since I would like to not wait until it is resolved, I would like to ask for a help circumnavigating it somehow.
...
8
votes
3
answers
777
views
Arrowheads getting reversed on Circle
I'm trying to create an animation using Graphics and Manipulate to represent a time-varying torque on a system. The idea is ...
1
vote
0
answers
82
views
Method to ensure that graphical plot labels occlude axis values? [closed]
First off, apologies for the longish code included. I figured it would be more straightforward to simply include it so that those interested could witness the behavior I'm trying to avoid, as opposed ...
4
votes
1
answer
259
views
Changing font style of MaTeX code?
I am using the MaTeX package so that symbols can have a widehat over them, e.g., $\widehat{X}$. In particular, here is the code I am using:
...
1
vote
1
answer
126
views
Local sensitivity analysis (semi-relative)
Can we generate code for semi-relative local sensitivity for an ODE mathematical model?
This is the ODE system I have:
...
15
votes
3
answers
1k
views
Create a fantasy map
I am trying to create an imaginary coastline as per here:
I am replicating the rice pattern with this (code adapted from here):
...
1
vote
2
answers
192
views
Merge the Axes of different Plots
I have 3 plots: P1, P2 and P3.
I would like to create a figure with
plot P2, of domain and codomain $[0,\frac12]\times [0,1]$, in the 1st quadrant;
plot P1 in the 2nd quadrant, with P1's abscissa $[0,...
1
vote
2
answers
248
views
Superimposing perfect circle on plot with fixed AspectRatio but automatic PlotRange
I want to superimpose a perfect circle on a plot (Plot, StreamPlot, ParametricPlot and ...
3
votes
2
answers
513
views
Pentagon[] is not a Graphics primitive?
From the help documentation "As of Version 12.0, all the functionality of the Polytopes package is built into the Wolfram System. »" I would expect that
...
3
votes
1
answer
150
views
A decimal point keep appearing after 10 when drawing log-scale ListDensityPlot legend
When I try to add a bar legend to a log-scale ListDensityPlot, a decimal point appears at the weird position.
For example,
...
4
votes
4
answers
477
views
Is there an alternative and more compact way to make the following parametric plot?
Is there a better way of plotting this?
...
4
votes
1
answer
117
views
Dealing with mouse clicks in graphics objects that are beyond machine precision?
As a fun project with my kids, I've created a small GUI that enables us to explore the mandlebrot set. The GUI works great as long as you stay within machine precision. Even though the function <...