<turbo-stream action="append" target="posts_list"><template>    <div class="postbit" id="325413" data-post-id="325413">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have now refactored the whole library to use resvg as a renderer (and text measurer). The only thing that doesn’t work yet is text rotation. Otherwise, it has feature parity with what I had before.</p>
<p>The figure below, while unimpressive is a plot of 50,000 semi-transparent random dots in a scatter plot, rendered into PNG in less than a second by resvg at a resolution of 300dpi. This confirms to me that resvg is the way to go for both text measurement and rendering.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/3/c/3c9b18f65452745773895eb8787675fa7fae3cbc.png" data-download-href="https://forum.elixirforum.com/uploads/default/3c9b18f65452745773895eb8787675fa7fae3cbc" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/3/c/3c9b18f65452745773895eb8787675fa7fae3cbc_2_690x517.png" alt="image" data-base62-sha1="8E8WtiKF87WMs06MM0MjVJtfjoE" width="690" height="517" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/3/c/3c9b18f65452745773895eb8787675fa7fae3cbc_2_690x517.png, https://forum.elixirforum.com/uploads/default/original/3X/3/c/3c9b18f65452745773895eb8787675fa7fae3cbc.png 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/3/c/3c9b18f65452745773895eb8787675fa7fae3cbc.png 2x" data-dominant-color="007D7D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">945×709 27.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Now I just have to find a library that can convert SVG into PDF (maybe resvg can do that somehow?) and a way to embed fonts in SVG files so that they are portable. And for full portability, I need to make my linear solver work outside linux. Maybe I can repurpose one of the rust solvers out there with some help.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="325413" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/22">Post #21</a>
	                </div>
	            </div>
              <div id="likers-container-325413" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="325413"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #21"></div>
  </section>
</div>
    <div class="postbit" id="326315" data-post-id="326315">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Quartz now supports some basic tick marks and tick labels. Everything works fine with the linear constrains based system. You can now render several datasets and a new color will be picked automatically for each dataset.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/0/3/03922daa7aaab07458d818d7570b5b63dc8dcf64.png" data-download-href="https://forum.elixirforum.com/uploads/default/03922daa7aaab07458d818d7570b5b63dc8dcf64" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/0/3/03922daa7aaab07458d818d7570b5b63dc8dcf64_2_690x517.png" alt="image" data-base62-sha1="vACkaPntdJxVjxbSwdPVo8pxqs" width="690" height="517" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/0/3/03922daa7aaab07458d818d7570b5b63dc8dcf64_2_690x517.png, https://forum.elixirforum.com/uploads/default/original/3X/0/3/03922daa7aaab07458d818d7570b5b63dc8dcf64.png 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/0/3/03922daa7aaab07458d818d7570b5b63dc8dcf64.png 2x" data-dominant-color="5E4B2F"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">945×709 53.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<pre data-code-wrap="elixir"><code class="lang-elixir">defmodule Quartz.Benchmarks.ScatterPlot do
  alias Quartz.Figure
  alias Quartz.Plot2D
  alias Quartz.Length

  @nr_of_points_per_series 60

  def build_plot() do
    :rand.seed(:exsss, {42, 42, 42})

    figure =
      Figure.new([width: Length.cm(8), height: Length.cm(6)], fn _fig -&gt;
        n = @nr_of_points_per_series
        # Generate some (deterministically random)
        x1 = for _i &lt;- 1..n, do: :rand.uniform()
        y1 = for _i &lt;- 1..n, do: :rand.uniform()

        x2 = for _i &lt;- 1..n, do: :rand.uniform()
        y2 = for _i &lt;- 1..n, do: :rand.uniform()

        x3 = for _i &lt;- 1..n, do: :rand.uniform()
        y3 = for _i &lt;- 1..n, do: :rand.uniform()

        x4 = for _i &lt;- 1..n, do: :rand.uniform()
        y4 = for _i &lt;- 1..n, do: :rand.uniform()

        _plot =
          Plot2D.new(id: "plot_A")
          |&gt; Plot2D.scatter_plot(x1, y1)
          |&gt; Plot2D.scatter_plot(x2, y2)
          |&gt; Plot2D.scatter_plot(x3, y3)
          |&gt; Plot2D.scatter_plot(x4, y4)
          # Use typst to explicitly style the title and labels ――――――――――――――――――――――――――――――――
          |&gt; Plot2D.put_title("A. Scatter plot (1 color per dataset)")
          |&gt; Plot2D.put_axis_label("y", "f(x)", text: [rotation: 0])
          |&gt; Plot2D.put_axis_label("x", "Predictor: x")
          |&gt; Plot2D.put_axes_margins(Length.cm(0.2))
          |&gt; Plot2D.finalize()
      end)

    svg_path = Path.join([__DIR__, "scatter_plot", "example.svg"])
    Figure.render_to_svg_file!(figure, svg_path)

    png_path = Path.join([__DIR__, "scatter_plot", "example.png"])
    Figure.render_to_png_file!(figure, png_path)
  end
