# Visualization

**URL:** https://discourse.julialang.org/c/domain/viz/17.md?page=32

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 33

---

## [Write a plot recipe that uses other recipes to generate data for several plots](https://discourse.julialang.org/t/write-a-plot-recipe-that-uses-other-recipes-to-generate-data-for-several-plots/100015)

<div class="topic-metadata">

**Author:** [@claud10c](https://discourse.julialang.org/u/claud10c)\
**Replies:** 2\
**Last updated:** [June 7, 2023, 6:47pm UTC](https://discourse.julialang.org/t/write-a-plot-recipe-that-uses-other-recipes-to-generate-data-for-several-plots/100015 "2023-06-07T18:47:43Z")

</div>

I have the following code (here is a minimal working example) in Julia: using Plots using LazySets gr() struct Data pos::Matrix{Float64} # Positions in an Euclidean plane snodes::Vector{Vector{Int64}} # Set of …

---

## [Plotting Probability Distribution of Data](https://discourse.julialang.org/t/plotting-probability-distribution-of-data/99976)

<div class="topic-metadata">

**Author:** [@optimist](https://discourse.julialang.org/u/optimist)\
**Replies:** 3\
**Last updated:** [June 7, 2023, 5:45pm UTC](https://discourse.julialang.org/t/plotting-probability-distribution-of-data/99976 "2023-06-07T17:45:26Z")

</div>

I am trying to produce a plot of probability distribution function of some data which is a result of simulations. Using density function from StatPlots is showing some weird y-axis numbers. I would expect it to be rangin…

---

## [Colarbar: equal-sized color rectangles](https://discourse.julialang.org/t/colarbar-equal-sized-color-rectangles/99932)

<div class="topic-metadata">

**Author:** [@thunderclouds](https://discourse.julialang.org/u/thunderclouds)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 1:47pm UTC](https://discourse.julialang.org/t/colarbar-equal-sized-color-rectangles/99932 "2023-06-06T13:47:26Z")

</div>

How do I create a color bar with the same height for each level? Default scales rectangles according to the levels. using CairoMakie xs = LinRange(0, 20, 50) ys = LinRange(0, 15, 50) zs = \[cos(x) \* sin(y) for x in …

---

## [Change distance between dots in \`linestyle=:dot\` plotting option](https://discourse.julialang.org/t/change-distance-between-dots-in-linestyle-dot-plotting-option/86592)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 1:14pm UTC](https://discourse.julialang.org/t/change-distance-between-dots-in-linestyle-dot-plotting-option/86592 "2023-06-06T13:14:36Z")

</div>

I am plotting something like: plot(x-\>x^2,lw=5,linestyle=:dot) Is there some way to modify the distance between the individual dots in the plot?

---

## [Legend for functions in a separate (stacked) plot](https://discourse.julialang.org/t/legend-for-functions-in-a-separate-stacked-plot/99796)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [June 3, 2023, 7:20pm UTC](https://discourse.julialang.org/t/legend-for-functions-in-a-separate-stacked-plot/99796 "2023-06-03T19:20:41Z")

</div>

TLDR: In Gadfly, what’s the best way to put a legend for a plot into a separate (stacked) plot instead? My problem Current solution I have a module like this for a specific plotting use case: module Plotting using Gad…

---

## [How to have multiple labelcolors in legend?](https://discourse.julialang.org/t/how-to-have-multiple-labelcolors-in-legend/99745)

<div class="topic-metadata">

**Author:** [@Gianluca\_Fuwa](https://discourse.julialang.org/u/Gianluca_Fuwa)\
**Replies:** 1\
**Last updated:** [June 2, 2023, 5:04am UTC](https://discourse.julialang.org/t/how-to-have-multiple-labelcolors-in-legend/99745 "2023-06-02T05:04:49Z")

</div>

Hi, is there a way to have to have more than one :labelcolor in a Legend() or axislegend()? Specifically in my case, I am trying to make each label be the same color as the line it represents, like plt.legend(labelcol…

---

## [Makie Alpha property in colormap is not observable. What's best way to mech this?](https://discourse.julialang.org/t/makie-alpha-property-in-colormap-is-not-observable-whats-best-way-to-mech-this/99731)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 6:03pm UTC](https://discourse.julialang.org/t/makie-alpha-property-in-colormap-is-not-observable-whats-best-way-to-mech-this/99731 "2023-06-01T18:03:35Z")

</div>

I have a function that makes a plot using lines/lines!. I can pass observables into the function and get the line x,y,z, and colormap value to update dynamically. The alpha value does not update as an observable. What…

---

## [Axis limits in 3D Makie plot](https://discourse.julialang.org/t/axis-limits-in-3d-makie-plot/99730)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 0\
**Last updated:** [June 1, 2023, 2:13pm UTC](https://discourse.julialang.org/t/axis-limits-in-3d-makie-plot/99730 "2023-06-01T14:13:50Z")

</div>

How can I set the axis limits in this Makie code? using Distributions using Makie using WGLMakie N = 50 lat = rand(-20.:20., N) lon = rand(-180.:180., N) temp\_dist = Normal(85, 5) temp = rand(temp\_dist, N) dat…

---

## [Heatmap using categorical colours](https://discourse.julialang.org/t/heatmap-using-categorical-colours/99717)

<div class="topic-metadata">

**Author:** [@pascal](https://discourse.julialang.org/u/pascal)\
**Replies:** 3\
**Last updated:** [June 1, 2023, 10:18am UTC](https://discourse.julialang.org/t/heatmap-using-categorical-colours/99717 "2023-06-01T10:18:37Z")

</div>

I plot a heatmap of as using CairoMakie x=\[1; 2; 1; 2; 501; 500; 501; 500\] f = Figure() ax = Axis(f\[1,1\]) hm = heatmap!(ax, ones(8), 1:8, x, colormap=cgrad(:viridis, 4, categorical=true)) Colorbar(f\[:, 2\], hm) f Can I …

---

## [Odd error for contour plots with PGFPlotsX](https://discourse.julialang.org/t/odd-error-for-contour-plots-with-pgfplotsx/99670)

<div class="topic-metadata">

**Author:** [@theo](https://discourse.julialang.org/u/theo)\
**Replies:** 0\
**Last updated:** [May 31, 2023, 12:17pm UTC](https://discourse.julialang.org/t/odd-error-for-contour-plots-with-pgfplotsx/99670 "2023-05-31T12:17:40Z")

</div>

So some of my contour plots with PGFPlotsX are breaking, others are not. I tried to find a simple way to reproduce the error and realised it breaks if I try to plot anything that’s flat… Can anyone explain this? julia\> …

---

## [How to visualize a 3D slice of a higher-dimensional space](https://discourse.julialang.org/t/how-to-visualize-a-3d-slice-of-a-higher-dimensional-space/99610)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 1\
**Last updated:** [May 30, 2023, 6:26pm UTC](https://discourse.julialang.org/t/how-to-visualize-a-3d-slice-of-a-higher-dimensional-space/99610 "2023-05-30T18:26:27Z")

</div>

A few months ago, I read a book called The Elegant Universe and in it the author discusses Calabi-Yau manifolds and includes a plot that is a 2D slice of a Calabi-Yau manifold. Does anyone know how to go about taking a 2…

---

## [Fast plotting of area-filled signals with interactive zoom](https://discourse.julialang.org/t/fast-plotting-of-area-filled-signals-with-interactive-zoom/63611)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 8\
**Last updated:** [May 30, 2023, 7:03pm UTC](https://discourse.julialang.org/t/fast-plotting-of-area-filled-signals-with-interactive-zoom/63611 "2023-05-30T19:03:47Z")

</div>

Plotting 50 signals below with filled areas using PyPlot.jl takes ~0.2 s (after first plot) and allows fast interactive zoom-in: Interactive zoom-in: A MWE is provided herein: using PyCall pygui(:qt5) using PyPlo…

---

## [How to plot a 3D grid in Makie](https://discourse.julialang.org/t/how-to-plot-a-3d-grid-in-makie/99575)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [May 30, 2023, 3:07pm UTC](https://discourse.julialang.org/t/how-to-plot-a-3d-grid-in-makie/99575 "2023-05-30T15:07:01Z")

</div>

It’s super easy to visualize a 3D grid with scatter!: using Makie using WGLMakie r = -2:2 fig = Figure() ax = LScene(fig\[1, 1\], show\_axis=false) scatter!(ax, \[Point3f(x,y,z) for x in r for y in r for z in r\]) fig ……

---

## [3D surface plot with GR backend error from certain camera angles](https://discourse.julialang.org/t/3d-surface-plot-with-gr-backend-error-from-certain-camera-angles/99564)

<div class="topic-metadata">

**Author:** [@bast](https://discourse.julialang.org/u/bast)\
**Replies:** 1\
**Last updated:** [May 29, 2023, 4:51pm UTC](https://discourse.julialang.org/t/3d-surface-plot-with-gr-backend-error-from-certain-camera-angles/99564 "2023-05-29T16:51:35Z")

</div>

Hi, I am trying to do a surface plot on data with missing/NaN values but the camera angle that I want gives me the error: “GKS: Colour index is invalid in routine SET\_FILL\_COLOR\_INDEX” and the coloring is all black. Us…

---

## [Lots of lines! in Makie](https://discourse.julialang.org/t/lots-of-lines-in-makie/99553)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [May 29, 2023, 2:51pm UTC](https://discourse.julialang.org/t/lots-of-lines-in-makie/99553 "2023-05-29T14:51:32Z")

</div>

I am making a plot of a dataset using semi-transparent lines connecting a bunch of measurements. MWE: using CairoMakie, Colors CairoMakie.activate!(type = "svg") a = √.abs.(randn(500)) b = a .\* 0.5 .+ randn() / 10 c = …

---

## [Axis-generating functions in Makie](https://discourse.julialang.org/t/axis-generating-functions-in-makie/99558)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [May 29, 2023, 2:23pm UTC](https://discourse.julialang.org/t/axis-generating-functions-in-makie/99558 "2023-05-29T14:23:30Z")

</div>

I would like to organize some commonly used plots into functions. Eg function makie\_plot\_posterior\_check(figure, label, data, predicted; scatter\_color = alphacolor(colorant"black", 0.…

---

## [Makie.hist/hist! can't add a label for legend if bar\_labels is specified](https://discourse.julialang.org/t/makie-hist-hist-cant-add-a-label-for-legend-if-bar-labels-is-specified/99352)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 5\
**Last updated:** [May 26, 2023, 1:33pm UTC](https://discourse.julialang.org/t/makie-hist-hist-cant-add-a-label-for-legend-if-bar-labels-is-specified/99352 "2023-05-26T13:33:08Z")

</div>

It seems like the legend doesn’t work for all situations. This works: use GLMakie h1=hist(rand(16,),bins = 10, label="a", strokewidth = 1, strokecolor = :black, normalization = :probability) axislegend() And this wo…

---

## [Error precompiling Plots.jl](https://discourse.julialang.org/t/error-precompiling-plots-jl/99349)

<div class="topic-metadata">

**Author:** [@leonbello](https://discourse.julialang.org/u/leonbello)\
**Replies:** 0\
**Last updated:** [May 24, 2023, 8:14pm UTC](https://discourse.julialang.org/t/error-precompiling-plots-jl/99349 "2023-05-24T20:14:58Z")

</div>

I am getting a weird precompiling warning each time I’m trying to use Plots.jl: \[ Info: Precompiling Plots \[91a5bcdd-55d7-5caf-9e0b-520d859cae80\] ┌ Warning: The call to compilecache failed to create a usable precompiled…

---

## [Struggling with lighting on GLMakie Meshes](https://discourse.julialang.org/t/struggling-with-lighting-on-glmakie-meshes/98678)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 8\
**Last updated:** [May 23, 2023, 3:20pm UTC](https://discourse.julialang.org/t/struggling-with-lighting-on-glmakie-meshes/98678 "2023-05-23T15:20:48Z")

</div>

Can anyone point me to an up to date resource on lighting meshes in GLMakie? Whatever I try at the moment results in a completely flat color, with no way to percieve depth.

---

## [Why do I have to install PGFPlotsX manually?](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140)

<div class="topic-metadata">

**Author:** [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Replies:** 7\
**Last updated:** [May 23, 2023, 7:32am UTC](https://discourse.julialang.org/t/why-do-i-have-to-install-pgfplotsx-manually/99140 "2023-05-23T07:32:20Z")

</div>

After adding and importing a package that has PGFPlotsX as a dependency, and checking that the dependency has been added to my environment’s Manifest (confirmed by entering st -m in package mode), I get an error when cal…

---

## [Please, how do I remove the key from a colored bar chart? Deadline immenient, help greatly appreciated](https://discourse.julialang.org/t/please-how-do-i-remove-the-key-from-a-colored-bar-chart-deadline-immenient-help-greatly-appreciated/99248)

<div class="topic-metadata">

**Author:** [@johnabs](https://discourse.julialang.org/u/johnabs)\
**Replies:** 2\
**Last updated:** [May 22, 2023, 10:08pm UTC](https://discourse.julialang.org/t/please-how-do-i-remove-the-key-from-a-colored-bar-chart-deadline-immenient-help-greatly-appreciated/99248 "2023-05-22T22:08:07Z")

</div>

I currently have some separate data frames that aren’t particularly amenable to being combined; but I need to plot them on the same plot but with a single legend/color key. I have done so with the following code, but whe…

---

## [Help to plot a surface plot with infinite roots?](https://discourse.julialang.org/t/help-to-plot-a-surface-plot-with-infinite-roots/98291)

<div class="topic-metadata">

**Author:** [@Moslem\_Uddin](https://discourse.julialang.org/u/Moslem_Uddin)\
**Replies:** 10\
**Last updated:** [May 21, 2023, 6:18pm UTC](https://discourse.julialang.org/t/help-to-plot-a-surface-plot-with-infinite-roots/98291 "2023-05-21T18:18:02Z")

</div>

I am trying to generate a surface plot of the following in Julia. As I’m new, I’m struggling where \\alpha\_k are I’m being able to generate a line plot at a fixed time using the following code: using Roots,Plots plot…

---

## [Histogram with Y-axis in log-scale](https://discourse.julialang.org/t/histogram-with-y-axis-in-log-scale/99183)

<div class="topic-metadata">

**Author:** [@parf](https://discourse.julialang.org/u/parf)\
**Replies:** 1\
**Last updated:** [May 21, 2023, 2:10pm UTC](https://discourse.julialang.org/t/histogram-with-y-axis-in-log-scale/99183 "2023-05-21T14:10:22Z")

</div>

Hi all, I want to plot histogram with Y-axis in log-scale. So, I do the following: using Plots gr() histogram(r\_pos\*L/n, normed=:pdf, bins=0.0:0.012:0.8, yaxis=:log10, ylim=(1e-3,10)) How to make the bins filling …

---

## [How to make a South-up map using GeoMakie](https://discourse.julialang.org/t/how-to-make-a-south-up-map-using-geomakie/96438)

<div class="topic-metadata">

**Author:** [@dpabon](https://discourse.julialang.org/u/dpabon)\
**Replies:** 2\
**Last updated:** [March 23, 2023, 1:15pm UTC](https://discourse.julialang.org/t/how-to-make-a-south-up-map-using-geomakie/96438 "2023-03-23T13:15:17Z")

</div>

I would like to produce a coast-lines plot using GeoMakie like this one: or this one: I tried with the dest projection, but doesn’t work well: using CairoMakie, GeoMakie fig = Figure() ga = GeoAxis( fig\[1,…

---

## [How to stick a colorbar to a scaled axis in Makie](https://discourse.julialang.org/t/how-to-stick-a-colorbar-to-a-scaled-axis-in-makie/70358)

<div class="topic-metadata">

**Author:** [@briochemc](https://discourse.julialang.org/u/briochemc)\
**Replies:** 12\
**Last updated:** [May 18, 2023, 4:43pm UTC](https://discourse.julialang.org/t/how-to-stick-a-colorbar-to-a-scaled-axis-in-makie/70358 "2023-05-18T16:43:30Z")

</div>

Here is a MWE of a Makie plot with a wide figure with one square axis and a colorbar “attached” to it: f = Figure(resolution=(900,300)) Axis(f\[1, 1\], aspect = AxisAspect(1)) Box(f\[1, 1\], color = (:blue, 0.2), strokecolo…

---

## [Different outputs after adding x-axis coordinates of data in Makie.jl](https://discourse.julialang.org/t/different-outputs-after-adding-x-axis-coordinates-of-data-in-makie-jl/99037)

<div class="topic-metadata">

**Author:** [@nebula](https://discourse.julialang.org/u/nebula)\
**Replies:** 4\
**Last updated:** [May 18, 2023, 6:11am UTC](https://discourse.julialang.org/t/different-outputs-after-adding-x-axis-coordinates-of-data-in-makie-jl/99037 "2023-05-18T06:11:43Z")

</div>

The outputs are different for the codes below: f = Figure() ax1 = Axis(f\[1, 1\], xgridvisible=false, ygridvisible=false) scatter!(ax1, 0:1e-3:1, ones(1001), markersize=1) f f = Figure() ax1 = Axis(f\[1, 1\], xgridvisib…

---

## [Plotting countries with GeoMakie: reduce size and more](https://discourse.julialang.org/t/plotting-countries-with-geomakie-reduce-size-and-more/97966)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 10\
**Last updated:** [May 17, 2023, 8:14pm UTC](https://discourse.julialang.org/t/plotting-countries-with-geomakie-reduce-size-and-more/97966 "2023-05-17T20:14:56Z")

</div>

I am trying visualize some specific countries with GeoMakie.jl. I 've seen Examples · GeoMakie.jl and I tried to do something similar: begin # Acquire data ger\_states = Downloads.download("https://raw.githubuserconte…

---

## [Change Latex font color in Makie](https://discourse.julialang.org/t/change-latex-font-color-in-makie/98998)

<div class="topic-metadata">

**Author:** [@phymann](https://discourse.julialang.org/u/phymann)\
**Replies:** 1\
**Last updated:** [May 17, 2023, 2:16pm UTC](https://discourse.julialang.org/t/change-latex-font-color-in-makie/98998 "2023-05-17T14:16:15Z")

</div>

Dear all, I’ve searched a lot but still cannot find the solution. How to change axis xlabel and ylabel latex font color, in CairoMakie?

---

## [Fill a bounding box of a text in Makie](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 9\
**Last updated:** [May 16, 2023, 2:08pm UTC](https://discourse.julialang.org/t/fill-a-bounding-box-of-a-text-in-makie/60640 "2023-05-16T14:08:41Z")

</div>

I’d like to add background color to a text object in a Makie plot – fill the bounding box of the text with some color. If I understood it correctly, text does not have a size property, so bb here has size zero: t = tex…

---

## [Web plotting when datapoints \>\> plot pixels](https://discourse.julialang.org/t/web-plotting-when-datapoints-plot-pixels/98915)

<div class="topic-metadata">

**Author:** [@pepijndevos](https://discourse.julialang.org/u/pepijndevos)\
**Replies:** 4\
**Last updated:** [May 16, 2023, 11:21am UTC](https://discourse.julialang.org/t/web-plotting-when-datapoints-plot-pixels/98915 "2023-05-16T11:21:33Z")

</div>

Makie is pretty great for plotting big datasets, in particular the datashader functionality datashader · Makie But in the case of WGLMakie, you would first have to send the dataset to the client, which could be gigabyte…

[Previous page](https://discourse.julialang.org/c/domain/viz/17.md?page=31)

[Next page](https://discourse.julialang.org/c/domain/viz/17.md?page=33)
