# Latest

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

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

**Page:** 1066

---

## [Get a picture icon when I try to plot a histogram](https://discourse.julialang.org/t/get-a-picture-icon-when-i-try-to-plot-a-histogram/79616)

<div class="topic-metadata">

**Author:** [@bproferes](https://discourse.julialang.org/u/bproferes)\
**Replies:** 4\
**Last updated:** [April 19, 2022, 1:58am UTC](https://discourse.julialang.org/t/get-a-picture-icon-when-i-try-to-plot-a-histogram/79616 "2022-04-19T01:58:59Z")

</div>

Hi, I’m trying to make a histogram but whenever I run the command in a jupyter notebook I get a picture icon. I’m using a mac laptop and maybe it is a general issue with the laptop I need to fix.

---

## [GMT.jl and VSCode](https://discourse.julialang.org/t/gmt-jl-and-vscode/76155)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 5\
**Last updated:** [April 18, 2022, 11:56pm UTC](https://discourse.julialang.org/t/gmt-jl-and-vscode/76155 "2022-04-18T23:56:50Z")

</div>

I’m having some issues between GMT and VSCode. (macOS Big Sur). Running the following in terminal works fine. I get the image in a new window. using GMT plot(1:10, rand(10), lw=1, lc=:blue, marker=:square, markere…

---

## [Dummy variable change optimization result](https://discourse.julialang.org/t/dummy-variable-change-optimization-result/79646)

<div class="topic-metadata">

**Author:** [@dscheirman](https://discourse.julialang.org/u/dscheirman)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 10:10pm UTC](https://discourse.julialang.org/t/dummy-variable-change-optimization-result/79646 "2022-04-18T22:10:20Z")

</div>

Hi, I have established a JuMP model (gurobi optimizer) and one constraint seems to be not respected: @constraint(obj,OP\_t == sum(sum(sum(((opex\_trans\[i,1,k,1\]\*Nsh\[i,1,k,t\]) + (opex\_trans\[i,1,k,2\]\*Np\[i,1,k,t\])) for i in…

---

## [How to get the base type of a \`Complex\`](https://discourse.julialang.org/t/how-to-get-the-base-type-of-a-complex/79658)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 1\
**Last updated:** [April 18, 2022, 9:49pm UTC](https://discourse.julialang.org/t/how-to-get-the-base-type-of-a-complex/79658 "2022-04-18T21:49:27Z")

</div>

Hi, here is what I have realtype(::Type{T}) where {T\<:Real} = T realtype(::Type{Complex{T}}) where {T\<:Real} = T I wonder if there is a recommended (Base-y) way to do this? Thanks!

---

## [How to define input from users for a 2D heteregenous model](https://discourse.julialang.org/t/how-to-define-input-from-users-for-a-2d-heteregenous-model/79624)

<div class="topic-metadata">

**Author:** [@Iddingsite](https://discourse.julialang.org/u/Iddingsite)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 8:54pm UTC](https://discourse.julialang.org/t/how-to-define-input-from-users-for-a-2d-heteregenous-model/79624 "2022-04-18T20:54:01Z")

</div>

Hi everyone, I am working on a small modeling project. Let’s say I want to do 2D diffusion modeling in different units. All the units are homogeneous but they can have different geometries and physical properties. I wa…

---

## [Flux.jl DimensionMismatch(3 vs 4)](https://discourse.julialang.org/t/flux-jl-dimensionmismatch-3-vs-4/79650)

<div class="topic-metadata">

**Author:** [@juzikaster](https://discourse.julialang.org/u/juzikaster)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 8:48pm UTC](https://discourse.julialang.org/t/flux-jl-dimensionmismatch-3-vs-4/79650 "2022-04-18T20:48:07Z")

</div>

I am using conv network model from this repo And when i try to use my image i am getting this error: ERROR: LoadError: DimensionMismatch("Rank of x and w must match! (3 vs. 4)") As i know 1 is for RGB and (28, 28) for…

---

## [Syntax for putting constraints on type](https://discourse.julialang.org/t/syntax-for-putting-constraints-on-type/79588)

<div class="topic-metadata">

**Author:** [@sychen52](https://discourse.julialang.org/u/sychen52)\
**Replies:** 17\
**Last updated:** [April 18, 2022, 8:32pm UTC](https://discourse.julialang.org/t/syntax-for-putting-constraints-on-type/79588 "2022-04-18T20:32:41Z")

</div>

I listed the syntax for putting constraints on types at different places, such as method, struct. Please let me know whether this is correct. parametric type: Vector{\<:Real} Vector{T} where T \<: Real method function …

---

## [GLMakie : record with high resolution?](https://discourse.julialang.org/t/glmakie-record-with-high-resolution/79654)

<div class="topic-metadata">

**Author:** [@Francois](https://discourse.julialang.org/u/Francois)\
**Replies:** 0\
**Last updated:** [April 18, 2022, 8:24pm UTC](https://discourse.julialang.org/t/glmakie-record-with-high-resolution/79654 "2022-04-18T20:24:23Z")

</div>

The maximum resolution for recording seems to be bounded by the size of my screen. GLMakie.activate!() grid = zeros(2000, 2000) fig = Figure(resolution=(2000, 2000)) ax = Axis(fig\[1, 1\], aspect=DataAspect()) hm = heatma…

---

## [DataFramesMeta.jl version 0.11.0 Release](https://discourse.julialang.org/t/dataframesmeta-jl-version-0-11-0-release/79648)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 0\
**Last updated:** [April 18, 2022, 7:47pm UTC](https://discourse.julialang.org/t/dataframesmeta-jl-version-0-11-0-release/79648 "2022-04-18T19:47:17Z")

</div>

Hi all, I’m excited to announce a new release of DataFramesMeta.jl. This feature adds one major new feature, which is the ability to use AsTable on the right-hand-side of transformations. This makes it easy to work wit…

---

## [Create a chain object from a dataframe](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640)

<div class="topic-metadata">

**Author:** [@99dB](https://discourse.julialang.org/u/99dB)\
**Replies:** 1\
**Last updated:** [April 18, 2022, 5:19pm UTC](https://discourse.julialang.org/t/create-a-chain-object-from-a-dataframe/79640 "2022-04-18T17:19:10Z")

</div>

Hi all, I would like to do some statistics using the package MCMCChains on a dataframe object. But it is not working because I think I need to have my chains in a MCMC chain object. Is there a way to create a chain obj…

---

## [Performance when dispatching on type](https://discourse.julialang.org/t/performance-when-dispatching-on-type/79617)

<div class="topic-metadata">

**Author:** [@ArjunNarayanan](https://discourse.julialang.org/u/ArjunNarayanan)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 5:13pm UTC](https://discourse.julialang.org/t/performance-when-dispatching-on-type/79617 "2022-04-18T17:13:14Z")

</div>

A colleague recently showed me this example, and I’m curious as to the underlying reason for the performance hit. using BenchmarkTools, StaticArrays f(u, v) = u\*v' struct ConcType end ctyp = ConcType cvar = ConcType(…

---

## [\[ANN\] TimesDates.jl: times & zones with nanoseconds](https://discourse.julialang.org/t/ann-timesdates-jl-times-zones-with-nanoseconds/10819)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 3\
**Last updated:** [April 18, 2022, 4:28pm UTC](https://discourse.julialang.org/t/ann-timesdates-jl-times-zones-with-nanoseconds/10819 "2022-04-18T16:28:33Z")

</div>

TimesDates.jl: work with nanosecond resolved times. the types play very well together and with others the calculations defer to those of Dates, TimeZones the perspective is already familiar, and easy to use t…

---

## [Is there a option for different \`MethodError\` printing?](https://discourse.julialang.org/t/is-there-a-option-for-different-methoderror-printing/79523)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 2:14pm UTC](https://discourse.julialang.org/t/is-there-a-option-for-different-methoderror-printing/79523 "2022-04-18T14:14:14Z")

</div>

Hi all :slight\_smile: Sometimes I would like to switch to a different MethodError printing. The following is as it is: julia\> f(a,b,c,d,e,f,g,h,i,j,k) = nothing f (generic function with 1 method) julia\> f(1) ERROR: Me…

---

## [Hide logs in html export](https://discourse.julialang.org/t/hide-logs-in-html-export/78990)

<div class="topic-metadata">

**Author:** [@jackwoodside](https://discourse.julialang.org/u/jackwoodside)\
**Replies:** 1\
**Last updated:** [April 18, 2022, 2:05pm UTC](https://discourse.julialang.org/t/hide-logs-in-html-export/78990 "2022-04-18T14:05:19Z")

</div>

A notebook that I’m writing uses the gif function from Plots to create an animation, which it then saves locally, and Pluto also displays it in the notebook. I’d like to export this notebook to a html file, but the funct…

---

## [Does GLM return an estimate for the error term (residual standard deviation)?](https://discourse.julialang.org/t/does-glm-return-an-estimate-for-the-error-term-residual-standard-deviation/79614)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 2\
**Last updated:** [April 18, 2022, 1:48pm UTC](https://discourse.julialang.org/t/does-glm-return-an-estimate-for-the-error-term-residual-standard-deviation/79614 "2022-04-18T13:48:57Z")

</div>

I was under the impression that if I called lm(@formula(y~x),data) from the GLM.jl package was fitting a simple linear regression of the form: y=a+bx\_i+\\epsilon\_i The results from the regression being: \\hat{y}=\\hat{a}…

---

## [Why does JET give these "runtime dispatch detected" lines for some LDLFactorizations calls in Tulip](https://discourse.julialang.org/t/why-does-jet-give-these-runtime-dispatch-detected-lines-for-some-ldlfactorizations-calls-in-tulip/79583)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 4\
**Last updated:** [April 18, 2022, 12:57pm UTC](https://discourse.julialang.org/t/why-does-jet-give-these-runtime-dispatch-detected-lines-for-some-ldlfactorizations-calls-in-tulip/79583 "2022-04-18T12:57:07Z")

</div>

I’m playing around with linear programming using Tulip.jl and BigFloat, and I wanted to decrease the time necessary for finding each LP solution, so it seemed like JET.jl might be helpful to investigate possible performa…

---

## [Is it possible to reduce the allocation in replace missing value?](https://discourse.julialang.org/t/is-it-possible-to-reduce-the-allocation-in-replace-missing-value/79524)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 5\
**Last updated:** [April 18, 2022, 8:25am UTC](https://discourse.julialang.org/t/is-it-possible-to-reduce-the-allocation-in-replace-missing-value/79524 "2022-04-18T08:25:49Z")

</div>

Hi , I wanna replace the missing value to 0 in a large vector, but I got a hugh memory allocation for example: A = rand(10\_000\_000); @time replace!(A, -Inf =\> 0, Inf =\> 0, NaN =\> 0); this takes only 0.065884 seconds…

---

## [DataFrame transform with ByRow can’t handle Date values?](https://discourse.julialang.org/t/dataframe-transform-with-byrow-can-t-handle-date-values/79613)

<div class="topic-metadata">

**Author:** [@pcantrell](https://discourse.julialang.org/u/pcantrell)\
**Replies:** 5\
**Last updated:** [April 18, 2022, 8:20am UTC](https://discourse.julialang.org/t/dataframe-transform-with-byrow-can-t-handle-date-values/79613 "2022-04-18T08:20:41Z")

</div>

Trying to work with date data in a DataFrame using ByRow, I ran into a curious “MethodError: no method matching keys(::Date)” error, which I reduced to the following trivial example: d = DataFrame(a=1, b=Date("2022-1-1"…

---

## [Zooming with PyPlot.jl](https://discourse.julialang.org/t/zooming-with-pyplot-jl/79606)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 2\
**Last updated:** [April 17, 2022, 7:16pm UTC](https://discourse.julialang.org/t/zooming-with-pyplot-jl/79606 "2022-04-17T19:16:42Z")

</div>

When trying to use the box zoom controls with PyPlot.jl, the updated region is frequently incorrect. Sometimes it gets it right, but usually it zooms into an entirely different region of the image or plot. The resulting …

---

## [\[ANN\] State estimation with LowLevelParticleFilters.jl](https://discourse.julialang.org/t/ann-state-estimation-with-lowlevelparticlefilters-jl/79422)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 4\
**Last updated:** [April 17, 2022, 6:39pm UTC](https://discourse.julialang.org/t/ann-state-estimation-with-lowlevelparticlefilters-jl/79422 "2022-04-17T18:39:36Z")

</div>

LowLevelParticleFilters.jl is a library for state estimation, that is, given measurements y(t) from a dynamical system with inputs u(t), estimate the state vector x(t). Throughout, we assume discrete-time dynamics on the…

---

## [Spatial binning with julia GeoStats packages](https://discourse.julialang.org/t/spatial-binning-with-julia-geostats-packages/79286)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 3\
**Last updated:** [April 17, 2022, 5:20pm UTC](https://discourse.julialang.org/t/spatial-binning-with-julia-geostats-packages/79286 "2022-04-17T17:20:18Z")

</div>

I have a bunch of spatially distributed event data. Each observation has a latitude, longitude coordinate, but no other attribute. I am looking at events happening in Ukraine, so the region is based upon national boundar…

---

## [Vector conversion mixed rational integers](https://discourse.julialang.org/t/vector-conversion-mixed-rational-integers/79546)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 32\
**Last updated:** [April 17, 2022, 4:48pm UTC](https://discourse.julialang.org/t/vector-conversion-mixed-rational-integers/79546 "2022-04-17T16:48:26Z")

</div>

Is there (or how could one write) a function that gives me this vector \[0, 1//2, 1, 3//2, 2\] from this vector \[0//2, 1//2, 2//2, 3//2, 4//2\]?

---

## [Using Makie for contour plot with only one edge](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603)

<div class="topic-metadata">

**Author:** [@Sciemon](https://discourse.julialang.org/u/Sciemon)\
**Replies:** 3\
**Last updated:** [April 17, 2022, 4:30pm UTC](https://discourse.julialang.org/t/using-makie-for-contour-plot-with-only-one-edge/79603 "2022-04-17T16:30:39Z")

</div>

I want a 2D contour plot which shows the boundary where “matrix” becomes larger than zero. I do: CairoMakie.contour(matrix,levels = \[0.0\]) The last step to make me happy would be to set the color of the boundary line. …

---

## [Adapt / modify a Plots recipe?](https://discourse.julialang.org/t/adapt-modify-a-plots-recipe/79600)

<div class="topic-metadata">

**Author:** [@Lucifron](https://discourse.julialang.org/u/Lucifron)\
**Replies:** 0\
**Last updated:** [April 17, 2022, 10:50am UTC](https://discourse.julialang.org/t/adapt-modify-a-plots-recipe/79600 "2022-04-17T10:50:19Z")

</div>

I’ve looked at the Plots documentation and it seems like the recipes are a good way to define a “default plotting style” that is highly customizable based on input. My intention is to write a recipe that allows me to pl…

---

## [How to build a setInterval-like task?](https://discourse.julialang.org/t/how-to-build-a-setinterval-like-task/79595)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 1\
**Last updated:** [April 17, 2022, 1:30pm UTC](https://discourse.julialang.org/t/how-to-build-a-setinterval-like-task/79595 "2022-04-17T13:30:09Z")

</div>

This is my idea task=@task begin while true sleep(1) foo() if should\_end # ? end end end But are there any simple ways to contact other than using global should\_end? how to end the task from inside the expression…

---

## [TimeArray indexing](https://discourse.julialang.org/t/timearray-indexing/79582)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 2\
**Last updated:** [April 17, 2022, 1:01pm UTC](https://discourse.julialang.org/t/timearray-indexing/79582 "2022-04-17T13:01:25Z")

</div>

I’m playing around with the MarketData package as a way to learn Julia. Now I’ve run into a simple question: How do I access the actual number inside a TimeArray? I’m following the MarketData example to get the daily cl…

---

## [Find nearest value in AxisArray](https://discourse.julialang.org/t/find-nearest-value-in-axisarray/75820)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 7\
**Last updated:** [April 17, 2022, 10:42am UTC](https://discourse.julialang.org/t/find-nearest-value-in-axisarray/75820 "2022-04-17T10:42:01Z")

</div>

I am playing around with AxisArrays, as it seems like a great package for adding axis with geographical locations to gridded data. What I would like is to let AxisArray give me the value of the nearest location, without …

---

## [Add custom chain method](https://discourse.julialang.org/t/add-custom-chain-method/79589)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 7\
**Last updated:** [April 17, 2022, 10:02am UTC](https://discourse.julialang.org/t/add-custom-chain-method/79589 "2022-04-17T10:02:58Z")

</div>

I have comtom struct: struct Ci pre::Union{Ci,String} next::String end I can add chain method to construct an instance of it: (::Colon)(x::Vararg{String})=begin pre=x\[1\] for next\_ in x\[2:end\] p…

---

## [Mean of multiple DataFrames](https://discourse.julialang.org/t/mean-of-multiple-dataframes/54983)

<div class="topic-metadata">

**Author:** [@Sleepy](https://discourse.julialang.org/u/Sleepy)\
**Replies:** 10\
**Last updated:** [April 17, 2022, 9:12am UTC](https://discourse.julialang.org/t/mean-of-multiple-dataframes/54983 "2022-04-17T09:12:43Z")

</div>

Hi, we are given two or more DataFrames using DataFrames, Statistics df1 = DataFrame(A = 1:5, B = 3:7) df2 = DataFrame(A = 10:14, B = 3:7) What is a fast way to calculate the mean of these frames? In the example abo…

---

## [Using GLMakie to animate a crank mechanism](https://discourse.julialang.org/t/using-glmakie-to-animate-a-crank-mechanism/79552)

<div class="topic-metadata">

**Author:** [@Ogweno\_Emmanuel](https://discourse.julialang.org/u/Ogweno_Emmanuel)\
**Replies:** 2\
**Last updated:** [April 17, 2022, 6:46am UTC](https://discourse.julialang.org/t/using-glmakie-to-animate-a-crank-mechanism/79552 "2022-04-17T06:46:33Z")

</div>

I am trying to animate a crank mechanism using the GLMakie package. I was following this youtube tutorial, Making animations and interactive applications in Makie.jl - YouTube, and here’s the code I wrote. ‘’’ using GL…

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

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