end
</code></pre> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="326315" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/23">Post #22</a>
	                </div>
	            </div>
              <div id="likers-container-326315" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="326315"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #22"></div>
  </section>
</div>
    <div class="postbit" id="338010" data-post-id="338010">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Some more examples, this time for distribution plots.</p>
<p>KDE smoothing of the posterior distributions for a NUTS bayesian simulation, showing all 4 chains in the same plot:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/7/6/760410c7005659383bda2bda1376f581517830ee.png" data-download-href="https://forum.elixirforum.com/uploads/default/760410c7005659383bda2bda1376f581517830ee" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/7/6/760410c7005659383bda2bda1376f581517830ee_2_690x344.png" alt="image" data-base62-sha1="gQ13drBmHqTgaOen6WGWiytzQ4K" width="690" height="344" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/7/6/760410c7005659383bda2bda1376f581517830ee_2_690x344.png, https://forum.elixirforum.com/uploads/default/original/3X/7/6/760410c7005659383bda2bda1376f581517830ee.png 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/7/6/760410c7005659383bda2bda1376f581517830ee.png 2x" data-dominant-color="3D2B18"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">945×472 21.9 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>The same data plotted using boxplots (boxplots are not very configurable yet, but that is just a question of adding more options):</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/5/7/571af17142889026378924bd35544cfa43926542.png" data-download-href="https://forum.elixirforum.com/uploads/default/571af17142889026378924bd35544cfa43926542" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/original/3X/5/7/571af17142889026378924bd35544cfa43926542.png" alt="image" data-base62-sha1="cqzgrVbRWnbM3g8lNY5yzf86p2O" width="690" height="431" data-dominant-color="9F787E"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">945×591 9.73 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Finally, the contour plot I’ve shown before, but with a much higher resolution now that we don’t depend on typst and can use the more performant (for this use case) resvg renderer (note that we can fake powers of integers with superscript unicode characters, although for more advanced things one really needs proper math typesetting):</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/6/a/6aca4295437296b0f9d13003be30d603f7bf320e.png" data-download-href="https://forum.elixirforum.com/uploads/default/6aca4295437296b0f9d13003be30d603f7bf320e" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/6/a/6aca4295437296b0f9d13003be30d603f7bf320e_2_690x517.png" alt="image" data-base62-sha1="feHX1UXAkKGzrCvSeWu3xA86Yr4" width="690" height="517" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/6/a/6aca4295437296b0f9d13003be30d603f7bf320e_2_690x517.png, https://forum.elixirforum.com/uploads/default/original/3X/6/a/6aca4295437296b0f9d13003be30d603f7bf320e.png 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/6/a/6aca4295437296b0f9d13003be30d603f7bf320e.png 2x" data-dominant-color="16537D"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">945×709 58.6 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>And no, Quartz still can’t rotate text, which messes up the case where the labels of the y-axis are longer, but it works fine for these short labels.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="338010" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/24">Post #23</a>
	                </div>
	            </div>
              <div id="likers-container-338010" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="338010"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #23"></div>
  </section>
