# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=624

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

**Page:** 625

---

## [Add to subplots within a loop using Plots.jl?](https://discourse.julialang.org/t/add-to-subplots-within-a-loop-using-plots-jl/57739)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 2\
**Last updated:** [March 22, 2021, 6:36pm UTC](https://discourse.julialang.org/t/add-to-subplots-within-a-loop-using-plots-jl/57739 "2021-03-22T18:36:57Z")

</div>

I am trying to plot some data I have and am having trouble with using subplots. The way things are structured, I need to be able to add data to each subplot incrementally within a loop, then combine into a final plot aft…

---

## [Optimizing an ODEProblem with Threads?](https://discourse.julialang.org/t/optimizing-an-odeproblem-with-threads/57732)

<div class="topic-metadata">

**Author:** [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Replies:** 1\
**Last updated:** [March 22, 2021, 4:14pm UTC](https://discourse.julialang.org/t/optimizing-an-odeproblem-with-threads/57732 "2021-03-22T16:14:58Z")

</div>

I have a sizable (402) ODE system which comes from the discretization of a parabolic PDE (Beeler-Reuter model in 1D); in the past I used ModelingToolkit to optimize my poorly written in-place function by evaluating it ov…

---

## [Xticks in month format](https://discourse.julialang.org/t/xticks-in-month-format/57721)

<div class="topic-metadata">

**Author:** [@dires](https://discourse.julialang.org/u/dires)\
**Replies:** 2\
**Last updated:** [March 22, 2021, 3:51pm UTC](https://discourse.julialang.org/t/xticks-in-month-format/57721 "2021-03-22T15:51:39Z")

</div>

Hi I am working on a yearly planning model in hourly resolution, and I want to plot the result with the X-axis in months, not in hours. how can I do my plots in Gadfly?

---

## [Save log in vscode windows](https://discourse.julialang.org/t/save-log-in-vscode-windows/57726)

<div class="topic-metadata">

**Author:** [@virgile-baudrot](https://discourse.julialang.org/u/virgile-baudrot)\
**Replies:** 0\
**Last updated:** [March 22, 2021, 3:20pm UTC](https://discourse.julialang.org/t/save-log-in-vscode-windows/57726 "2021-03-22T15:20:07Z")

</div>

Is there a simple way to save the REPL logs (in vscode under windows) or better to see a lot more lines (without changing the font-size)? It’s to see the first lines of a bugs, but the red lines quickly disappear in a f…

---

## [Expectation of multidimensional value function with discrete states](https://discourse.julialang.org/t/expectation-of-multidimensional-value-function-with-discrete-states/57570)

<div class="topic-metadata">

**Author:** [@dadada\_dadada](https://discourse.julialang.org/u/dadada_dadada)\
**Replies:** 18\
**Last updated:** [March 22, 2021, 1:43pm UTC](https://discourse.julialang.org/t/expectation-of-multidimensional-value-function-with-discrete-states/57570 "2021-03-22T13:43:44Z")

</div>

Hello, I have a dynamic programming problem in which I need to calculate the conditional expectation of the next period value function of my problem. The expectation is conditional on my current states and action, and …

---

## [ForwardDiff.jl and \`@printf\`](https://discourse.julialang.org/t/forwarddiff-jl-and-printf/57694)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 3\
**Last updated:** [March 22, 2021, 1:02pm UTC](https://discourse.julialang.org/t/forwarddiff-jl-and-printf/57694 "2021-03-22T13:02:26Z")

</div>

What are best practices regarding automatic differentiation of functions that print some intermediate results using ForwardDiff.jl? For example, using Julia v1.6.0-rc3 and ForwardDiff.jl v0.10.17, I get julia\> using For…

---

## [Promote\_shape dimension mismatch](https://discourse.julialang.org/t/promote-shape-dimension-mismatch/57529)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 17\
**Last updated:** [March 20, 2021, 5:58pm UTC](https://discourse.julialang.org/t/promote-shape-dimension-mismatch/57529 "2021-03-20T17:58:11Z")

</div>

Hey, I saw an error message: ERROR: LoadError: DimensionMismatch("dimensions must match: a has dims (Base.OneTo(2), Base.OneTo(3), Base.OneTo(2), Base.OneTo(6)), b has dims (Base.OneTo(2), Base.OneTo(3), Base.OneTo(2),…

---

## [OrderedCollections vs DataStructures](https://discourse.julialang.org/t/orderedcollections-vs-datastructures/57658)

<div class="topic-metadata">

**Author:** [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)\
**Replies:** 2\
**Last updated:** [March 22, 2021, 9:53am UTC](https://discourse.julialang.org/t/orderedcollections-vs-datastructures/57658 "2021-03-22T09:53:47Z")

</div>

In OrderedCollections page, it says it was split from DataStructures without giving more detail. Which one should I use in which case?

---

## [Accelerating computations Neural Network](https://discourse.julialang.org/t/accelerating-computations-neural-network/57670)

<div class="topic-metadata">

**Author:** [@moby75](https://discourse.julialang.org/u/moby75)\
**Replies:** 6\
**Last updated:** [March 22, 2021, 7:30am UTC](https://discourse.julialang.org/t/accelerating-computations-neural-network/57670 "2021-03-22T07:30:02Z")

</div>

I am new to Julia and to Cuda programming. I am using Julia 1.0.5. I wrote a code to do neural network inferences: it consists on a series of multiplications (neural network weights\* Input/layers) and adding Biases. I …

---

## [Why does using keys() on an array produce LinearIndices?](https://discourse.julialang.org/t/why-does-using-keys-on-an-array-produce-linearindices/57618)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 7\
**Last updated:** [March 22, 2021, 5:02am UTC](https://discourse.julialang.org/t/why-does-using-keys-on-an-array-produce-linearindices/57618 "2021-03-22T05:02:24Z")

</div>

Suppose I had the following array and used keys() to extract the indices: trance\_singers = String\["Emma Hewitt","Carrie skipper","Justine Suissa"\] println(typeof(keys(singers))) # LinearIndices{1,Tuple{Base.OneTo{Int32}…

---

## [How to attach to an existing remote REPL?](https://discourse.julialang.org/t/how-to-attach-to-an-existing-remote-repl/27608)

<div class="topic-metadata">

**Author:** [@csavorgn](https://discourse.julialang.org/u/csavorgn)\
**Replies:** 23\
**Last updated:** [March 22, 2021, 5:01am UTC](https://discourse.julialang.org/t/how-to-attach-to-an-existing-remote-repl/27608 "2021-03-22T05:01:07Z")

</div>

Hi, In my workflow I need to run several simulations which make use of the DifferentialEquations package. To automate running the simulations I need to start the simulations from command line (and not within the Julia …

---

## [Julia not able to convert Array to a series data for plotting](https://discourse.julialang.org/t/julia-not-able-to-convert-array-to-a-series-data-for-plotting/57669)

<div class="topic-metadata">

**Author:** [@oo92](https://discourse.julialang.org/u/oo92)\
**Replies:** 22\
**Last updated:** [March 22, 2021, 2:30am UTC](https://discourse.julialang.org/t/julia-not-able-to-convert-array-to-a-series-data-for-plotting/57669 "2021-03-22T02:30:52Z")

</div>

I am trying to plot a dataframe I created from an existing dataframe. Basically I just took about 5 rows and all N-4 columns and created a new dataframe. I wanted to plot this but Julia (on Pluto.jl) is throwing this err…

---

## [Pluto.jl throws a multiple assigning error when trying to change the values of a variable](https://discourse.julialang.org/t/pluto-jl-throws-a-multiple-assigning-error-when-trying-to-change-the-values-of-a-variable/57665)

<div class="topic-metadata">

**Author:** [@oo92](https://discourse.julialang.org/u/oo92)\
**Replies:** 1\
**Last updated:** [March 21, 2021, 7:28pm UTC](https://discourse.julialang.org/t/pluto-jl-throws-a-multiple-assigning-error-when-trying-to-change-the-values-of-a-variable/57665 "2021-03-21T19:28:08Z")

</div>

In Python, if you have a variable numbers = 5 and then in the next like you write numbers = 55 , the variable’s value is updated. While using Pluto.jl, I declared a variable called y\_axis . I decided to change the value…

---

## [Functions in Type Declarations](https://discourse.julialang.org/t/functions-in-type-declarations/57632)

<div class="topic-metadata">

**Author:** [@andenrx](https://discourse.julialang.org/u/andenrx)\
**Replies:** 5\
**Last updated:** [March 21, 2021, 6:17pm UTC](https://discourse.julialang.org/t/functions-in-type-declarations/57632 "2021-03-21T18:17:45Z")

</div>

Is there anyway to call functions in type declarations? For example, something like struct ChildParent{T} child::Type{T} parent::Type{supertype{T}} end This throws MethodError: no method matching supertype(::T…

---

## [Advanced Julia Tutorials](https://discourse.julialang.org/t/advanced-julia-tutorials/25633)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 12\
**Last updated:** [March 21, 2021, 5:00pm UTC](https://discourse.julialang.org/t/advanced-julia-tutorials/25633 "2021-03-21T17:00:07Z")

</div>

I have been able to find a wide range of “getting started” guides to Julia, but I am at a point where I would like to learn more advanced features, for example, designing systems leveraging multiple inheritance, macros, …

---

## [Help question with running Stan.jl in VSCode on Windows](https://discourse.julialang.org/t/help-question-with-running-stan-jl-in-vscode-on-windows/57571)

<div class="topic-metadata">

**Author:** [@goedman](https://discourse.julialang.org/u/goedman)\
**Replies:** 10\
**Last updated:** [March 21, 2021, 3:17pm UTC](https://discourse.julialang.org/t/help-question-with-running-stan-jl-in-vscode-on-windows/57571 "2021-03-21T15:17:38Z")

</div>

Hi, When I run below script in VSCode on Windows: using CmdStan, Statistics bm = " data { int\<lower=1\> N; int\<lower=0,upper=1\> y\[N\]; } parameters { real\<lower=0,upper=1\> theta; } model { t…

---

## [Does specifying the element type of a Channel impact performance?](https://discourse.julialang.org/t/does-specifying-the-element-type-of-a-channel-impact-performance/57653)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [March 21, 2021, 1:19pm UTC](https://discourse.julialang.org/t/does-specifying-the-element-type-of-a-channel-impact-performance/57653 "2021-03-21T13:19:04Z")

</div>

julia\> a = ones(2,2); julia\> ct = Channel{Matrix{Float64}}(1) Channel{Array{Float64,2}}(sz\_max:1,sz\_curr:0) julia\> @btime (put!($ct, $a); take!($ct);); 283.612 ns (0 allocations: 0 bytes) julia\> c = Channel{Any}(1);…

---

## [Newbie: Gradient of a gradient performance in Zygote](https://discourse.julialang.org/t/newbie-gradient-of-a-gradient-performance-in-zygote/57593)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 2\
**Last updated:** [March 21, 2021, 12:10pm UTC](https://discourse.julialang.org/t/newbie-gradient-of-a-gradient-performance-in-zygote/57593 "2021-03-21T12:10:45Z")

</div>

Hi I am a newbie to Julia. I am trying to implement a piece of code as below. I was wondering if there is a way to improve the performance of gradient of a gradient. Note: for simplicity, both x and y are the same arra…

---

## [Julia reporting an extra ) when it doesn't exist](https://discourse.julialang.org/t/julia-reporting-an-extra-when-it-doesnt-exist/57644)

<div class="topic-metadata">

**Author:** [@oo92](https://discourse.julialang.org/u/oo92)\
**Replies:** 6\
**Last updated:** [March 21, 2021, 8:50am UTC](https://discourse.julialang.org/t/julia-reporting-an-extra-when-it-doesnt-exist/57644 "2021-03-21T08:50:05Z")

</div>

I have this for loop in Julia: for country in countries\_data\_labels new\_dataframe = get\_country(df, country) new\_dataframe = DataFrame(new\_dataframe) df\_rows, df\_columns = size(new\_dataframe)…

---

## [Julia for real time, worried about the garbage collector](https://discourse.julialang.org/t/julia-for-real-time-worried-about-the-garbage-collector/34654)

<div class="topic-metadata">

**Author:** [@gosim](https://discourse.julialang.org/u/gosim)\
**Replies:** 48\
**Last updated:** [March 21, 2021, 1:16am UTC](https://discourse.julialang.org/t/julia-for-real-time-worried-about-the-garbage-collector/34654 "2021-03-21T01:16:35Z")

</div>

Hello, totally new. I’ve read about Julia and the concept seems great. I have a block diagram software (like simulink) that automatically creates a script, works well and it is using m-code where every block is a functi…

---

## [How to use a forked Github project](https://discourse.julialang.org/t/how-to-use-a-forked-github-project/57360)

<div class="topic-metadata">

**Author:** [@ultradian](https://discourse.julialang.org/u/ultradian)\
**Replies:** 2\
**Last updated:** [March 20, 2021, 11:12pm UTC](https://discourse.julialang.org/t/how-to-use-a-forked-github-project/57360 "2021-03-20T23:12:55Z")

</div>

I am trying to use a fork of the Ogg package, but having problems. Ogg itself is easy to use as it is a registered package. The fork I want to use is https://github.com/ssfrr/Ogg.jl as ssfrr created a streaming branch th…

---

## [Globe in Makie](https://discourse.julialang.org/t/globe-in-makie/57627)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 1\
**Last updated:** [March 20, 2021, 9:52pm UTC](https://discourse.julialang.org/t/globe-in-makie/57627 "2021-03-20T21:52:50Z")

</div>

I am trying to reproduce the example from here but it doesn’t work with the current version of the packages. I am currently hanging at the following line: m = uv\_normal\_mesh(Tesselation(Sphere(Point3f0(0), 1f0), 200)) …

---

## [Julia alignas: is there a way to specify the alignment of Julia objects in memory?](https://discourse.julialang.org/t/julia-alignas-is-there-a-way-to-specify-the-alignment-of-julia-objects-in-memory/57501)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 15\
**Last updated:** [March 20, 2021, 10:25pm UTC](https://discourse.julialang.org/t/julia-alignas-is-there-a-way-to-specify-the-alignment-of-julia-objects-in-memory/57501 "2021-03-20T22:25:25Z")

</div>

In C++ there is alignas (and related stuff like alignof): https://en.cppreference.com/w/cpp/language/alignas alignas enables specifying, for example, that an array’s storage should be aligned to 64 bytes in memory, whi…

---

## [Return statements and global consts in a struct](https://discourse.julialang.org/t/return-statements-and-global-consts-in-a-struct/57567)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 5\
**Last updated:** [March 20, 2021, 10:17pm UTC](https://discourse.julialang.org/t/return-statements-and-global-consts-in-a-struct/57567 "2021-03-20T22:17:40Z")

</div>

I posted this on Slack, but looking for some detailed answers. I recently saw a code snippet in Julia struct \_GLOBAL\_RNG \<: AbstractRNG global const GLOBAL\_RNG = \_GLOBAL\_RNG.instance end Jeff described this as basi…

---

## [No method matching getindex](https://discourse.julialang.org/t/no-method-matching-getindex/57622)

<div class="topic-metadata">

**Author:** [@SUMAN\_SHEKHAR](https://discourse.julialang.org/u/SUMAN_SHEKHAR)\
**Replies:** 4\
**Last updated:** [March 20, 2021, 8:34pm UTC](https://discourse.julialang.org/t/no-method-matching-getindex/57622 "2021-03-20T20:34:50Z")

</div>

Greeting to all, I am new user to Julia and I was writing my code in Julia for the first time. I wanted to implement a Gaussian Heat surface over a circular radius and outside that radius I want to set the value to zero …

---

## [Algorithmic complexity of matrix multiplication in Julia](https://discourse.julialang.org/t/algorithmic-complexity-of-matrix-multiplication-in-julia/57468)

<div class="topic-metadata">

**Author:** [@IlliaFaraji](https://discourse.julialang.org/u/IlliaFaraji)\
**Replies:** 10\
**Last updated:** [March 20, 2021, 12:57pm UTC](https://discourse.julialang.org/t/algorithmic-complexity-of-matrix-multiplication-in-julia/57468 "2021-03-20T12:57:09Z")

</div>

This is a slightly odd question, but I am working on a project for which I would like to know the algorithmic complexity of matrix multiplication in Julia. i.e. if A, B are two dimensional n x n arrays stored in the usua…

---

## [Need help understanding performance hit of Arrays](https://discourse.julialang.org/t/need-help-understanding-performance-hit-of-arrays/57450)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 3\
**Last updated:** [March 20, 2021, 10:03am UTC](https://discourse.julialang.org/t/need-help-understanding-performance-hit-of-arrays/57450 "2021-03-20T10:03:03Z")

</div>

Intro Hello! I have been using Julia regularly for some months and I am starting to have a good mental map of the way Julia works internally, meaning, which operations can be optimized by the compiler and how to write le…

---

## [How to constraint a outer type of a variable in a struct to be the same, but allow the inner type to be different?](https://discourse.julialang.org/t/how-to-constraint-a-outer-type-of-a-variable-in-a-struct-to-be-the-same-but-allow-the-inner-type-to-be-different/57565)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 2\
**Last updated:** [March 20, 2021, 8:03am UTC](https://discourse.julialang.org/t/how-to-constraint-a-outer-type-of-a-variable-in-a-struct-to-be-the-same-but-allow-the-inner-type-to-be-different/57565 "2021-03-20T08:03:59Z")

</div>

How to constraint a outer type of a variable in a struct to be the same, but allow the inner type to be different? e.g. struct Foo{A\<:Union{\<:AbstractMatrix, Cholesky}} a::A b::A end In this example a & b can …

---

## [Save figures as pdf](https://discourse.julialang.org/t/save-figures-as-pdf/57503)

<div class="topic-metadata">

**Author:** [@Rasoul\_Jafarzadeh](https://discourse.julialang.org/u/Rasoul_Jafarzadeh)\
**Replies:** 4\
**Last updated:** [March 20, 2021, 7:33am UTC](https://discourse.julialang.org/t/save-figures-as-pdf/57503 "2021-03-20T07:33:02Z")

</div>

In my code, I have lots of figuers and I want them to save as pdf. I did it but all plots saved in one page. How can I save them in some pages?

---

## [Using jldoctest across Julia versions](https://discourse.julialang.org/t/using-jldoctest-across-julia-versions/57562)

<div class="topic-metadata">

**Author:** [@nben](https://discourse.julialang.org/u/nben)\
**Replies:** 1\
**Last updated:** [March 19, 2021, 8:35pm UTC](https://discourse.julialang.org/t/using-jldoctest-across-julia-versions/57562 "2021-03-19T20:35:52Z")

</div>

I am developing a library called Air that includes persistent collection types. (I don’t think this context is very important, but the link is included in case it helps.) As part of this I have a large number of jldoctes…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=623)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=625)
