## From "HSV" colormap to "cold-to-hot" colormap...

Hello!

I have a question about densityplot.

I want to get this colormap:

As I understand, I should use plots:-densityplot(...) comand and "HSV" colorscheme, where H = [240..0], S=1, V=1.

But if i use zcoloring with this options, I will get wrong result.

My code:

restart;

a := 0; b := 1; #first and final point

plots:-densityplot(z, dummy = 0 .. 1, z = a .. b, grid = [2, 10], size = [90, 100], colorscheme = ["zcoloring", [proc (z) options operator, arrow; -240*(z-a)/(b-a)+240 end proc, proc (z) options operator, arrow; 1 end proc, proc (z) options operator, arrow; 1 end proc], colorspace = "HSV"], style = surface, axes = frame, labels = ["", ""], axis[1] = [tickmarks = []], title = "Test", titlefont = ["Calibri", "Bold", 16], axesfont = ["Arial", 14], size = [100, 500]); #densityplot with zcoloring option.

My result (zero must be equal to "Blue"):

I can't find mistake....

## Fill a distribution plot...

with(Statistics):
X := RandomVariable(Normal(0, 1))

DensityPlot(X,filled=true)

I don't know why the plot doesn't produce a shaded plot.

## Possible bug in colorscheme option?...

Hello everyone!

Is this a bug that the following two commands work differently?:

densityplot(sin(x*y), x = -5 .. 5, y = -5 .. 5, colorscheme = ["zgradient", ["blue", "green", "yellow", "red"], zrange = -5 .. 5], style = surface)

plot3d(sin(x*y), x = -5 .. 5, y = -5 .. 5, view = -10 .. 10, colorscheme = ["zgradient", ["blue", "green", "yellow", "red"], zrange = -5 .. 5], style = surface)

The second one works fine in that if you increase the magnitude of sin(x*y) (e.g. 3sin(x*y)) the coloring changes accordingly. But the first one plots sin(x*y) or 5sin(x*y), etc. just the same!

## Problem with color in plot...

Hello!

I am calculating the temperature of a rod which has one end at the temperature T1 and the other end at T2 and it's evolution. We were already given the formula for the numeric calculation and after a short while I managed to obtain a small program that would calculate the temperature of each segment of the T(x,t) grid:

>restart: with(plots): nx:=20: tmax:=50: T1:=1: T2:=10: L:=1: k:=1: rho:=1: cp:=1: chi:=k/rho/cp: h:=L/(nx-1): t:=1e-3:
>for k from 0 to nx do T(k,0):=T1 od:
for w from 1 to tmax do
T(0,w):=T1: T(nx,w):=T2:
for q from 1 to nx-1 do
T(q,w):=T(q,w-1)+chi*t/h^2*(T(q+1,w-1)+T(q-1,w-1)-2*T(q,w-1));
od: od:

With L the Length of the rod, t and h the time and space increment [h=L/(nx-1), where nx is the number of intervals we divide the x-axis, although I'm not quite sure the '-1' should be there], chi a constant different for each rod and tmax total time we want to calculate. The formula from the 5th line was given to us, so in that part there is no mistake.

Up until here everything works perfectly fine.

Now I want to be able to draw this and here is where all the problems appear. I want to draw this in a 2D graph with position in the x-axis and time in the y-axis. I have tried "densityplot(T(x,y),x=0..nx,y=0..tmax)" which would seem to be the logical whay to continue this. As I understand it, this plot would draw an nx times tmax grid and colour the whole plpot black-white acording to the maximum and the minimum value (as shown in the maple help page of this plot).

However, when I do this a black square appears (or red if I add colorstyle=HUE). I have tried a lot of things and none seemed to work.

I would also like to be able to draw the isotherms on the plot but that is secondary.

I am pretty new to Maple. I have studied the most basic things but don't really understand the whole complexity of this program. Thanks a lot in advance and forgive my faulty english,

Enrique

## Two statistic plots together...

I would like to scale the last KernelDensityPlot in the attached worksheet to overlay with the Histogram above it.  The result would look like the 3rd plot in the worksheet, except the y-axis ranges would match.

MonteCarloHistogram.mw

montecarloHistogramExample.txt

Regards,

Georgios

## The colorscheme option of densityplot...

Dear all,

I am tryong to use the density plot for the first time.

Following maple instructions in maplsoft, I type

densityplot(xex2y2,x=2..2,y=2..2,colorscheme=["𝙱𝚕𝚞𝚎","𝙶𝚛𝚎𝚎𝚗","𝙾𝚛𝚊𝚗𝚐𝚎"])

but I get the error below:

Error, (in plot/options2d) unexpected option: colorscheme =["𝙱𝚕𝚞𝚎","𝙶𝚛𝚎𝚎𝚗","𝙾𝚛𝚊𝚗𝚐𝚎"])

It actually works with one color, but not with colorscheme!