</div>
    <div class="postbit" id="338049" data-post-id="338049">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I’d like to implement most of what Matplotlib does, and which is summarized here, except probably the 3D stuff: <a href="https://matplotlib.org/stable/plot_types/index.html" class="inline-onebox" rel="noopener nofollow ugc">Plot types — Matplotlib 3.11.0 documentation</a></p>
<p>Pairwise data:</p>
<ul>
<li>Line plot: Done</li>
<li>Scatter plot: Done</li>
<li>Bar plot: TODO (easy)</li>
<li>Stem plot: TODO (easy)</li>
<li>Fill-between plot: TODO (easy except when lines cross)</li>
<li>Stack plot: TODO (easy)</li>
<li>Stairs plot: TODO (easy)</li>
</ul>
<p>Distribution plot:</p>
<ul>
<li>KDE plot: Done</li>
<li>Histogram: Done</li>
<li>Violin plot: TODO (but it’s just stacking 2 mirrored KDE plots, and it’s a bad type of plot IMO)</li>
<li>Histogram: TODO (easy, but one needs to determine bandwidth)</li>
<li>Event plot: TODO (but easy, just draw lines)</li>
<li>Pie plot: TODO (but a bad style of plot)</li>
<li>Doughnut plot: TODO (not as bad as pie)</li>
</ul>
<p>Gridded data:</p>
<ul>
<li>Countours: TODO (currently Quartz only supports lines, not filled areas; supporting this means bringing additional rust dependencies or implementing some really hard code in Elixir)</li>
<li>Heatmaps: TODO (medium difficulty)</li>
<li>Quiver plots: TODO (easy)</li>
<li>Streamplot: TODO (very hard!)</li>
</ul>
<p>Irregularly gridded data: TODO, and very hard (will probably require additional dependencies)</p>
<p>3D plots: TODO, and very hard - probably out of scope</p>
<p>Math typesetting:</p>
<ul>
<li>Simple exponents and subscripts: TODO (easy)</li>
<li>Greek letters and special characters: TODO (easy)</li>
<li>Anything more complex: TODO (very hard! maybe it can be made easier if I find a way to bind typst to extract rendered math equations from typst and render it as SVG which can be put into Quartz)</li>
</ul> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="338049" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/25">Post #24</a>
	                </div>
	            </div>
              <div id="likers-container-338049" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="338049"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #24"></div>
  </section>
</div>
    <div class="postbit" id="341875" data-post-id="341875">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have finally added support for text segments with different properties (that is, I can now mix regular, italic, bold, subscript, supersscript, etc.) in the same piece of text. This means that text support in Quartz is now arguably more sophisticated than matplotlib. On the other hand, matplotlib supports relatively sophisticated math typesetting, and Quartz doesn’t (yet?).</p>
