小编Ran*_*mao的帖子

使用 VH 表示的高度响应框 SVG

我希望能够以忽略纵横比(适合屏幕)的方式将我的 SVG 图形适合我的 div。但是,当我更改窗口宽度时,我的图表会超出我的黄色框。如何使用 vh 表示的 div 高度来纠正这种情况?

未将图拟合到黄色框

.svg-container {
  display: inline-block;
  position: relative;
  width: 100%;
  height: 60vh;
  /* aspect ratio */
  vertical-align: top;
  overflow: hidden;
  background-color: yellow;
}
.svg-content-responsive {
  display: inline-block;
  position: absolute;
  top: 10px;
  left: 0;
}
.line {
  fill: none;
  stroke: steelblue;
  stroke-width: 1.5px;
}
Run Code Online (Sandbox Code Playgroud)
<div class="container-fluid" data-ng-swipe-left="showMenu.value = true" data-ng-swipe-disable-mouse="">
  <div aw-resolve-loader="" ui-view="main" class="view reveal-animation ng-scope">
    <div style="float: left" class="ng-scope"></div>
    <div class="ng-scope ng-isolate-scope">
      <div class="svg-container">
        <svg viewBox="0 0 800 600" preserveAspectRatio="none">
          <path class="line" d="M0,600L114.28571428571428,300L228.57142857142856,562.5L457.1428571428571,225L571.4285714285714,375L800,0"></path>
        </svg> …
Run Code Online (Sandbox Code Playgroud)

html css svg responsive-design

7
推荐指数
1
解决办法
5084
查看次数

完全忽略 Gnuplot 中的一些数据行

我想使用 Gnuplot 绘制一种数据透视图。所以我需要忽略文件中的一些数据行。我尝试了以下方法:

unset key

set xtics font "Times-Roman, 5" 
set ytics font "Times-Roman, 5" 

set multiplot layout 4,3 #title "Multiplots\n"

plot [7:50][0:1] 'forStackoverGnuplot.txt' using 1:($2==0?($3==4?$4:NaN):NaN) with lines ti '4'
plot [7:50][0:1] 'forStackoverGnuplot.txt' using 1:($2==0?($3==4?$4:"fe"):"fe") with lines ti '4'
Run Code Online (Sandbox Code Playgroud)

数据文件:

20  0   5   0.668593155
7   0   4   0.885223087
20  0   5   0.668593155
10  0   4   0.92239289
20  0   5   0.668593155
20  0   4   0.834947746
30  0   4   0.693726036
50  0   4   0.47169919
Run Code Online (Sandbox Code Playgroud)

但我得到: 糟糕的图表

这不是我预期的结果。我能做什么?我想让数据线交错。

pivot-table gnuplot

2
推荐指数
1
解决办法
4759
查看次数

标签 统计

css ×1

gnuplot ×1

html ×1

pivot-table ×1

responsive-design ×1

svg ×1