Skip to main content

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
152 votes
8 answers
35k views

How to generate a random snowflake?

'Tis the season... And it's about time I posed my first question on Mathematica Stack Exchange. So, here's an holiday quest for you Graphics (and P-Chem?) gurus. What is your best code for generating ...
Peltio's user avatar
  • 5,516
149 votes
4 answers
26k views

How to create word clouds?

Word clouds are rather useless fancy and visually appealing plots, where words are plotted with different sizes according to their frequency in a corpus. Many applications exist out there (Wordle, ...
István Zachar's user avatar
146 votes
3 answers
23k views

How to manipulate 2D plots?

When it comes to visual analysis, large datasets or data with intricate internal details often makes plotting in 2D useless, as the outcome is either just a fraction of the full dataset, or no details ...
István Zachar's user avatar
140 votes
9 answers
36k views

$\LaTeX$ and Mathematica

I quite often would like to draw graphics in my $\LaTeX$ documents using Mathematica. I have encountered three problems. I would like to know if there are any workarounds to these problems I would ...
Thomas Rot's user avatar
  • 1,503
118 votes
7 answers
14k views

Generating visually pleasing circle packs

EDIT: (my conclusion and thank you note) I want to thank you all guys for this unexpected intellectual and artistic journey. Hope you had fun and enjoyed it the same as I did. I would like to ...
VividD's user avatar
  • 3,660
115 votes
6 answers
30k views

Exporting graphics to PDF - huge file

I want to draw some basic surfaces, export them to PDF and include them in a LaTeX file. I create a simple 3D graphics object, for instance with ...
Matthew Leingang's user avatar
107 votes
3 answers
16k views

Recovering data points from an image

Unfortunately, some data can only be obtained in picture form (Japanese publications anyone?). Since this cannot be worked with, it has to be converted to a dataset that can; I was wondering whether ...
David's user avatar
  • 14.9k
93 votes
4 answers
55k views

How to create a new "person curve"?

Wolfram|Alpha has a whole collection¹ of parametric curves that create images of famous people. To see them, enter WolframAlpha["person curve"] into a Mathematica ...
Simon's user avatar
  • 10.2k
91 votes
11 answers
19k views

How to make an inkblot?

How to effectively create a polygon that looks like a realistic inkblot? So far, I could come up with this (borrowing from Ed Pegg Jr.'s Rorschach demonstration): ...
István Zachar's user avatar
83 votes
4 answers
17k views

Placing a ContourPlot under a Plot3D

I would like to combine a 3-dimensional graph of a function with its 2-dimensional contour-plot underneath it in a professional way. But I have no idea how to start. I have a three of these I would ...
QuantumDot's user avatar
  • 19.7k
81 votes
7 answers
24k views

Code that generates a mandala

My little brother asked me to print original mandalas for coloring. I would like some idea on how to create them, but without color, so he can color them. examples
zeros's user avatar
  • 2,335
78 votes
3 answers
8k views

How can we make publication-quality PlotMarkers without version 10?

Suppose that for certain reasons we are not yet using Mathematica version 10, or we have a version with buggy PlotMarkers. It is well known that the default markers ...
Oleksandr R.'s user avatar
  • 23.1k
76 votes
6 answers
16k views

How can this confetti code be improved to include shadows and gravity?

Here's some confetti: ...
David's user avatar
  • 14.9k
76 votes
4 answers
9k views

An efficient circular arc primitive for Graphics3D

As many people have noted, the 2D graphics primitive Circle doesn't work in a Graphics3D environment (even in v10.0-v10.4, where ...
Sjoerd C. de Vries's user avatar
72 votes
5 answers
12k views

ListPlot: Plotting large data fast

Mathematica produces fantastic-looking graphics, but it can be slow on large data sets. Here is an example for a (random) time series: ...
Thomas's user avatar
  • 1,967
70 votes
6 answers
10k views

How can this image (optical illusion) be created with Mathematica?

I came across this image the other day: and liked the sensation of it pulsing. I was wondering if anyone would know how to create something similar with Mathematica (without the Pink Floyd Dark Side ...
Mike Honeychurch's user avatar
69 votes
4 answers
7k views

Is it possible to draw this figure using Mathematica?

The figure is See the how-to video or a speeded-up GIF. I believe it should be possible to draw this figure programmatically using some Random function, but I'm ...
AccidentalFourierTransform's user avatar
69 votes
4 answers
6k views

Point Renderings Slightly Off in Mathematica

The Mathematica code ...
Tyson Williams's user avatar
68 votes
8 answers
11k views

How to plot Venn diagrams with Mathematica?

How does one plot Venn diagrams with Mathematica? I've searched quite a bit and I've found one source at MathWorld which provides the source code for doing them. But I don't understand this code, can ...
Red Banana's user avatar
  • 5,411
68 votes
2 answers
6k views

How to make this beautiful animation

How to make an animation of following gif in Mathematica? Edit: The animation shown above was created by Charlie Deck in processing. And how to make 3D analog? I tried first few steps ...
vito's user avatar
  • 8,968
64 votes
4 answers
4k views

Speeding up this fractal-generating code

I used the code below (which is a sample from this gist containing more similar code) in my answer to my own question about Mandelbrot-like sets for functions other than the simple quadratic on Math....
Isaac's user avatar
  • 3,199
64 votes
2 answers
45k views

Cutting bagels into linked halves

I recently came across this video: Mathematically correct breakfast, which shows how a bagel can be neatly sliced into two identical linked halves. I'd like to try this with Mathematica. Here's a ...
rm -rf's user avatar
  • 88.9k
63 votes
9 answers
5k views

Animating mathematica.se logo

As we all know our site's logo was completely generated by Mathematica. I suppose it is quite natural to make the next step -- to generate the animated version of this logo. There's a lot of space for ...
faleichik's user avatar
  • 12.7k
62 votes
3 answers
4k views

How can I add drop shadows and specular highlights to 2D graphics?

I thought I'd share some code in the form of a self-answered question, but other answers are of course welcome. Drop shadows are a familiar visual effect, giving the impression of a graphical element ...
Simon Woods's user avatar
  • 85.1k
62 votes
1 answer
3k views

Implementing a first person view of 3D objects in a scene

I've created the following scene with a Chinese-style building surrounded by trees, and a horse and a rabbit grazing on the grass in Mathematica (don't ask me why there's a bust of Beethoven in there.....
rm -rf's user avatar
  • 88.9k
60 votes
3 answers
11k views

How to make the digits of π go around in a spiral like this?

Here is a start. MapIndexed[Text[Reverse[First[RealDigits[Pi,10,252]]][[Tr@#2]],#]&, Table[{t Cos[t],t Sin[t]},{t,0,16Pi,0.2}]]//Graphics
matrix42's user avatar
  • 7,138
58 votes
5 answers
12k views

How can I extract data points from a black and white image?

Consider the following graph (source): Is there any way to extract the data points from this image in a semi-automatic way? I have seen, and tried the methods suggested in this question, but they did ...
Eli Lansey's user avatar
  • 7,519
56 votes
5 answers
6k views

Creating ghost trail effects

Does anyone know how to create a ghost trail effect? For a simple example look at this screenshot: You can find the actual animation here. What I would ultimately like to see it happen is to make the ...
jmlopez's user avatar
  • 6,490
56 votes
8 answers
10k views

How to plot ternary density plots?

How can I get a ternary density plot just like the plots from OriginLab? ContourPlot and DensityPlot seemingly can accept the <...
Scott Wang's user avatar
55 votes
1 answer
27k views

How can I draw a Homer with epicycloids? [duplicate]

You may have seen this video: https://www.youtube.com/watch?v=QVuU2YCwHjw. How does this work, and how to do it with Mathematica?
anderstood's user avatar
  • 14.3k
53 votes
4 answers
5k views

Mollweide maps in Mathematica

Update The integration of Healpix into mathematica is now available. Context In my field of research, many people use the following package: healpix (for Hierarchical Equal Area isoLatitude ...
chris's user avatar
  • 23k
52 votes
7 answers
4k views

Character edge finding

The following line of code finds the edge of a character: ...
Sjoerd C. de Vries's user avatar
51 votes
1 answer
2k views

Constructing election cartograms?

I found this pretty neat page showing cartograms for the US elections and I don't really know how to get started doing these graphics in Mathematica. For those who don't know, a cartogram is a map in ...
JohnD's user avatar
  • 3,321
49 votes
7 answers
10k views

Intersecting graphics

Does the Mathematica graphics system have any concept of intersecting graphics? I've not found much in the documents so far. For example, if I want to show the intersection of two shapes: ...
cormullion's user avatar
  • 24.3k
49 votes
6 answers
9k views

Filling a polygon with a pattern of insets

I am trying to fill a shape with diagonal lines. I am aware of Texture, but it rasterizes the fill pattern, which is not desirable. Here was my crack at it: ...
Guillochon's user avatar
  • 6,137
49 votes
3 answers
3k views

Generating stippled (Penrose-style) drawings of surfaces

In The Road to Reality there are plots of surfaces that use a variable density of dots to suggest curvature. You can see some examples here and here. I suppose they've been drawn by Penrose, but to ...
JOwen's user avatar
  • 1,257
48 votes
7 answers
6k views

Extruding along a path

I'm trying to render a 3D image of a path by extruding a circular cross-section along the path, to create a "snake-like" path. Here is an image I found to illustrate: I can't seem to figure out if ...
s0rce's user avatar
  • 9,652
48 votes
5 answers
14k views

ListPlot with each point a different color and a legend bar

I would like to generate a ListPlot with the color for each point in the plot corresponding to a particular value (not associated with the position in the plot). I'...
Cassini's user avatar
  • 5,606
48 votes
8 answers
15k views

Sizing cells in a GraphicsGrid/GraphicsRow

I would like to add a colour bar to a plot. I tried to use GraphicsRow for this. In a GraphicsRow, each item is given the same ...
Szabolcs's user avatar
  • 236k
48 votes
3 answers
1k views

Is FullGraphics an abandoned function? Is there an alternative?

FullGraphics hasn't worked entirely for a long time and the situation appears to be getting worse instead of better. In Mathematica 10.0, 10.1, 11.3, 12.3 up to 13....
Mr.Wizard's user avatar
  • 272k
48 votes
1 answer
2k views

How to construct a treemap using non-rectangles?

I've written the standard version of a tree map (a graphic that shows nested data) and I'm looking to improve on this layout by switching to different types of polygons or perhaps circles. Can anyone ...
M.R.'s user avatar
  • 31.6k
47 votes
7 answers
18k views

How can I draw the Olympic rings with Mathematica?

How can I draw the 5 interlocking Olympic rings with Mathematica? (SVG version) Edit Hard choice, but some pretty cool answers here. I didn't have 3D answers in mind when I posted the question, but ...
Mike Honeychurch's user avatar
47 votes
3 answers
4k views

Smooth Peter de Jong attractor

Today I was playing with Peter de Jong attractor. At the bottom of the page I've linked there are beautiful examples like: My attempts are not so great: It is around 10^5 points. For more than 5*10^...
Kuba's user avatar
  • 137k
47 votes
5 answers
4k views

Rotating an image along a Möbius strip?

I am trying to make a GIF which will be a rotating Möbius strip, with some text printed along its (one!) side. I am trying to (obviously) do this in Mathematica. After some diligent searching and a ...
Steve D's user avatar
  • 2,229
46 votes
9 answers
12k views

How to draw a spring?

I am new to Mathematica and have recently been exploring graphical animations. So I was experimenting with simple concepts in periodic motion and hence wondered how can I draw a simple spring? Is ...
David McHarg's user avatar
  • 1,653
46 votes
2 answers
4k views

Aligning plot axes in a graphics object

I need to align the y-axes in the plots below. I think I'm going to have to do some rasterizing and searching for vertical lines, then vary x and ...
Chris Degnen's user avatar
46 votes
3 answers
7k views

Avoiding white lines inside filled area in RegionPlot exported as PDF or PS

Bug introduced in 8.0 or earlier and fixed in 13.2 or later When doing a RegionPlot and then exporting (or saving from the front end) as PDF or EPS, there are ...
celtschk's user avatar
  • 19.2k
45 votes
3 answers
3k views

How to Make a Sankey Diagram

I have two lists start = {{1},{1},{1},{2},{3},{1}} end = {{1},{2},{2},{3},{3},{1}} And I want to create a Sankey diagram. Which looks something like So, ...
Tomi's user avatar
  • 4,496
44 votes
2 answers
5k views

Animating a Voronoi Diagram

edit: Excellent answers have been provided and I made an animation which is suitable for my use, however, all the examples rely on bitmap/rasterized data; is there a vector based approach? I would ...
s0rce's user avatar
  • 9,652
44 votes
4 answers
6k views

How to translate interactive graphics from Mathematica to standard HTML+SVG?

I have a simple interactive plot in Mathematica, with controls for various parameters. The point of the plot is simply that users can explore how the plot changes as the parameters change by ...
kjo's user avatar
  • 11.7k

1
2 3 4 5
98