<p>For example, the new support for different font types allow the title labels to distinguish between normal text and variable names.</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/9/8/9888327b1da7ea4b19317f34523e1fe5fe92e892.jpeg" data-download-href="https://forum.elixirforum.com/uploads/default/9888327b1da7ea4b19317f34523e1fe5fe92e892" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/9/8/9888327b1da7ea4b19317f34523e1fe5fe92e892_2_399x600.jpeg" alt="image" data-base62-sha1="lLmnlOUoloilOgoZP3J3p7zLiE2" width="399" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/9/8/9888327b1da7ea4b19317f34523e1fe5fe92e892_2_399x600.jpeg, https://forum.elixirforum.com/uploads/default/optimized/3X/9/8/9888327b1da7ea4b19317f34523e1fe5fe92e892_2_598x900.jpeg 1.5x, https://forum.elixirforum.com/uploads/default/optimized/3X/9/8/9888327b1da7ea4b19317f34523e1fe5fe92e892_2_798x1200.jpeg 2x" data-dominant-color="E6DFDB"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1417×2126 308 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>One can even simmulate proper math typesetting for simple cases such as greek letters and subscripts, like in the legend of the following energy plot:</p>
<p></p><div class="lightbox-wrapper"><a class="lightbox" href="https://forum.elixirforum.com/uploads/default/original/3X/e/b/eba6938412d6571dfc0cc71e78fe71991d36849f.png" data-download-href="https://forum.elixirforum.com/uploads/default/eba6938412d6571dfc0cc71e78fe71991d36849f" title="image" rel="nofollow"><img src="https://forum.elixirforum.com/uploads/default/optimized/3X/e/b/eba6938412d6571dfc0cc71e78fe71991d36849f_2_600x600.png" alt="image" data-base62-sha1="xCF5NnwkEsTxmrZywntzTPntu7d" width="600" height="600" srcset="https://forum.elixirforum.com/uploads/default/optimized/3X/e/b/eba6938412d6571dfc0cc71e78fe71991d36849f_2_600x600.png, https://forum.elixirforum.com/uploads/default/optimized/3X/e/b/eba6938412d6571dfc0cc71e78fe71991d36849f_2_900x900.png 1.5x, https://forum.elixirforum.com/uploads/default/original/3X/e/b/eba6938412d6571dfc0cc71e78fe71991d36849f.png 2x" data-dominant-color="7E5E3C"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">1181×1181 33.4 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div><p></p>
<p>Note that we can represent the “non-math” parts using a sans-serif font while using a “fancy” serifs font for the part that attempts to immitate a math formula.</p>
<p>The code that generates the label text is very friendly:</p>
<pre data-code-wrap="elixir"><code class="lang-elixir">Text.new(["π", Text.sub(["Δ", Text.tspan("E", style: "italic")])],
  Config.get_legend_text_attributes(font: "Linux Libertine")
)
</code></pre>
<p>While one could use a markup language for this, generating it with code seems more versatile in the long term, so I’ll probably continue to use code (and to develop some better helpers for math greek letters)</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="341875" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/26">Post #25</a>
	                </div>
	            </div>
              <div id="likers-container-341875" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="341875"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #25"></div>
  </section>
</div>
    <div class="postbit" id="341934" data-post-id="341934">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>After some (too much?) time dealing with the intrincacies of unicode and with the way common fonts handle unicode math characters in practice, I have now implemented most mathematical alphanumeric mathematical characters. I have implemented them as functions which return the respective character, and not as part of a markup language. Since Quartz is meant to draw figures from Elixir code, I think using elixir code as an input method for mathematrical characters is appropriate. I might implement a markup language in the future though, probably inspired by Typst or LaTeX.</p>
<p>Here is a list with the characters that are currently supported (I had to massibely downgrade the image quality to upload it to the forum, the real quality of the image is much crisper): <a href="https://tmbb.github.io/quartz/Quartz.Math.html" rel="noopener nofollow ugc">https://tmbb.github.io/quartz/Quartz.Math.html</a></p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="341934" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/27">Post #26</a>
	                </div>
	            </div>
              <div id="likers-container-341934" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="341934"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #26"></div>
  </section>
</div>
    <div class="postbit" id="343352" data-post-id="343352">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Big landmark! Quartz can now accurately rotate text, which means it can render actual real-world labels for the Y-axis of plots:</p>
