Questions on creating visualizations from functions or data using high-level constructors such as Plot, ListPlot, Histogram, etc.

learn more… | top users | synonyms (4)

17
votes
3answers
3k views

Showing the correlation of two variables using a plot

I have a list of $\{x_i,y_i\}$ pairs and I want to show that $x_i$'s and $y_i$'s have positive correlation. The result of ...
12
votes
3answers
2k views

Data interpolation and ListContourPlot

I am fairly new to Mathematica and I have two quick questions on using it for a Hydrology and Hydrogeology class. One is about data interpolation and interpolating without any data defined in an area. ...
14
votes
5answers
4k views

Plotting discontinuous functions without spurious vertical segments

Consider the plot of this discontinuous function: f[x_] := If[2 < x < 3, 0, x] Plot[f[x], {x, 0, 5}] I'd like to plot that without the vertical segments. ...
10
votes
1answer
1k views

Collision of axes labels and ticks

Is there a way to prevent ugly collision of axes labels and axes number like in the following examples, without the need of adding white space: Plot1: ...
7
votes
2answers
316 views

How can I make a grid of plots with no spacing, and have the plots line up perfectly?

I am making a bunch of two dimensional plots and I would like to have them arranged in a grid with no space in between them. That is, I want their frames touching each other. My problem is twofold. ...
17
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
6answers
807 views

Proper way to Plot a single function in two different styles?

I've got this code ...
12
votes
3answers
2k views

How to express ticks in scientific form? [duplicate]

I want to express the ticks in scientific form. I tried two ways as following ...
11
votes
2answers
399 views

How can I prevent ColorFunction from disabling antialiasing in graphics?

When I use ColorFunction, the appearance of my plots is ruined, changing from this which has the normal smooth lines and antialiased fonts, to this in which ...
9
votes
2answers
2k views

Two x-axis with different units connected by function using CustomTicks

I am trying to make a plot of some photoluminescence data, where wavelength is on the x-axis, and intensity is on the y-axis. Also, I would like to have the graph boxed, with the upper x-axis having ...
16
votes
4answers
1k views

Printing exported PDF graphics fails (version 8)

When I export even simple graphics, say, a DateListPlot to PDF under Windows, it refuses to print on any of the printers at work. Acrobat (Reader X) throws three ...
8
votes
5answers
588 views

can the color in MeshStyle be specified by a ColorFunction, such as “SunsetColors” for example. If so, what is the correct syntax?

This is an example given in Help: Plot3D[Sin[x y], {x, 0, 3}, {y, 0, 3}, MeshStyle -> Gray] Could this be changed to something like ...
7
votes
3answers
510 views

Smoothing ListContourPlot contours

I have some data of type {{x1, y1, f1}, {x2, y2, f2}, ...} and want to do ListContourPlot. However, there is a problem that the ...
29
votes
3answers
4k views

How does one set a logarithmic scale in a ContourPlot?

How does one set a logarithmic scale for both x and y axes in ContourPlot in Mathematica?
14
votes
1answer
302 views

Method -> {“AxesInFront” -> False} for Graphics3D

I'm aware of two ways to manage positioning of Axes for Graphics3D: AxesOrigin and ...
10
votes
7answers
773 views

How do I get rid of a “jump” in my plot?

How can I prevent plotting functions from "connecting" inside a plot points that should "wrap around" outside the plot? For example, how do I eliminate the horizontal lines running across the ...
10
votes
4answers
4k views

Filling between boundaries

I would like to visualize what it graphically means to integrate between two boundary values. Therefor I'd like to make a Filling between these two values. Is there a way to get this done?
9
votes
5answers
552 views

Create filling between two trig functions

Working with trig functions, period, amplitude, etc. I found a worksheet at a calculus website, with some nice questions related to interpreting trig functions, at least, they provide some "fun" ...
2
votes
1answer
292 views

How to insert a plot into another overlay plot

I want to insert a plot into another overlay plot. Here is my code: ...
17
votes
4answers
1k views

Setting the default font for PlotLegends

I'm pleased that Mathematica 9 appears to have brought us prettier legends. If I always want the legend in ...
14
votes
3answers
575 views

Gridlines of a framed plot with a background cannot be white?

Looking at this question, I am reminded of a problem that I was never able to solve with obtaining a particular plot format. The issue is that GridLines sit behind ...
13
votes
3answers
763 views

Is it possible to position ticklabels on the negative y axis on its right side?

Is it possible to position ticklabels on negative $y$ axis on its right side? Ticklabels on positive $y$ axis should remain as usual:
12
votes
1answer
518 views

Styling individual bars in a BarChart with grouped data

Consider the following: ...
11
votes
2answers
597 views

About number truncation of ticks display in ListPlot

In my problem, I need to plot a figure in a relatively small region of the $x$ axis, e.g., ...
10
votes
2answers
630 views

Adding custom GridLines to the “automatic” ones

I need to add custom (vertical) grid lines to a plot (to a DateListPlot, to be precise). I know there is the option of ...
10
votes
2answers
6k views

Placing x-axes label below rather than at end of axes

