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 ...

learn more… | top users | synonyms

9
votes
1answer
614 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: ...
9
votes
2answers
1k views

Epilog->Inset crops text with large font sizes

Why does Epilog->Inset crop the first and last letters here ("a" and "g") when FontSize is set to large values (which varies ...
9
votes
2answers
1k views

How to calculate mix of 4 colors defined in CIELAB L*a*b* model?

I have 4 colors that I converted from RGB to CIELAB L*a*b* model. How can I calculate mix of these 4 colors when I have (L,a,b) for each such color? How can I ...
8
votes
6answers
794 views

How to draw symmetrical parts of a circle

Let's consider the following simple case: ...
8
votes
1answer
289 views

How to compile Heike's winding number function?

Heike gave the following function for winding number: ...
8
votes
4answers
880 views

data visualization on a lattice grid

Is it possible to visualize an array whose elements are angles as actual angles on a lattice grid? E.g., say, if the input is: ...
8
votes
1answer
401 views

Way to find color at a point in a Graphics?

I need to figure out a way to find out the RGB color value at a certain coordinate in a Graphics object. The Graphics object I am dealing with is continually Dynamically updated, so it is made of ...
7
votes
3answers
548 views

How do I plot the images of oriented curves under complex transformation?

I'm working on a complex transformation sketch that I'd like to create via mathematica. I'm working with the function $$w=z^2\tag{0},$$ where its real and imaginary parts are $u=x^2-y^2$ and $v=2xy$, ...
7
votes
3answers
482 views

Identifying when two graphic objects overlap

I'm designing a small demonstration that helps to visualize the reason behind shaping an electrode that is used to probe a surface: ...
7
votes
3answers
687 views

How to get rid of Panel margins?

I have a feeling that there is something wrong in general with Mathematica's way of dealing with margins and spaces among/around objects in Graphics, ...
6
votes
1answer
353 views

Constructing primitive cell using information from ChemicalData

I would like to construct a primitive cell (figure shown) and possibly the two-dimensional layout (figure from here) using the following input. Any clues as to how this can be done? ...
6
votes
1answer
1k views

Adding arrows in curves

Let's consider the following case ...
6
votes
2answers
532 views

Transfer graphics from Mathematica to Word without loss of quality

I want some high-quality 2D graphics produced by Mathematica in my paper. My step-by-step operation as follows: First I make the plot, for example, ...
6
votes
3answers
392 views

How to disable differential styles/markers/etc. for multiple entities?

For functions that can produce multiple "style-able" entities, Mathematica by default will give each such entity a different style. Similar conventions apply to other features, either by default, or ...
6
votes
2answers
186 views

Control which variables get embedded inside Manipulate

While trying to analyse several different datasets I got what I thought was a good idea: define a "function" that returns a Manipulate object. But this has some ...
5
votes
1answer
591 views

How to display each step of an A star algorithm?

I wrote a pathfinding program: A*, which is an extension of Dijkstra. I want to see the result of each step at a time. Which function should I use? The main program is the notebook Astar, which is ...
5
votes
1answer
161 views

How to make MousePosition more reliable

This takes a little patience to reproduce, but I got a screenshot of it in version 9 on Mac OS X 10.7.5: With a small Graphics object, it occasionally happens that ...
4
votes
4answers
349 views

How can I draw a square root spiral? [duplicate]

I found this picture on the net. How can I reproduce it in Mathematica?
4
votes
2answers
414 views

Recognize simple shapes in an image and color them randomly?

I have an image of polygons built from a polar function (see below). I'd like to color each triangle or quadrilateral a random color. Firstly, I'm not sure how to separate the simple shapes. ...
4
votes
1answer
1k views

Quality control when exporting graphics into JPG

If I export a graphics from Mathematica to JPG format the image quality in JPG is visibly lower than that in Mathematica. Is it possible to control and eventually increase the quality of the exported ...
4
votes
1answer
530 views

Exporting a Video of a Simulation of Pendulum Motion

In a series of previous questions, I asked how to solve a series of differential equations describing a series of coupled pendulums, and then how to plot this data by coloring the different pendulums. ...
4
votes
4answers
460 views

Adding Math to Plots

I have several formulas I would like to place at specific coordinates in a Graphics object I have already created. I need to be able to choose bold or not as well ...
4
votes
1answer
766 views

Removing clipping masks from exported PDFs

I usually export graphics from Mathematica as PDFs which I tweak with Adobe Illustrator. When most plots are exported from Mathematica as PDFs they contain a large number of mostly useless clipping ...
2
votes
2answers
437 views

How can I build a GraphicsGrid of arbitrary size?

This is actually a very simple scenario, in order to make simpler this question Part I. Consider the following piece of Mathematica code ...
1
vote
6answers
233 views

How to build a game board [duplicate]

I have - rather lazily - constructed a chessboard like this: ...
0
votes
1answer
278 views

How can I build a GraphicsGrid of fixed size that rearranges the empty plots?

OK, let's make one final attempt; they say the third time is the lucky one! Following @rm-rf 's suggestions, I will try to be as clear as I can. My Mathematica code reads and plots simultaneously ...
13
votes
4answers
2k views

How can I extract the maximum value from a Histogram?

In Mathematica 8.04 I've created a histogram of returns on a stock using: ...
11
votes
6answers
1k views

2D Gaussian distribution of squares coordinates

I would like to imitate the structure of this great painting from Ellsworth Kelly in Mathematica. Yet with all the colored squares in Black and the beige one in white. Below is what I have wrote to ...
10
votes
2answers
376 views

In what situation is the use of Directive required?

Sometimes I see code samples in the document or in this site using Directive, but I haven't yet find a case that Directive is ...
9
votes
1answer
293 views

PlotMarkers doesn't inherit PlotStyle when first argument to Graphics isn't a list

Could somebody explain, why Circle does not inherit the PlotStyle of the plot when used as ...
8
votes
3answers
317 views

PlotMarkers don't change colour for different lines

I have a set of data and several function operating on the same data, that I wish to plot together in a ListPlot. I need different ...
8
votes
2answers
620 views

How can automatic ticks be made “outie”?

By default, FrameTicks stick into the data area in a way that is sometimes uncomfortable. ...
7
votes
2answers
162 views

Poor/wrong sampling in 1D DiscretizeRegion of splines?

Bug introduced in 10.1 and persisting through 10.2 or later Context In relation to this question I have would like to use splines to define a ...
7
votes
4answers
389 views

Finding the point of minimum distance between two parametric functions

I have two functions re and rm, for which I computed the minimum distance between them. Now I would like to add a point at the ...
7
votes
2answers
190 views

Dynamically transform one Graphics to another

I would like to have two Graphics objects displayed side by side such that: they are mirror images of each other if I change the left-hand one interactively using ...
7
votes
2answers
4k views

Axes Origin & Labels in 3D Plot

I'm looking for a way to have the axes at the origin in a 3D plot and to label the (x,y,z) axes in the usual way---with x near the end of the drawn portion of the x axis, y near the end of the drawn ...
7
votes
2answers
529 views

Generate Random Text within a Rectangle

I would like to generate images such as the four below. That is: some text of different length fit within a Rectangle[] using ...
6
votes
2answers
154 views

Mathematica-exported PDFs placed in Illustrator documents keep disappearing

This question is regarding interoperability between Adobe Illustrator and Mathematica. Illustrator has a File → Place... function which can insert complete figures inside Illustrator documents. ...
6
votes
1answer
163 views

How to share LineLegend among sub-figures in GraphicsGrid?

Using GraphicsGrid, I have put two figures that share the same x-axis in a row. However, I failed to let them share a common ...
6
votes
2answers
206 views

“The function DiscretizeGraphics is not implemented for GraphicsComplex” confusion

Why does DiscretizeGraphics seems to work on one GraphicsComplex and not the other? Here is an example that works: ...
6
votes
5answers
2k views
6
votes
1answer
468 views

BSplineCurve Interpolation

Can I get interpolated values from this B-spline, (shown in red)? ...
5
votes
2answers
209 views

Extracting ragged array from an image

I have a list of points, which represent positions of peaks in an image. The nature of the image itself shouldn't matter, as I already have the peak positions. As a simple example, consider the ...
5
votes
2answers
303 views

How to add a graphics frame to an image without resampling

Using Inset to place an image inside a Graphics expression with Frame -> True provides a ...
5
votes
1answer
242 views

BarChart FrameLabels with only partial Frame?

This test BarChart is generated by the code that follows it: ...
5
votes
2answers
337 views

Create self-contained plots when Ticks or FrameTicks require external functions

Let's say I define tick marks for a plot in a separate function outside of the plot: ...
5
votes
4answers
570 views

Shading in squares crossed by a diagonal

You have a rectangle and it is diagonal. How many squares will be crossed by the diagonal (I guess assuming the side length of the rectangle are nice whole numbers) I've seen an implementation in ...
4
votes
1answer
105 views

AspectRatio option works unpredictably?

Let us examine the agreement between specified value for the AspectRatio option and the actual aspect ratio of generated plot. For this purpose I define a function ...
4
votes
2answers
293 views

How to plot an implicit value funtion

Previous question has been solved (Gap in a continuous plot). Here is a new related question. ...
4
votes
4answers
282 views

Conveying density of 5-smooth (Hamming) numbers

A number is 5-smooth if its only prime factors are 2, 3 or 5. Example: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, … Interesting thing is that as they become larger ...