<p>Some questions for whoever may be following this:</p>
<ol>
<li>
<p>What do you think of the choice of using the Sans-Serif Ubuntu font as a default? The license is quite permissive, and it’s certainly prettier than other options such as DejaVu, used by Matplotlib. However, I’ve been thinking of making the default a Serif font, such as Linux Libertine (which I actually use to typeset math characters)</p>
</li>
<li>
<p>Now that I can support rotation of text and legends, I think that it might be the right time to think about releasing a 0.1 version. What do you think would be the “essential” plot types for an actual release on Hex? I already support the histogram, the KDE for continuous distributions, line plots, scatterplots and “fill-between” plots. For things like survival analysis, plotting a step function is useful (survival functions are usually represented as Kaplan-Meier plots, which are pretty much always displayed as step functions)</p>
</li>
<li>
<p>Anyone here is interested in diving into the constraint-solving part of things? Currently it works very well, and allow for very useful dynamic layouts in which things “fit into place” magically. The problem is that failures aren’t really debuggable. Is anyone here experienced with Linear programming solvers or other kinds of constraint solvers? When  the linear solver fails, the mains problem is that I just raise an error and can’t give the user any feedback on which constraints are causing problems or why. Is there any literature on this? Should I just randomly remove constraints from the problem (with something like a binary search) and try to detect which of them cause problems? The way things are implemented now, there won’t be any constraint-solving problems unless the user creates “raw” constraints using the <code>Figure.assert/1</code> macro, but I wonder if one can enhance debuggability</p>
</li>
<li>
<p>For actual real-life plots, how important would it be to support proper mathematical formulas beyond math symbols, subscripts and superscripts? I figure I can probably integrate with Typst to get proper math typesetting, but that would split text handling into two. Or maybe I could integrate with Typst for all text and leave the shape renfering to Quartz</p>
</li>
</ol> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="343352" data-batch-url="/posts/batch_likers">
                        3
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/28">Post #27</a>
	                </div>
	            </div>
              <div id="likers-container-343352" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="343352"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #27"></div>
  </section>
</div>
    <div class="postbit" id="356129" data-post-id="356129">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>I have published Makeup on Hex, but I’m hitting some space limits on hexdocs (not on hex itself). This is probably mostly because of the images inlcuded in the documentation.</p>
<pre data-code-wrap="plaintext"><code class="lang-plaintext">Package published to https://hex.pm/packages/quartz/0.3.0 (5ac61246b71f812030b209eea264f90cc682950fe6f45a8241659d03661856f0)
Publishing docs...
** (MatchError) no match of right hand side value: {:error, {:tarball, {:too_big_uncompressed, 67108864}}}
    (hex 2.1.1) lib/mix/tasks/hex.publish.ex:403: Mix.Tasks.Hex.Publish.build_docs_tarball/1
    (hex 2.1.1) lib/mix/tasks/hex.publish.ex:176: Mix.Tasks.Hex.Publish.create_docs/4
    (hex 2.1.1) lib/mix/tasks/hex.publish.ex:153: Mix.Tasks.Hex.Publish.create/3
    (mix 1.16.0) lib/mix/task.ex:478: anonymous fn/3 in Mix.Task.run_task/5
    (mix 1.16.0) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /home/tmbb/.asdf/installs/elixir/1.16.0/bin/mix:2: (file)
</code></pre>
<p>What exactly is this limit? I can’t find it in the code (I can’t find the source of the probably erlang module that’s saying a limit has been hit). I’d like to know what the limit is to decide whether I’ll somehow try to save some space or whether I should host the docs somehwere else instead. Pinging the hex team because this seems related to hex <a class="mention-group" href="/groups/hex-core-team" rel="nofollow">@Hex-Core-Team</a></p>
<p>Thanks!</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356129" data-batch-url="/posts/batch_likers">
                        1
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/29">Post #28</a>
	                </div>
	            </div>
              <div id="likers-container-356129" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356129"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #28"></div>
  </section>
</div>
    <div class="postbit" id="356168" data-post-id="356168">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="tmbb" src="/assets/icons/user-9f439610.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  tmbb
                    <span class="op-star" title="Thread Starter">
                      <img alt="OP" class="op-star-icon" src="/assets/thread-icons/thread-icon-thread-starter-df91e872.png" />
                    </span>
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<p>Here is a link to a demo page, which is part of the docs: <a href="https://tmbb.github.io/quartz/Quartz.Demo.html" rel="noopener nofollow ugc">https://tmbb.github.io/quartz/Quartz.Demo.html</a></p>
<p>This shows a number of plot types as well as a sample of the text handling capabilities.</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356168" data-batch-url="/posts/batch_likers">
                        2
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/30">Post #29</a>
	                </div>
	            </div>
              <div id="likers-container-356168" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356168"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #29"></div>
  </section>