By default Mathematica places the x-axis labels at the end of the axes like Googling has suggested a way around this is to use Frame- for example ...
4
votes
2answers
268 views

How and when to use Evaluate?

A month ago, I used Mathematica to solve my experiment of the Test Technology of Mechanics Engineering. The exeriment is mainly about the Fourier Transform and verify the validity of the theory of ...
4
votes
4answers
895 views

How can I manipulate the number of decimal places in the frame ticks?

Is there any simple way to increase or decrease the decimal places in the frame ticks. I want to make the y axis ticks of the first two and the second two graphs look similar.
4
votes
4answers
4k views

Mapping multiple parameters of a function to specific values

I am a little bit confused by the documentation for Apply (@@). I want to define a list of parameters, for instance: ...
3
votes
2answers
1k views

Plotting the results of iterating a function

This is what I am stuck on f[a_][x_] := x^2 + a; w[a_] := Take[NestList[f[-1.8], 0, 1000], 100] Now I want to evaluate this for different values of the constant ...
19
votes
2answers
264 views

Plotting a defined function gives different results from plotting the function directly

Consider the following piece of code: function[t_]:=Exp[-9 t^2]; LogLogPlot[{function[t],Exp[-9 t^2]},{t,.01,100}] I expect the two plots to exactly overlap each ...
12
votes
4answers
8k views

How can I plot the direction field for a differential equation?

I'd like to plot the graph of the direction field for a differential equation, to get a feel for it. I'm a novice, right now, when it comes to plotting in Mathematica, so I'm hoping that someone can ...
12
votes
3answers
749 views

Why doesn't PlotMarker option None return no PlotMarkers?

After reading the PlotMarkers documentation it seems to be all or nothing. For example if you wanted markers on some of you lines the code below seems ...
11
votes
3answers
483 views

Change the inner color of markers

I would like to have a marker with white as its inner color, to be able to make this kind of graph: If I use PlotMarkers -> Style["\[FilledSquare]", White], ...
9
votes
1answer
186 views

Structure of Graphics (esp. those produced by Plot, ListPlot, etc.)

I'm looking for a description of the structure of Graphics objects, aimed at the advanced Mathematica programmer. The motivation for this question is the ...
9
votes
4answers
937 views

Filling between two 3D surfaces

I know it is possible to create a filling in between two curves on a 2D plot, but is it possible to do the same in 3D? My attempt like this: ...
8
votes
4answers
388 views

Plotting the components of a function that returns a list in different colors without redundant evaluations of the function

I have a function f which takes a number as input, and returns a list of numbers (the length of the list is constant). f is hard ...
6
votes
3answers
1k views

Spreading colors in ListDensityPlot

I want to create a two-dimensional plot using data from an external file. This file contains several triplets of numbers. The first two columns indicate the x and y position, while the third one works ...
5
votes
1answer
200 views

Why does the order of arguments in Show influence the result?

I am wondering why there is a difference in the results from evaluating the two expressions, which differ only in the order of the arguments given to Show. When I ...
5
votes
2answers
802 views

How to extract data from contour plot as a text file?

I have the following expression from which I want to extract data for a contour plot. ...
4
votes
6answers
365 views

ParametricPlot with plot markers

I have a parametric plot, and would like to fit a line to it with "■" PlotMarkers on it, but am unable to do so. ...
16
votes
2answers
704 views

Plot Option Precedence while combining Plots with `Show[]`

I like to build sophisticated plots by combining simpler ones with Show[]. Typically this involves setting non-default Plot-Options with the different ...
11
votes
1answer
193 views

Why does GridLines option fail with Function?

Bug introduced in 10.0.0 and fixed in 10.0.1 The Plot option GridLines can be specified either as a list of explicit values ...
11
votes
1answer
785 views

How can I make hatching filling of plot

How can I make hatching filling of plot Like this: I use another one plot with shifting to make filled area above: ...
10
votes
4answers
803 views

Coloring Points in a Plot, based on their position in the list

Before I describe the question, I'd like to say that I've seen the excellent answers posted here but have not managed to get them to work for my own data. I have a list of values that I would like to ...
8
votes
3answers
754 views

Pass list of options to Plot3D

Consider the example plotOptions = {PlotPoints -> 10, MaxRecursion -> 2} Plot3D[x y , {x, 0, 10}, {y, 0, 10}, plotOptions] Why does this causes the error: ...
8
votes
3answers
4k views

Plotting Partial Sums of Fourier Series

I'd like to plot some partial sums for a Fourier Series problem, but I am not sure if the output I am getting is correct. I want to be able to plot the partial sums and the function on the same graph. ...
7
votes
1answer
505 views

Managing Exclusions in Plot[]

When I do: ...
7
votes
3answers
608 views

Can I limit PlotRange for 1 function in a Plot?

I have a 2D Plot of 3 functions Plot[ { f1[x], f2[x], f3[x] }, { x, 8, 18 } ] where I want f3[x] only plotted for the range [10, 18] instead of [8, 18]. Is that ...
6
votes
2answers
946 views

How to reverse the direction of the y axes

I have a similar question to this one. Unfortunately, the answers there didn't help me. I would like to plot a simple function with the normal Plot function. ...