# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1079

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

**Page:** 1080

---

## [The photo is from a Python code so how could I have the same result in Julia?](https://discourse.julialang.org/t/the-photo-is-from-a-python-code-so-how-could-i-have-the-same-result-in-julia/78831)

<div class="topic-metadata">

**Author:** [@Lamis\_Njeh](https://discourse.julialang.org/u/Lamis_Njeh)\
**Replies:** 6\
**Last updated:** [April 1, 2022, 6:03pm UTC](https://discourse.julialang.org/t/the-photo-is-from-a-python-code-so-how-could-i-have-the-same-result-in-julia/78831 "2022-04-01T18:03:53Z")

</div>

---

## [Precompile: Why?](https://discourse.julialang.org/t/precompile-why/78770)

<div class="topic-metadata">

**Author:** [@chelseas](https://discourse.julialang.org/u/chelseas)\
**Replies:** 30\
**Last updated:** [April 1, 2022, 5:50pm UTC](https://discourse.julialang.org/t/precompile-why/78770 "2022-04-01T17:50:57Z")

</div>

For compiled languages like C++, you generally use external libraries that you download in a format that is already compiled. Then you compile your own code when you want to run it. This takes time, but it’s just part of…

---

## [Joining arrays of vectors of abritrary lengths](https://discourse.julialang.org/t/joining-arrays-of-vectors-of-abritrary-lengths/78880)

<div class="topic-metadata">

**Author:** [@juham58](https://discourse.julialang.org/u/juham58)\
**Replies:** 3\
**Last updated:** [April 1, 2022, 4:54pm UTC](https://discourse.julialang.org/t/joining-arrays-of-vectors-of-abritrary-lengths/78880 "2022-04-01T16:54:01Z")

</div>

Hi, I need to use arrays in which each element is a vector of arbitrary length. In itself, it works fine but when I try to append! an element to another array of vectors, it appends the vector to every elements of the t…

---

## [Representing Charts (Differential Geometry)](https://discourse.julialang.org/t/representing-charts-differential-geometry/78882)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 0\
**Last updated:** [April 1, 2022, 4:46pm UTC](https://discourse.julialang.org/t/representing-charts-differential-geometry/78882 "2022-04-01T16:46:02Z")

</div>

Hi! I’m trying to implement local charts, like in differential geometry. And I’m not really sure what would be the best way to do it in Julia. A chart is a pair (U, f), U is an open set and f is a function from the open…

---

## [Custom grid in Plots.jl](https://discourse.julialang.org/t/custom-grid-in-plots-jl/78877)

<div class="topic-metadata">

**Author:** [@stepanzh](https://discourse.julialang.org/u/stepanzh)\
**Replies:** 1\
**Last updated:** [April 1, 2022, 3:56pm UTC](https://discourse.julialang.org/t/custom-grid-in-plots-jl/78877 "2022-04-01T15:56:34Z")

</div>

I’m using Plots.jl and want to specify grid as shown in the picture below I have small experience with the package. So, how can I draw the grid? Built-in properties? Third-party addons for Plots.jl? Imitate the grid…

---

## [Symbol to color in heatmap plot](https://discourse.julialang.org/t/symbol-to-color-in-heatmap-plot/78839)

<div class="topic-metadata">

**Author:** [@lsaravia](https://discourse.julialang.org/u/lsaravia)\
**Replies:** 1\
**Last updated:** [April 1, 2022, 3:48pm UTC](https://discourse.julialang.org/t/symbol-to-color-in-heatmap-plot/78839 "2022-04-01T15:48:48Z")

</div>

I have a Symbol matrix that could have 3 Symbols say :Ø,:F, :V but sometimes have not all the symbols how to plot it with the same colors? m = fill(:Ø, 10, 10) heatmap(m,aspect\_ratio=1,legend=:none,xticks=:none, ytick…

---

## [I am having a versioning problem](https://discourse.julialang.org/t/i-am-having-a-versioning-problem/78866)

<div class="topic-metadata">

**Author:** [@matthiashimmelmann](https://discourse.julialang.org/u/matthiashimmelmann)\
**Replies:** 10\
**Last updated:** [April 1, 2022, 2:17pm UTC](https://discourse.julialang.org/t/i-am-having-a-versioning-problem/78866 "2022-04-01T14:17:24Z")

</div>

I am maintaining the package Implicit3DPlotting (currently @0.2.2 in the registry) and I recently discovered that when adding from the registry, the old version 0.1.6 gets installed. Even when adding specific versions to…

---

## [Counting special characters ü, å, ø, etc](https://discourse.julialang.org/t/counting-special-characters-u-a-o-etc/78858)

<div class="topic-metadata">

**Author:** [@etas](https://discourse.julialang.org/u/etas)\
**Replies:** 11\
**Last updated:** [April 1, 2022, 1:25pm UTC](https://discourse.julialang.org/t/counting-special-characters-u-a-o-etc/78858 "2022-04-01T13:25:17Z")

</div>

Hi, I have some strings with a name and a distance such as "Haugastøl, Km 0". I want to remove the km point with the chop() function but what’s interesting is that chop() and length() count ø as one character but not fin…

---

## [How to use distributed and pmap across GPU cores](https://discourse.julialang.org/t/how-to-use-distributed-and-pmap-across-gpu-cores/78852)

<div class="topic-metadata">

**Author:** [@Nadou407](https://discourse.julialang.org/u/Nadou407)\
**Replies:** 2\
**Last updated:** [April 1, 2022, 1:04pm UTC](https://discourse.julialang.org/t/how-to-use-distributed-and-pmap-across-gpu-cores/78852 "2022-04-01T13:04:25Z")

</div>

Hi all, I’m still new to Julia GPU and Julia in general so got quite confused about how to do parallel computation using a GPU. Any help would be greatly appreciated! My current code (a simple example) using 20 CPU cor…

---

## [Resizing images in docs](https://discourse.julialang.org/t/resizing-images-in-docs/21721)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 19\
**Last updated:** [March 11, 2019, 7:23pm UTC](https://discourse.julialang.org/t/resizing-images-in-docs/21721 "2019-03-11T19:23:55Z")

</div>

Is there a way to control the image size of images in documentation made with Documenter? I created this Map projections example but the images are too big. Found this page about styling images with Markdown but none of…

---

## [inv(I::UniformScaling{Bool}) = UniformScaling{Float64}](https://discourse.julialang.org/t/inv-i-uniformscaling-bool-uniformscaling-float64/78854)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 2\
**Last updated:** [April 1, 2022, 11:31am UTC](https://discourse.julialang.org/t/inv-i-uniformscaling-bool-uniformscaling-float64/78854 "2022-04-01T11:31:32Z")

</div>

This seems like it shouldn’t convert to a UniformScaling{Float64}: julia\> inv(I) UniformScaling{Float64} 1.0\*I at least I don’t see a reason for this and it could cause some type instabilities!? Possibly there is a rea…

---

## [How to get links when using @which in REPL](https://discourse.julialang.org/t/how-to-get-links-when-using-which-in-repl/78855)

<div class="topic-metadata">

**Author:** [@Rex\_Wang](https://discourse.julialang.org/u/Rex_Wang)\
**Replies:** 3\
**Last updated:** [April 1, 2022, 11:10am UTC](https://discourse.julialang.org/t/how-to-get-links-when-using-which-in-repl/78855 "2022-04-01T11:10:06Z")

</div>

When typing @which(occursin(1)) in Jupyter-notebook, I get the following occursin(haystack) in Base at strings/search.jl:635 However, typing the same message in REPL, I get only plain text occursin(haystack) in Bas…

---

## [Debugging distributed code](https://discourse.julialang.org/t/debugging-distributed-code/78857)

<div class="topic-metadata">

**Author:** [@Casper](https://discourse.julialang.org/u/Casper)\
**Replies:** 0\
**Last updated:** [April 1, 2022, 9:23am UTC](https://discourse.julialang.org/t/debugging-distributed-code/78857 "2022-04-01T09:23:41Z")

</div>

The build in debugger from VSCode gets lost once a distributed process is started, is there a way to debug distributed code?

---

## [Strange error](https://discourse.julialang.org/t/strange-error/78851)

<div class="topic-metadata">

**Author:** [@RogerP](https://discourse.julialang.org/u/RogerP)\
**Replies:** 3\
**Last updated:** [April 1, 2022, 8:27am UTC](https://discourse.julialang.org/t/strange-error/78851 "2022-04-01T08:27:48Z")

</div>

Could someone explain to me what is happening here? Try running mwe1() and then mwe2() function mwe1() initfloat::Vector{Float64} = zeros(1) Φ::Vector{Float64} = initfloat Θ̇::Vector{Float64} = i…

---

## [An idea for putting imports inside of Julia functions](https://discourse.julialang.org/t/an-idea-for-putting-imports-inside-of-julia-functions/78840)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 2\
**Last updated:** [April 1, 2022, 6:13am UTC](https://discourse.julialang.org/t/an-idea-for-putting-imports-inside-of-julia-functions/78840 "2022-04-01T06:13:37Z")

</div>

I’ve often wanted to put imports inside of functions to delay loading potentially slow-to-load packages until I really need them in a given session (a habit from Python, but maybe even more useful in Julia due to latency…

---

## [Comparison between Nonconvex.jl, JuMP and CasADi for large sparse nonlinear optimization](https://discourse.julialang.org/t/comparison-between-nonconvex-jl-jump-and-casadi-for-large-sparse-nonlinear-optimization/78825)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 8\
**Last updated:** [April 1, 2022, 3:05am UTC](https://discourse.julialang.org/t/comparison-between-nonconvex-jl-jump-and-casadi-for-large-sparse-nonlinear-optimization/78825 "2022-04-01T03:05:23Z")

</div>

I have an example which implements time-optimal control for Dubins vehicle. I have found that Nonconvex.jl is slower than JuMP. I think it is because Nonconvex.jl does not provide sparsity information to Ipopt. The nonze…

---

## [Can't update Pluto](https://discourse.julialang.org/t/cant-update-pluto/78843)

<div class="topic-metadata">

**Author:** [@Hayder](https://discourse.julialang.org/u/Hayder)\
**Replies:** 2\
**Last updated:** [April 1, 2022, 1:31am UTC](https://discourse.julialang.org/t/cant-update-pluto/78843 "2022-04-01T01:31:32Z")

</div>

Hello. Currently, I’m having trouble with updating Pluto. I have naturally searched this forum for possible answers, and following here will be the problem as well as attempts to solve it. Issue: Attempting to updat…

---

## [How to plot in grayscale with gadfly?](https://discourse.julialang.org/t/how-to-plot-in-grayscale-with-gadfly/78780)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 3\
**Last updated:** [March 31, 2022, 11:17pm UTC](https://discourse.julialang.org/t/how-to-plot-in-grayscale-with-gadfly/78780 "2022-03-31T23:17:48Z")

</div>

Hi, I have some code roughly like this: using DataFrames using Gadfly df = DataFrame( :percent\_barrier =\> sqrt.(rand(100)) .\* 100, :stop\_reason =\> ifelse.(rand(100) .\> 0.75, "Solved", "Timeout") ) plot( df,…

---

## [Modelling constant phase elements with ModellingToolkit](https://discourse.julialang.org/t/modelling-constant-phase-elements-with-modellingtoolkit/78754)

<div class="topic-metadata">

**Author:** [@FTACV](https://discourse.julialang.org/u/FTACV)\
**Replies:** 8\
**Last updated:** [March 31, 2022, 11:14pm UTC](https://discourse.julialang.org/t/modelling-constant-phase-elements-with-modellingtoolkit/78754 "2022-03-31T23:14:26Z")

</div>

Hi all, I’m attempting to very slightly extend the example given \[here\](https://mtk.sciml.ai/dev/tutorials/acausal\_components/) to include a constant phase element. The constant phase element simulation in the time doma…

---

## [A string related MAT file question](https://discourse.julialang.org/t/a-string-related-mat-file-question/78836)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 2\
**Last updated:** [March 31, 2022, 8:27pm UTC](https://discourse.julialang.org/t/a-string-related-mat-file-question/78836 "2022-03-31T20:27:35Z")

</div>

My variables are stored as Var1 and Var2 in my MAT file. My goal is to write a loop so that I can read them out one at a time. Why doesn’t the below work? using MAT; F1 = matopen("Path1/File1.mat"); for i ∈ \["Var1", "V…

---

## [Strategies to use ReverseDiff.jl with NamedTuples (or ComponentArrays)](https://discourse.julialang.org/t/strategies-to-use-reversediff-jl-with-namedtuples-or-componentarrays/78760)

<div class="topic-metadata">

**Author:** [@roualdes](https://discourse.julialang.org/u/roualdes)\
**Replies:** 5\
**Last updated:** [March 31, 2022, 8:21pm UTC](https://discourse.julialang.org/t/strategies-to-use-reversediff-jl-with-namedtuples-or-componentarrays/78760 "2022-03-31T20:21:36Z")

</div>

It seems like ReverseDiff.jl can be used on functions that accept NamedTuples, for instance in LogDensityProblems.jl and TransformVariables.jl, but I can’t figure out the details. Will you help me understand how I could…

---

## [Changing the Layout of a Corrplot/Cornerplot Outputs](https://discourse.julialang.org/t/changing-the-layout-of-a-corrplot-cornerplot-outputs/78834)

<div class="topic-metadata">

**Author:** [@YummyPampers2](https://discourse.julialang.org/u/YummyPampers2)\
**Replies:** 0\
**Last updated:** [March 31, 2022, 8:02pm UTC](https://discourse.julialang.org/t/changing-the-layout-of-a-corrplot-cornerplot-outputs/78834 "2022-03-31T20:02:18Z")

</div>

Hello Julians: I am working with dataset similar to the commonly used for IRIS as: using RDatasets, using PlotlyJS, using StatsPlots const stp = StatsPlots iris = dataset("datasets","iris") plotlyjs() @df iris s…

---

## [Help me outperform Matlab in numerical solution of semidiscretized PDE system as much as possible](https://discourse.julialang.org/t/help-me-outperform-matlab-in-numerical-solution-of-semidiscretized-pde-system-as-much-as-possible/76777)

<div class="topic-metadata">

**Author:** [@RobertS](https://discourse.julialang.org/u/RobertS)\
**Replies:** 26\
**Last updated:** [March 31, 2022, 7:30pm UTC](https://discourse.julialang.org/t/help-me-outperform-matlab-in-numerical-solution-of-semidiscretized-pde-system-as-much-as-possible/76777 "2022-03-31T19:30:44Z")

</div>

I am new to Julia and I am considering to adopt it in my professional life, where I often have to solve systems of partial differential equations (often mixed with algebraic and ordinary differential equations). I typic…

---

## [Help me in machine learning](https://discourse.julialang.org/t/help-me-in-machine-learning/78832)

<div class="topic-metadata">

**Author:** [@Lamis\_Njeh](https://discourse.julialang.org/u/Lamis_Njeh)\
**Replies:** 2\
**Last updated:** [March 31, 2022, 7:06pm UTC](https://discourse.julialang.org/t/help-me-in-machine-learning/78832 "2022-03-31T19:06:49Z")

</div>

I whould like to check every single value in my dataset if it’s a NaN or not in julia and put it in an other dataset like in the photo in pyhton they use for that “”" df.isna()“”"

---

## [Error in mean value of sparse arrays](https://discourse.julialang.org/t/error-in-mean-value-of-sparse-arrays/78796)

<div class="topic-metadata">

**Author:** [@nbakas](https://discourse.julialang.org/u/nbakas)\
**Replies:** 5\
**Last updated:** [March 31, 2022, 6:20pm UTC](https://discourse.julialang.org/t/error-in-mean-value-of-sparse-arrays/78796 "2022-03-31T18:20:03Z")

</div>

in the following code, I noticed two errors: the mean value of the positive elements is less than the mean value including zeros the mean value obtained from the loop is different than the mean value from the function …

---

## [I get a dead lock with only one lock](https://discourse.julialang.org/t/i-get-a-dead-lock-with-only-one-lock/78788)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 15\
**Last updated:** [March 31, 2022, 6:13pm UTC](https://discourse.julialang.org/t/i-get-a-dead-lock-with-only-one-lock/78788 "2022-03-31T18:13:44Z")

</div>

Hi all :slight\_smile: I’ve got the following in one of my pkgs. I put a print before and after. But one in 100 run it just stops there and does not print the second time. I’m kinda clueless how to debug this problem eve…

---

## [Change xlabel position](https://discourse.julialang.org/t/change-xlabel-position/78812)

<div class="topic-metadata">

**Author:** [@jewh](https://discourse.julialang.org/u/jewh)\
**Replies:** 2\
**Last updated:** [March 31, 2022, 5:28pm UTC](https://discourse.julialang.org/t/change-xlabel-position/78812 "2022-03-31T17:28:45Z")

</div>

How can I adjust the position of the x-label in a plot using Plots.jl? e.g. if I do using Plots gr() # making it explicit I'm using the GR backend plot(1:10, rand(1:2, 10)) xlabel!("my nice xlabel") I get a plot with …

---

## [Legend grows outside the image](https://discourse.julialang.org/t/legend-grows-outside-the-image/78823)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 1\
**Last updated:** [March 31, 2022, 5:05pm UTC](https://discourse.julialang.org/t/legend-grows-outside-the-image/78823 "2022-03-31T17:05:51Z")

</div>

I realized that when using Plots with GR the legend can grow outside the image. Is there a way to center the legend? The right edge of the legend seems to be fixed at the center of the image as it grows. plot(rand(10)…

---

## [Package developers: what version of Julia to run tests on?](https://discourse.julialang.org/t/package-developers-what-version-of-julia-to-run-tests-on/78828)

<div class="topic-metadata">

**Author:** [@vtjeng](https://discourse.julialang.org/u/vtjeng)\
**Replies:** 1\
**Last updated:** [March 31, 2022, 4:46pm UTC](https://discourse.julialang.org/t/package-developers-what-version-of-julia-to-run-tests-on/78828 "2022-03-31T16:46:23Z")

</div>

I recently realized that the Julia LTS version is now 1.6 rather than 1.0 (Julia v1.7.0 has been released and v1.6 is now LTS). As a package developer, what version of Julia should I be having my tests run on? Today, I …

---

## [Poll: speed vs accuracy for \`Float64^-3\`](https://discourse.julialang.org/t/poll-speed-vs-accuracy-for-float64-3/77619)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 55\
**Last updated:** [March 31, 2022, 4:01pm UTC](https://discourse.julialang.org/t/poll-speed-vs-accuracy-for-float64-3/77619 "2022-03-31T16:01:23Z")

</div>

In Julia 1.8, we are getting a pure Julia pow function, and as discussed in https://github.com/JuliaLang/julia/pull/44529, part of this involved fixing a bug in x^-3. Before 1.8, Julia’s Literal pow meant that 10^-3 = 0…

[Previous page](https://discourse.julialang.org/latest.md?page=1078)

[Next page](https://discourse.julialang.org/latest.md?page=1080)
