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

11
votes
1answer
236 views

Finding minimal region with padding and linear map to circle

Suppose I have n ordered points. I would like to find a simple region that contains all the points and is close to the smallest region that contains the points except it is smooth and has some ...
11
votes
2answers
592 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 ...
5
votes
2answers
279 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
414 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 ...
11
votes
2answers
651 views

Why is ListDensityPlot unable to plot datasets with extreme ranges

Consider the following dataset: data = Flatten[ Table[{x 10^-9, y 10^-9, x^2 + y^2},{x, -100, 100, 10}, {y, -100,100, 10}] , 1]; If I try to ...
17
votes
4answers
935 views

Scale Insetted Characters to Plot

I am trying to place a curly brace within a plot such that the top/bottom of the curly brace line up with two horizontal lines in the plot: I have not been able to find a way to make the curly ...
10
votes
2answers
3k 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 ...
16
votes
3answers
689 views

Procedure to find direction of triangle

I'm trying to write a procedure or function to find the direction in which a 2D triangle points. The triangle is assumed to be isosceles. While I can see the basic outline of what I want to do, making ...
13
votes
4answers
373 views

How to separate paths from the output of EdgeDetect?

I have been trying to find a way to separate the various closed paths that can be output by EdgeDetect. For example, taking the output of: ...
5
votes
1answer
179 views

How to add several Locators to a Graphic with a mouse click?

Background: Suppose I have something like this: ...
9
votes
3answers
3k views

How to convert a 2D image into a 3D graphics?

I have an image I would like to make into a .dxf and to do this I need a Graphics3D object. Is there anyway I can do this? Can ...
8
votes
2answers
584 views

How To interactively create a Polygon in a Graphic?

Background: suppose I start with the following (working) snippet. Manipulate[Graphics[Line[{{0, 0}, p}], PlotRange -> 2], {{p, {1, 1}}, Locator}] Ideally, I ...
13
votes
2answers
801 views

Computing the bounding boxes for Text objects

Regardless of AspectRatio, the Text boxes overlap. ...
12
votes
1answer
507 views

PieChart with radial coloring/color function

I am trying to visually compare multiple functions that depend on a single argument running from $0$ to $1$. They describe a radial property and so I thought it would be nice to use a kind of ...
5
votes
1answer
188 views

Composite graphics with Row, Column, data aggregation and layout control

