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

6
votes
2answers
304 views

Extruding a wierd 2D shape to make a prismatic 3D shape

I have the outline of a 2D shape defined by a periodic radius R[θ]. I would like to extrude this linearly to a prismatic 3D object that has my cross-sectional shape....
6
votes
1answer
771 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 ...
6
votes
1answer
509 views

How do I constrain the region where I can drag a Locator?

How do I constrain the region where I can drag a Locator to conform to rules, including rules that apply to computations resulting from the value of the ...
6
votes
2answers
606 views

Map of Swedish regions?

There have been some questions dealing with how to draw individual US states since such data doesn't come with Mathematica through its CountryData which offers ...
5
votes
0answers
206 views

How to fix a PDF line rendering problem in V9

If I run this in V8 ...
5
votes
1answer
691 views

How to use MathPSfrag package in Mathematica 10?

I am interested to use LaTeX like labels in the plots that I prepare in Mathematica, and hence, I downloaded the MathPSfrag package from this website http://wwwth.mpp.mpg.de/members/jgrosse/mathpsfrag/...
4
votes
2answers
166 views

How do you stack 2D graphics into a 3D graphic? [duplicate]

Suppose you have a series of 2D graphics that depend on a parameter. For example, ...
3
votes
1answer
198 views

Keeping Font Relative Size to Object/Graphics/Plot Object upon Resize

I want to keep the text generated within a graph/plot to remain the same relative to an element (a disk of size 0.2) of the image upon resize, not the image itself, while maintaining the original ...
3
votes
2answers
288 views

How can Magnify be forced to ignore the notebook's window width?

In a new notebook, I can illustrate how the action of Magnify is cut off by the window width: ...
2
votes
2answers
112 views

How to copy Coordinates of “Get Coordinates” in Figure?

I am trying to reproduce the answer here about Recovering data points from an image. I click the figure and press "Get Coordinates". I would like to copy the four coordinates by CTRL-C and then paste ...
1
vote
1answer
259 views

Basins of attraction of equilibrium points

The Henon-Heiles potential is the following V = 1/2*(x^2 + y^2) - y*(1/3*y^2 - x^2); which has four equilibrium points ...
20
votes
7answers
3k views

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?
13
votes
5answers
857 views

Animate point going around a triangle

How can I animate a point moving on a triangle's sides? I can generate a triangle and point, but I have no idea how to define point movement. I'm guessing that I have to use $\sin$ and $\cos$ in ...
12
votes
2answers
263 views

Adapting KnotDiagramData to form more visually pleasing diagram

Graphics[KnotData[{5, 1}, "KnotDiagramData"]] gives but I would like to create diagrams like this remeniscent of Celtic knot designs (which I made by adapting ...
12
votes
2answers
876 views

How to plot a barycentric line

I want to plot a barycentric function on an equilateral triangle (ternary plot). For example f1 = {Abs[Sin[x]], Mod[x, 2], Abs[Cos[x]]}; At the moment I evaluate ...
11
votes
3answers
2k views

Poor rendering of fractals

Could someone explain why I get those ugly graphics .. ..trying to use fractals in mathematica 8 ? I'd also like to know if it is possible to draw 2D fractals in Mathematica My configuration is:...
10
votes
4answers
365 views

Panning with Mouse

This is related to the question i just asked here but not the same. How could i create a manipulate that lets me move the graph to any position i want by clicking and dragging anywhere. Here is an ...
10
votes
1answer
1k views

Changing default ImageSize in the frontend?

I would like graphs to appear somewhat larger in my notebooks (running v8.0.4 on OSX 10.8.2). Naturally I can specify ImageSize in each individual plot, or drag ...
10
votes
2answers
2k 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 ...
9
votes
1answer
563 views

Generating high quality charts in Mathematica for use in LaTeX and Word

I frequently have a probelem using my charts in reports because the text (axes labels and tick marks) look low resolution (fuzzy). When I export my charts, i export them as PNG files. Unless I'm ...
9
votes
2answers
2k 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 ...
8
votes
1answer
450 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 ...
8
votes
2answers
134 views

How to force DistributionChart to plot empty datasets?

Is there any way to force DistributionChart to display anything where there is an empty dataset? In the below example I'd like to have ...
8
votes
1answer
316 views

How to compile Heike's winding number function?

Heike gave the following function for winding number: ...
8
votes
6answers
969 views

How to draw symmetrical parts of a circle

Let's consider the following simple case: ...
7
votes
5answers
3k views
7
votes
3answers
740 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
823 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, ...
7
votes
3answers
236 views

Panning by moving Origin (0,0) with Mouse

Given a 10 by 10 grid like the one below and the axis origin somewhere on the grid, I would like to be able to place the mouse pointer at the axes origin (0,0), then press and hold the mouse button ...
7
votes
1answer
251 views

Finding corresponding vertex from 3d to 2d

I have this simple 3d data points: ...
6
votes
1answer
3k views

How to draw some 2D curves in a 3D plot? [duplicate]

I want to plot several 2D curves (Sin[x] at y=0, Cos[x] at ...
6
votes
2answers
277 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
2answers
199 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 ...
6
votes
3answers
453 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 ...
5
votes
2answers
262 views

Generate random non-intersecting lines inside a square

EDIT I have the following code which generates (pseudo-) randomly oriented and distributed but not intersecting lines. In fact, the code is from the reply I got here: ...
5
votes
1answer
533 views

Automatically wrap abritrary-length text in graphics

Question: How to insert Styled text of unknown style and length into a graphics and have it wrap at a Scaled width? Attempt: I ...
4
votes
2answers
485 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
4answers
587 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
4answers
546 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
1answer
372 views

BarChart that lines up with dates in DateListPlot

I am trying to create a chart similar to the view offered by TradingChart, but with custom data not relating to finance. ...
4
votes
1answer
903 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
3answers
2k views

Mathematica 8: ContourPlot finding out max and min function values [duplicate]

I have a ContourPlot where I have let Mathematica draw the contours automatically. I would like to extract the zmax and zmin contour values that have been determined internally so that I can pass them ...
2
votes
1answer
401 views

Generate a set of 3D coordinates subject to constraints

Generating a set of random 3D coordinates is ok, e.g. ...
1
vote
6answers
286 views

How to build a game board [duplicate]

I have - rather lazily - constructed a chessboard like this: ...
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
2answers
277 views

can a ColorFunction have side effects?

Can anyone explain this (to me) odd behavior. If I run this code once (fresh kernel) it works as intended. ...
10
votes
2answers
455 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
351 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 ...
9
votes
4answers
472 views

Labeling triangle edges in Mathematica 10

Mathematica 10 introduced lots of new geometry related functions, and one of these is SSSTriangle which creates a triangle graphic given the three side lengths. Is it possible however to label the ...
9
votes
2answers
911 views

How can automatic ticks be made “outie”?

By default, FrameTicks stick into the data area in a way that is sometimes uncomfortable. ...