</div>
    <div class="postbit" id="356171" data-post-id="356171">
  <section>
    <div class="post-wrap">


					<div class="post-header">
		        <div class="user-avatar">
		          <img alt="christhekeele" src="https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/christhekeele/120/1039_2.png" width="120" height="120" />
		        </div>
					
						<div class="user-details">
		          <div class="user-name">
		            <h3>
                  christhekeele
                  </h3>
		          </div>
						
						</div>
					
					</div>

	        <div class="thread-main">
	            <div class="post-body" data-turbo="false">
								<aside class="quote no-group" data-username="tmbb" data-post="29" data-topic="56576">
<div class="title">
<div class="quote-controls"></div>
<img alt="" width="24" height="24" src="https://forum.elixirforum.com/letter_avatar_proxy/v4/letter/t/77aa72/48.png" class="avatar"> tmbb:</div>
<blockquote>
<p>What exactly is this limit? I can’t find it in the code (I can’t find the source of the probably erlang module that’s saying a limit has been hit).</p>
</blockquote>
</aside>
<p>It looks like <a href="https://github.com/hexpm/hex/blob/0f7c66f5cab7436170daa7403d8d33193f5713aa/lib/mix/tasks/hex.publish.ex#L403" rel="noopener nofollow ugc">this line</a> is failing to match. There are a few places (<a href="https://github.com/hexpm/hex/blob/0f7c66f5cab7436170daa7403d8d33193f5713aa/src/mix_hex_tarball.erl#L96" rel="noopener nofollow ugc">1</a>, <a href="https://github.com/hexpm/hex/blob/0f7c66f5cab7436170daa7403d8d33193f5713aa/src/mix_hex_tarball.erl#L143" rel="noopener nofollow ugc">2</a>) in the erlang module that can return <code>:too_big_uncompressed</code>, but the limit <code>TarballMaxUncompressedSize</code> seems to be set <a href="https://github.com/hexpm/hex/blob/main/src/mix_hex_tarball.erl#L74" rel="noopener nofollow ugc">from config</a> that is vendored in some way from <code>hex_core</code>. That leads me to <a href="https://github.com/hexpm/hex_core/blob/main/src/hex_core.erl#L53-L54" rel="noopener nofollow ugc">this comment</a> that implies a default limit of <code>134_217_728</code> bytes (<a href="https://github.com/hexpm/hex_core/blob/main/src/hex_core.erl#L121" rel="noopener nofollow ugc">128 * 1024 * 1024</a>), which seems well under your <code>67_108_864</code>? So maybe hex.pm itself is configured with something below this default maximum?</p> 
	            </div>

	            <div class="base-line">
	                <div class="thread-counters">
	                    <span class="thread-count count-likes js-likers-trigger" title="Likes" data-post-id="356171" data-batch-url="/posts/batch_likers">
                        0
                      </span>
                      <!-- <span class="thread-count js-solved-indicator" title="Marked as solution"></span> -->
	                </div>
	                <div class="go-to-post">
	                  <a title="Go to post" alt="Go to post" href="https://forum.elixirforum.com/t/quartz-data-visualization-library-aimed-at-publication-not-interactive-display/56576/31">Post #30</a>
	                </div>
	            </div>
              <div id="likers-container-356171" 
                   class="likers-container"
                   data-first-post="false"
                   data-batch-url="/posts/batch_likers">
                   <div class="likers-placeholder" 
                     data-likers-post-id="356171"
                     data-batch-url="/posts/batch_likers">
                  <div class="post-likers"></div>
                </div>
              </div>
	        </div>
			

    </div>

    <div class="triangle-top-right type-standard-post cat-standard-post" title="Post #30"></div>
  </section>
</div>
</template></turbo-stream><turbo-stream action="replace" target="load-more-container"><template><div id="load-more-container" class="load-more-container">
    <a class="load-more-button" data-turbo-stream="true" href="/topics/56576/load_more?page=4">Load more posts (2 remaining)</a>
</div></template></turbo-stream>