# Latest

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

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

**Page:** 1278

---

## [Dual-axis plot breaks with multiple variables on right/secondary y-axis](https://discourse.julialang.org/t/dual-axis-plot-breaks-with-multiple-variables-on-right-secondary-y-axis/64491)

<div class="topic-metadata">

**Author:** [@tai](https://discourse.julialang.org/u/tai)\
**Replies:** 5\
**Last updated:** [September 3, 2021, 1:43am UTC](https://discourse.julialang.org/t/dual-axis-plot-breaks-with-multiple-variables-on-right-secondary-y-axis/64491 "2021-09-03T01:43:31Z")

</div>

I’m facing a garbled plot when I do a dual-axis plot with multiple variables on right/secondary y-axis. Here, I’m trying to do multiple lineplots on top of a barplot. using Plots using Plots.PlotMeasures pyplot() bar(r…

---

## [Understanding Shell Interactions within Julia scripts](https://discourse.julialang.org/t/understanding-shell-interactions-within-julia-scripts/67608)

<div class="topic-metadata">

**Author:** [@mwhisena](https://discourse.julialang.org/u/mwhisena)\
**Replies:** 2\
**Last updated:** [September 3, 2021, 12:53am UTC](https://discourse.julialang.org/t/understanding-shell-interactions-within-julia-scripts/67608 "2021-09-03T00:53:25Z")

</div>

Hello! I am a PhD. student hoping to use Julia for some extensive ML CFD data analysis. I am having trouble with shell scope within a Julia script. I need to source (via Linux bash shell) a bashrc file for OpenFOAM (CFD…

---

## [Precompilation error on FFMPEG and Plots.jl](https://discourse.julialang.org/t/precompilation-error-on-ffmpeg-and-plots-jl/67607)

<div class="topic-metadata">

**Author:** [@karthink](https://discourse.julialang.org/u/karthink)\
**Replies:** 0\
**Last updated:** [September 2, 2021, 11:28pm UTC](https://discourse.julialang.org/t/precompilation-error-on-ffmpeg-and-plots-jl/67607 "2021-09-02T23:28:10Z")

</div>

I’m unable to use Plots.jl or FFMPEG with Julia 1.6.2: julia\> using FFMPEG \[ Info: Precompiling FFMPEG \[c87230d0-a227-11e9-1b43-d7ebe4e7570a\] ERROR: LoadError: InitError: could not load library "/usr/lib/libavdevice.so"…

---

## [Recursively applied 1D function](https://discourse.julialang.org/t/recursively-applied-1d-function/67602)

<div class="topic-metadata">

**Author:** [@cmdenis](https://discourse.julialang.org/u/cmdenis)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 11:17pm UTC](https://discourse.julialang.org/t/recursively-applied-1d-function/67602 "2021-09-02T23:17:15Z")

</div>

Hello, I am trying to compose the same function with itself n times efficiently. I found a way of doing that using macros, but it gave me a lot of problems when being used within functions and using elements that were n…

---

## [Error in CUDA.jl](https://discourse.julialang.org/t/error-in-cuda-jl/65197)

<div class="topic-metadata">

**Author:** [@jmmmachado](https://discourse.julialang.org/u/jmmmachado)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 10:34pm UTC](https://discourse.julialang.org/t/error-in-cuda-jl/65197 "2021-09-02T22:34:20Z")

</div>

Hello everyone! I am having some issues with CUDA.jl. At first I thought it was an issue with the drivers from NVIDIA or the CUDA installation on my PC, so I uninstalled the drivers, the cuda toolkits, everything. Howev…

---

## [Failing test CUDA (obviously LLVM issue)](https://discourse.julialang.org/t/failing-test-cuda-obviously-llvm-issue/67555)

<div class="topic-metadata">

**Author:** [@Dieter](https://discourse.julialang.org/u/Dieter)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 10:33pm UTC](https://discourse.julialang.org/t/failing-test-cuda-obviously-llvm-issue/67555 "2021-09-02T22:33:18Z")

</div>

Hello Community, I tried to test CUDA, unfortunately the test failed. Error Message: test CUDA Testing CUDA Status \`/tmp/jl\_rSX9Mb/Project.toml\` \[79e6a3ab\] Adapt v3.3.1 \[ab4f0b2a\] BFloat16s v0.1.0 \[052…

---

## [Vector comprehensions hamper type inference?](https://discourse.julialang.org/t/vector-comprehensions-hamper-type-inference/67603)

<div class="topic-metadata">

**Author:** [@droodman](https://discourse.julialang.org/u/droodman)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 10:14pm UTC](https://discourse.julialang.org/t/vector-comprehensions-hamper-type-inference/67603 "2021-09-02T22:14:12Z")

</div>

I’m new to Julia, so I post now with uncertainty. I’m finding that vector comprehensions hamper the compiler’s type inference–both about 1) the type of the result of the comprehension and 2) about the type of arguments p…

---

## [Cbc JuMP set constraints](https://discourse.julialang.org/t/cbc-jump-set-constraints/67570)

<div class="topic-metadata">

**Author:** [@giulia](https://discourse.julialang.org/u/giulia)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 10:03pm UTC](https://discourse.julialang.org/t/cbc-jump-set-constraints/67570 "2021-09-02T22:03:59Z")

</div>

Hello, I am trying to create a simple optimization model using JuMP and Cbc. My code is following: using JuMP, Cbc m = Model(Cbc.Optimizer) @variable(m, x1) @variable(m, x2) @constraint(m, constraint1, x1 \* x2 == 1…

---

## [Compute conflict indexed output for gurobi](https://discourse.julialang.org/t/compute-conflict-indexed-output-for-gurobi/67585)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 9:55pm UTC](https://discourse.julialang.org/t/compute-conflict-indexed-output-for-gurobi/67585 "2021-09-02T21:55:13Z")

</div>

Hi All, i am using compute conflict with gurobi the sample code and output is given as @constraint(model,conexisting20\[p in 1:P, b in 1:B\],sum(ME\_B\_O\_20\[b,c,p\]\*C\_s20\[c\] for c in 1:C)==Moves20\[p,b\] ) println("=======…

---

## [\_\_atomic errors when embedding into a C++ project using binaries built from latest (1.7) source or using installer (Windows 10 using Visual Studio 2019)](https://discourse.julialang.org/t/atomic-errors-when-embedding-into-a-c-project-using-binaries-built-from-latest-1-7-source-or-using-installer-windows-10-using-visual-studio-2019/67599)

<div class="topic-metadata">

**Author:** [@solaris](https://discourse.julialang.org/u/solaris)\
**Replies:** 2\
**Last updated:** [September 2, 2021, 9:36pm UTC](https://discourse.julialang.org/t/atomic-errors-when-embedding-into-a-c-project-using-binaries-built-from-latest-1-7-source-or-using-installer-windows-10-using-visual-studio-2019/67599 "2021-09-02T21:36:23Z")

</div>

I get a host of compile errors (about 30). Here are the first 5: 1\>C:\\Users\\VitalRoberto\\AppData\\Local\\Programs\\Julia-1.7.0-beta4\\include\\julia\\julia\_threads.h(321,5): error C2065: ‘\_\_ATOMIC\_SEQ\_CST’: undeclared identi…

---

## [Converting (combined) Pooled DataFrame to Matrix](https://discourse.julialang.org/t/converting-combined-pooled-dataframe-to-matrix/67589)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 8\
**Last updated:** [September 2, 2021, 8:27pm UTC](https://discourse.julialang.org/t/converting-combined-pooled-dataframe-to-matrix/67589 "2021-09-02T20:27:46Z")

</div>

Searchable documentation suggests that a way to convert a DataFrame to a Matrix is just convert(Matrix,df) Previously, this worked with (combined) Pooled DataFrames but something seems to have changed in a recent upda…

---

## [Request: someone to complete the Julia example in the Wikipedia page on multiple dispatch](https://discourse.julialang.org/t/request-someone-to-complete-the-julia-example-in-the-wikipedia-page-on-multiple-dispatch/67597)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 7\
**Last updated:** [September 2, 2021, 8:26pm UTC](https://discourse.julialang.org/t/request-someone-to-complete-the-julia-example-in-the-wikipedia-page-on-multiple-dispatch/67597 "2021-09-02T20:26:25Z")

</div>

The Wikipedia page on multiple dispatch has a complete exsmple in C#, but then in Julia the same exanple is given only as a sketch… could someone that inferstand C# complete the Julia example ? it would then be nice to c…

---

## [Choosing distinct categorical colors that all work with opposing black gradients](https://discourse.julialang.org/t/choosing-distinct-categorical-colors-that-all-work-with-opposing-black-gradients/67596)

<div class="topic-metadata">

**Author:** [@thompsonmj](https://discourse.julialang.org/u/thompsonmj)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 7:54pm UTC](https://discourse.julialang.org/t/choosing-distinct-categorical-colors-that-all-work-with-opposing-black-gradients/67596 "2021-09-02T19:54:42Z")

</div>

I’d like to use something like :batlow to choose 3 categorical colors, each to use in a color gradient against black, but some are too dark for enough contrast. How can I simply lighten the first two? using Plots, Image…

---

## [Environment variable for BLAS.set\_num\_threads default?](https://discourse.julialang.org/t/environment-variable-for-blas-set-num-threads-default/67594)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 6:54pm UTC](https://discourse.julialang.org/t/environment-variable-for-blas-set-num-threads-default/67594 "2021-09-02T18:54:36Z")

</div>

Is there an environment variable that I can set in my .bashrc so I don’t have to manually prevent multiple BLAS threads (BLAS.set\_num\_threads(1)) in every program? I never, ever want BLAS to run in multithreaded mode. I…

---

## [Hypatia sum of squares cone](https://discourse.julialang.org/t/hypatia-sum-of-squares-cone/67523)

<div class="topic-metadata">

**Author:** [@geo](https://discourse.julialang.org/u/geo)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 6:16pm UTC](https://discourse.julialang.org/t/hypatia-sum-of-squares-cone/67523 "2021-09-02T18:16:36Z")

</div>

I want to optimize over sum of squares, but with constraints on the coefficients of the polynomials. I know that this can be done by adding constraints; however, this often seems wasteful. For example I want to restrict …

---

## [Extend density plot line (along 0)](https://discourse.julialang.org/t/extend-density-plot-line-along-0/67561)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 6:01pm UTC](https://discourse.julialang.org/t/extend-density-plot-line-along-0/67561 "2021-09-02T18:01:46Z")

</div>

If I write using StatsPlots density(sqrt.(rand(10000))) density!(sqrt.(2\*rand(10000))) then I get: The plot would be nicer if the blue line extended all the way to the maximum/minimum x values (along 0). Is there an…

---

## [3d Plots with PlotlyJS](https://discourse.julialang.org/t/3d-plots-with-plotlyjs/67543)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 2\
**Last updated:** [September 2, 2021, 5:27pm UTC](https://discourse.julialang.org/t/3d-plots-with-plotlyjs/67543 "2021-09-02T17:27:20Z")

</div>

I can produce beautiful 3d plots with Plots.jl. For example, using Plots x1 = 1:.001:2pi y1 = cos.(1:.001:2pi) z1 = sin.(1:.001:2pi) x2 = 1:.001:2pi y2 = 2\*sin.(1:.001:2pi) z2 = cos.(1:.001:2pi) x3 = 1:.001:2pi y3 =…

---

## [NaN Data Frame with labels and indexes](https://discourse.julialang.org/t/nan-data-frame-with-labels-and-indexes/67588)

<div class="topic-metadata">

**Author:** [@Jdbeck66](https://discourse.julialang.org/u/Jdbeck66)\
**Replies:** 2\
**Last updated:** [September 2, 2021, 4:15pm UTC](https://discourse.julialang.org/t/nan-data-frame-with-labels-and-indexes/67588 "2021-09-02T16:15:31Z")

</div>

I’m trying to make a data frame of NaN with set labels and indexes. I can’t find in the documentation how to do this. Here is what I would do in Pandas: label = \["1T", "1G", "1C", "2T", "2G", "2A"\] rescue\_left = pd.Dat…

---

## [Diffeq trigger callback from inside f](https://discourse.julialang.org/t/diffeq-trigger-callback-from-inside-f/67499)

<div class="topic-metadata">

**Author:** [@levasco](https://discourse.julialang.org/u/levasco)\
**Replies:** 2\
**Last updated:** [September 2, 2021, 4:01pm UTC](https://discourse.julialang.org/t/diffeq-trigger-callback-from-inside-f/67499 "2021-09-02T16:01:53Z")

</div>

I am looking to improve the performance of my ODE. Since the expensive operation g(u,p) (which involves inverting matrices) has to be done anyway to calculate du/dt, I’d like not to have to reevaluate it at every step fo…

---

## [Passing struct vs struct fields as function arguments](https://discourse.julialang.org/t/passing-struct-vs-struct-fields-as-function-arguments/67584)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 5\
**Last updated:** [September 2, 2021, 4:01pm UTC](https://discourse.julialang.org/t/passing-struct-vs-struct-fields-as-function-arguments/67584 "2021-09-02T16:01:36Z")

</div>

Hi, I have noticed that passing struct fields as function arguments generally results in better performance compared to passing the struct directly. For instance, using BenchmarkTools; using Random; struct MyStruct …

---

## [PyCall error I don't understand](https://discourse.julialang.org/t/pycall-error-i-dont-understand/67571)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 3:35pm UTC](https://discourse.julialang.org/t/pycall-error-i-dont-understand/67571 "2021-09-02T15:35:01Z")

</div>

Hi all, I’ve got an error I don’t understand. It happends every couple of minutes. Can anyone help? So what I did: I use PyCall.jl with boto3 to upload to s3. Before that I use JSON.jl to serialise. The data structure…

---

## [Julia vs C++ speed](https://discourse.julialang.org/t/julia-vs-c-speed/67219)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 21\
**Last updated:** [September 2, 2021, 3:25pm UTC](https://discourse.julialang.org/t/julia-vs-c-speed/67219 "2021-09-02T15:25:46Z")

</div>

Hi! I am currently doing a very “nice” project of converting algorithms written in Julia to C++ :cry: I need those algorithms in an embedded environment and, unfortunately, Julia cannot generate compiled code that can b…

---

## [Avoiding memory allocation with function passed as argument](https://discourse.julialang.org/t/avoiding-memory-allocation-with-function-passed-as-argument/67494)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 14\
**Last updated:** [September 2, 2021, 3:19pm UTC](https://discourse.julialang.org/t/avoiding-memory-allocation-with-function-passed-as-argument/67494 "2021-09-02T15:19:56Z")

</div>

Consider the code at the bottom. The actual case is more complex, so something that does not depend on the definition of the function A would be appreciated. This gives the time and allocation numbers below. Presumabl…

---

## [\[ANN\] SparkSQL.jl release 1.1.0](https://discourse.julialang.org/t/ann-sparksql-jl-release-1-1-0/67521)

<div class="topic-metadata">

**Author:** [@propelledanalytics](https://discourse.julialang.org/u/propelledanalytics)\
**Replies:** 0\
**Last updated:** [September 1, 2021, 5:05pm UTC](https://discourse.julialang.org/t/ann-sparksql-jl-release-1-1-0/67521 "2021-09-01T17:05:02Z")

</div>

This post is announcing the release of SparkSQL.jl version 1.1.0. SparkSQL.jl is software that enables Julia programs to work with Apache Spark using just SQL. Apache Spark is one of the world’s most ubiquitous open-s…

---

## [Way to give DataFrame columns nicknames?](https://discourse.julialang.org/t/way-to-give-dataframe-columns-nicknames/67575)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 8\
**Last updated:** [September 2, 2021, 2:40pm UTC](https://discourse.julialang.org/t/way-to-give-dataframe-columns-nicknames/67575 "2021-09-02T14:40:57Z")

</div>

I am importing data from Excel into a DataFrame. The column headers are long specific names with spaces and units. They are a pain to work with because every time I need to access that column, I have to type df."Long Spe…

---

## [Retrieve the type of \`AbstractDict\` (without parameters) from a concrete dictionary type](https://discourse.julialang.org/t/retrieve-the-type-of-abstractdict-without-parameters-from-a-concrete-dictionary-type/67567)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 1:07pm UTC](https://discourse.julialang.org/t/retrieve-the-type-of-abstractdict-without-parameters-from-a-concrete-dictionary-type/67567 "2021-09-02T13:07:43Z")

</div>

I want a function that takes an AbstractDict (it might be either Dict, an OrderedDict, etc.), and returns a dictionary of the same type, except for its parameters (the types of keys and values may differ). I fancied that…

---

## [Set assumption to symbolic variable](https://discourse.julialang.org/t/set-assumption-to-symbolic-variable/67569)

<div class="topic-metadata">

**Author:** [@vinicius\_de\_lima](https://discourse.julialang.org/u/vinicius_de_lima)\
**Replies:** 1\
**Last updated:** [September 2, 2021, 12:41pm UTC](https://discourse.julialang.org/t/set-assumption-to-symbolic-variable/67569 "2021-09-02T12:41:02Z")

</div>

There is a way to assume a symbolic variable as an natural number using ModelingToolkit.jl? I’m trying to raise an 2x2 matrix to an natural number as follows: using LinearAlgebra using ModelingToolkit @variables n A =…

---

## [How to plot a matrix as an image (greyscale)](https://discourse.julialang.org/t/how-to-plot-a-matrix-as-an-image-greyscale/34147)

<div class="topic-metadata">

**Author:** [@Ujku\_KU](https://discourse.julialang.org/u/Ujku_KU)\
**Replies:** 4\
**Last updated:** [September 2, 2021, 12:21pm UTC](https://discourse.julialang.org/t/how-to-plot-a-matrix-as-an-image-greyscale/34147 "2021-09-02T12:21:05Z")

</div>

Hi guys, my question is how to plot a matrix as an image in greyscale? I saw the version with ‘Gadfly’ and worked for me but it was in bluescale. Thank you very much in advance for your support. Cheers. Ergnoor

---

## [Cannot update package in empty environment](https://discourse.julialang.org/t/cannot-update-package-in-empty-environment/67565)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [September 2, 2021, 11:49am UTC](https://discourse.julialang.org/t/cannot-update-package-in-empty-environment/67565 "2021-09-02T11:49:41Z")

</div>

I want to update a package to the most recent version. For some reason, the most recent version does not seem to be recognized. Here is an example using an empty environment: (@v1.6) pkg\> st Status \`~/.julia/envir…

---

## [Julia sum issue](https://discourse.julialang.org/t/julia-sum-issue/67566)

<div class="topic-metadata">

**Author:** [@manoj.centura](https://discourse.julialang.org/u/manoj.centura)\
**Replies:** 2\
**Last updated:** [September 2, 2021, 11:48am UTC](https://discourse.julialang.org/t/julia-sum-issue/67566 "2021-09-02T11:48:30Z")

</div>

Hi In the below code I am getting wrong summation output zz=sum((M\_B\_DG\_400\[bb,t,c,p\]\*C\_s\[c\]) for p in 1:P, t in 1:T, bb in 1:b) if the value of M\_B\_DG\_400\[bb,t,c,p\] is zero then value zz should be zero. But it is not…

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

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