This chromogram shown here represents data (mouse activity patterns during visits) for ~20 physicians in a study, each of which may have a variable number of visits in the study (physicians are color ...
3
votes
2answers
227 views

Using one table for multiple arguments

So I want to plot two graphs (on the same plot). One which is the $\frac{\sum_{i=0}^n x_i}{n}$ and the other $\frac{\sum_{i=0}^n x_i}{n-1}$ where x is a set created by ...
0
votes
0answers
76 views

Using the Graphics command, how do I limit the output to a specified region, say a disk? [duplicate]

Possible Duplicate: What is the best way to clip a graphic to a region? Given a set of circles and disks I can plot using the Graphics command. I wish to limit the output to a specified ...
25
votes
2answers
857 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 ...
6
votes
2answers
7k views

Plot legend inside a Show [duplicate]

Possible Duplicate: Using PlotLegends with Show messes up the graphics I have created a composite plot function: I want to add a legend to it, but ...
22
votes
4answers
3k views

Computing and plotting a spectrogram in Mathematica

How can I compute and plot the spectrogram of a signal/time series/data in Mathematica? I have a WAV file, sampled at 44100 samples/second and I want to generate a spectrogram of that data. Something ...
10
votes
3answers
2k views

Saving high-quality graphics through commands

Say I make and display a graph in a Mathematica notebook: graph = CompleteGraph[100] If I drag the corner of the graph to increase its size, and then save it to ...
27
votes
2answers
1k 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 ...
21
votes
3answers
5k views

Plotting Error Bars on a Log Scale

I have a plot with ErrorListPlot ...
3
votes
2answers
193 views

Rotate doesn't work with BarChart and BoxWhiskerChart

Rotate@BarChart[RandomReal[1, {4, 5}], ChartLayout -> "Percentile"] Even though the FullForm generated by BarChart is Graphics expression, Rotate has no ...
31
votes
5answers
4k 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 ...
8
votes
1answer
350 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 ...
21
votes
1answer
2k views

Autorotating 3D plots

These days, I have to produce quite a few 3D surface plots (mostly functions of the type $\rho(\theta,\phi)$ plotted with SphericalPlot3D). To exchange these ...
33
votes
5answers
3k 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: ...
17
votes
3answers
456 views

Memory Leak in Frontend - anyone know a workaround?

When using Rasterize on a Graphics expression composed of many differently coloured Graphics objects memory is allocated in the frontend which is then not released or reused when a similar graphic ...
12
votes
4answers
2k views

How do I draw a DensityPlot in polar coordinates?

I am trying to plot $J_m(\chi_{mn} r) \cos(m\phi),$ where $J_m(\chi_{mn}) =0,$ as a DensityPlot in polar coordinates (solution to 2D wave equation in polar ...
18
votes
4answers
2k views

Can 2D and 3D plots be combined so that the 2D plot is the bottom surface of the 3D plot boundary?

I have a ListlinePlot function, that I would like to combine with both a Graphics3D plot and a ...
14
votes
1answer
582 views

Using Texture to color countries according to their timezones

So I'm trying to make a world map, where each country is colored according to its timezone. Except, for countries with multiple timezones, the country is filled with vertical stripes of colors ...
0
votes
1answer
397 views

How to reduce the memory necessary for the image? [duplicate]

Possible Duplicate: Exporting graphics to PDF - huge file I have a figure that is created to use in a paper. Here it is: ...
44
votes
2answers
2k views

Extract values for ViewMatrix from a Graphics3D

Under More Information in the help page of ViewMatrix the following entry can be found With the setting ...
2
votes
1answer
561 views

Adding a circle to an already existing drawing

With reference to my earlier post: Adding a point to an already existing graphic I would like to add an outer circle to the whole drawing. This outer circle is a fixed one of ...
19
votes
5answers
1k views

Morphing Graphics, color and location

I would like to make a small animation : 1-We start with a random distribution of gray points : ...
60
votes
8answers
12k 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): ...
9
votes
4answers
906 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 coloring of data (according to ...
15
votes
3answers
2k views

Composition: how to make a day and night world map?

Given the following world images: ...
18
votes
3answers
551 views

Change the color of a Locator in a Manipulate

How can I change the color of a Locator in a Manipulate? As an example, consider the following. ...
26
votes
3answers
783 views

Consistent Plot Styles across multiple MMA files and data sets

I am starting to write a thesis for which I want to use MMA for all my plotting needs, mostly because a lot of the basic analysis has been done there. To ensure that I am applying styles consistently ...
16
votes
2answers
3k views

How to save plots in grayscale

As sophomoric as this question seems, how should I save plots in grayscale in Mathematica? I generally like eps images for their scalability and I use ghostscript or other third party perl scripts ...
16
votes
2answers
457 views

Ad hoc graphics primitives-like objects

Sphere is one of the three-dimensional graphics primitives available in Mathematica and can be easily used to created very useful images. For instance, in the ...
3
votes
1answer
209 views

Forcing a graph not to resize

This code: ...
4
votes
1answer
369 views

How to draw a gene regulatory state space diagram in Mathematica

Is it possible to draw in Mathematica a state space diagrams like these two?! I tried a lot but since I am fairly new to Mathematica, I could not reproduce the desired result.
26
votes
6answers
2k 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, creating a "snake-like" path. Here is an image I found to illustrate: I can't seem to figure out if ...
16
votes
1answer
699 views

How can the {x,y,z} points that fall on the outer boundary of a set of values be selected and smoothly surfaced?

For a given set of x,y,z values, that may, or may not form a uniform shape, how can the center of the data cloud be found, and the surface points be located and a solid smooth surface created from ...
10
votes
1answer
395 views

Is there an option to plot the Z axis reversed (as shown in the figure)?

Normally the Z axis is plotted from bottom-to-top as shown below : I got a plot with the axis (axes to be more precise) reversed as shown below: Is there a way to force the axes to be plotted ...
7
votes
2answers
280 views

Dealing with numbers too large for machine precision in Graphics

Graphics only supports machine precision numbers (i.e. number that can be converted to machine precision). Take for example ...
12
votes
1answer
496 views

Graph stories, 3-d volumes

I saw a lesson plan that had students filling different shaped bottles at a constant rate. The idea was to graph height vs. time to show the students how different shapes would produce different ...