# Need to make a custom plot

I need to make a custom plot type (for a smith chart) and i’m wondering what would be the best approach for this.

i’m most familiar with pyplot, i.e. matplotlib ,but not at all with familiar with creating custom plot types. there is already a python package which uses matplotlib to generate smith charts but it is a fairly substantial amount of python code and it’s not at all obvious how i might port it to julia.

I was also looking at GR but can’t seem to find any documentation on how to create your own graph type.

I was looking for some suggestions.

Thank you !

PGFPlotsX also allows to create nice smith charts.

julia> using PGFPlotsX

julia> push!(PGFPlotsX.CUSTOM_PREAMBLE, "\\usepgfplotslibrary[smithchart]")
1-element Array{String,1}:
"\\usepgfplotslibrary[smithchart]"

julia> data = [(0.5,0.2), (1,0.8), (2,2)]
3-element Array{Tuple{Real,Real},1}:
(0.5, 0.2)
(1, 0.8)
(2, 2)

julia> TikzPicture("\\begin{smithchart}[title = Impedance Smith Chart,] \\addplot coordinates { \$(join(string.(data), " ")) }; \\end{smithchart}")


(pixelation due to pdf2png)

1 Like

If you know a Python package and how to use it already, how about just calling it via PyCall?

My initial reaction was to try and use the pyplot version but i am completely unfamiliar with PyCall, so I wanted to see what other options were available. also it’s a bit kludgy. I wanted this for a julia package I’m working on and I really didn’t want to have to deal with pulling in the python-only code for another project to make it work. much cleaner if i could use a plot package already in julia.

• I forgot about PGFPlotsX.

• I didn’t even know about InspectDR. That looks very promising for some other work i’m doing that involves data analysis of measurement data in addition to the smith chart capability

• furthermore I think that I understand how the “primitive” layer of GR works, so if I really had to (which I don’t believe i do at this point) I could roll my own in GR.

• finally, if none of the above work I can go read up on pycall and try that.

Lots of good options !

Thank you very much for all the suggestions.