## Multiple DensityPlot in one figure...

Hi,

I want to plot two density functions of norm(1,1) and norm(4,1) in one figure.

But it appears the function DensityPlot can only plot one at a time.

## How to animate the DensityPlot of a RandomVariable...

Hi,

I don't manage to animate a DensityPlot. Here is my program :

> restart;
> with(Statistics): with(plots):
> P := lambda->RandomVariable(Poisson(lambda)):
> animate(DensityPlot,[P(n),range=0..10],n=1..5,frames=5);

And here is the error message :

Plotting error, non-numeric vertex definition

Thanks for any help

## Density plot with arbitrary scales?...

I have a Matrix of data points I am plotting using plots:-listdensityplot. That works fine.

However, the axes are labeled by row and column number of the Matrix (e.g. 1..20 or whatever). In reality, these are of course some parameters the range of which has been mapped onto the rows and columns of the Matrix.

How can I display the axes using the values of the original parameters? I know the transformation from Matrix row or column to the actual parameters (and in this case it is linear).

TIA,

Mac Dude

## How to create a density plot through data not a eq...

Dear all,

A stupid question.

I tried to create a density plot of the data but I only saw the method to plot graphs through equations. (Actually, I'm not very familiar with related statistical commands in Maple)

This is the histograph of my data:

And I want to get the density plot like this:

It seems that we can get the graph through "InteractiveDataAnalysis" but cannot print the graph into the worksheet or assign the graph to the variable.

How to create a density plot through data? Thanks.

## Super-easy Collatz snowman fractal

by:

It is a relatively recent innovation that complex-number computations can be done in the evalhf environment. When combined with plots:-densityplot, this makes escape-time fractals in the complex domain very easy to plot. This fractal is based on the Collatz problem. This Wikipedia article has a high-resolution picture of this fractal. I've switched the real and imaginary axes and reversed the direction of the real axis purely for asthetic reasons.

 Collatz:= proc(b,a)  #Axes switched local z:= -a+b*I, k;  #real part negated      for k to 31 while abs(Im(z)) < 1 do           z:= (1+4*z-(1+2*z)*cos(Pi*z))/4      end do;      k #escape time end proc: #Test evalhf'ability: evalhf(Collatz(0,1)); plotsetup(      jpeg, plotoutput= "C:/Users/Carl/desktop/Collatz.jpg",      plotoptions="height= 1024, width= 1024, quality= 95" );   CodeTools:-Usage(      plots:-densityplot(           Collatz,           -1..1, # imaginary range           -0.5..4.5, #negative of real range           colorstyle= HUE, grid= [1024, 1024], style= patchnogrid,           labels= [Im,-Re], labelfont= [TIMES, BOLD, 14],          axes= boxed,           caption= cat("      Happy New Year ",                                   StringTools:-FormatTime("%Y")),           captionfont= [HELVETICA, BOLDOBLIQUE, 18]      ) ); memory used=24.08MiB, alloc change=24.00MiB, cpu time=7.78s, real time=7.79s

## Densityplot with a log scaled grid...

Hello,
I have tried to make a densityplot with a logarithmic scale on one axis using :

So the plot is displayed with a log scale but the grid used to generate the plot is still linear, with a regular spacing.
I don't know how to make it logarithmic too.
Maybe it's not very clear. For example I would like  a spacing of 0.1 from 0.1 to 1 then a spacing of 1 from 1 to 10.
How can I do that ?
I have not find any clue in the help ...

EDIT : The option "axis[1]=[mode=log]" only change how the plot is displayed.
I would like to change the grid, that is to say how the plot is calculated.

## DensityPlot and Sample...

Why does this not work?

restart:
with(Statistics):

P := Sample(RandomVariable(Normal(10, 10)), 500):
X := RandomVariable(EmpiricalDistribution(P)):

DensityPlot(X);

## Beta Prime Distribution in Maple...

Hi all,

I have been trying to plot in Maple a Beta Prime Distribution using the Statistics package. I have define it through its density function and its range with the command

U := Distribution(PDF = (proc (x) options operator, arrow; x^(alpha-1)*(1+x)^(-alpha-beta)/Beta(alpha, beta) end proc), Support = 0 .. infinity)

and then assigned it to a random variable Z with the command

Z := RandomVariable(U)

Now I wanted to plot the density...

## Density Plot Not as expected...

To plot the density function of the continuous uniform distribution on [-1,1], my initial attempt was:

plot(Statistics:-PDF(Statistics:-RandomVariable(Uniform(-1,1)),x), x = -1.1 .. 1.1);

See plot below.

But I wanted something more like the wikipedia image (without the labels, naturally):

See plot below.

In words, I expected a horizontal line on the left of x=-1 and on the right of x=1 (at y=0), and I expected no vertical line at the x=-1 and x=1 points ...

 1 2 Page 1 of 2
﻿